[CMake] cmake (no longer?) complains about missing files

Brad King brad.king at kitware.com
Tue May 27 13:13:32 EDT 2008


Brad King wrote:
> Christian Ehrlicher wrote:
>> add_executable(myExecutable ${CMAKE_BINARY_DIR}/my_source.cpp)
>>
>>
>> cmake does not complain when the file does not exist. For instance when I forgot the add_custom_command() or misspelled the filename. Instead I get an error from make.
>> I know there was a change from 2.6.0rc9 to 2.6.0final which fixed an error when a file was created on build-time but the add_custom_command() wasn't already defined.
> 
> This was part of that change.  We decided that if the user provides a
> full path then we should just trust them that the file will be there in
> time for the build.  It is possible that the file is produced as a
> side-effect of some other step in a way that CMake does not know.

Since the build could take a long time before discovering a typo we've
reversed that decision.  The use case I mentioned can be handled by
setting the GENERATED property on a source.  I've restored the check at
CMake time that the source exists even if an unambiguous full path is given.

-Brad


More information about the CMake mailing list