2012/2/25 Krzysztof <[email protected]>:
> Does CMake know that if I include a header file in a source it should
> consider the source as dependent on the header? I mean, will CMake recompile
> the source when only the header changes or do I need explicitly tell CMake
> this in CMakeLists.txt?

CMake has a builtin dependency checker for supported language (C, C++,
Fortran, ...)
so yes it should work.

Did you try ? Do you have a counter-example?

That said specifying all files (including headers) in your CMakeLists.txt
may be a good habit too.

Have a look at:

PUBLIC_HEADER, PRIVATE_HEADER, HEADER_FILE_ONLY CMake properties.
cmake --help-property PUBLIC_HEADER

and the PUBLIC_HEADER option of the INSTALL(TARGETS) command.

you'll see that explicitely specifying headers in CMakeLists.txt may be useful.
-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to