[CMake] CMake 2.5 GENERATED true bug
William A. Hoffman
billlist at nycap.rr.com
Fri May 12 23:14:02 EDT 2006
At 07:14 PM 5/12/2006, Brandon J. Van Every wrote:
>I'm building with cmake version 2.5-20060510. The following is either a bug, or I don't understand the docs because they're not terribly clear.
>
>
>ADD_CUSTOM_COMMAND(
> OUTPUT ${Chicken_BINARY_DIR}/cheese.c
> MAIN_DEPENDENCY ${Chicken_SOURCE_DIR}/batch-driver.scm
> COMMAND cp ${Chicken_SOURCE_DIR}/batch-driver.scm ${Chicken_BINARY_DIR}/cheese.c
>)
>SET_SOURCE_FILES_PROPERTIES(${Chicken_BINARY_DIR}/cheese.c PROPERTIES GENERATED true)
>ADD_DEPENDENCIES(${Chicken_BINARY_DIR}/cheese.c parameters.scm)
>
>
>This fails with:
>
>CMake Error: Error in cmake code at
>E:/devel/src/chicken/CMakeLists.txt:233:
>ADD_DEPENDENCIES Adding dependency to non-existent target: E:/devel/msys/chicken/cheese.c
>
>
>The reason I want to ADD_DEPENDENCIES independent of the ADD_CUSTOM_COMMAND is it makes MACROS and argument passing a lot easier. I prefer to automate whatever I can rather than write out many tedious verbose lines of similar commands. I am already using the MACRO ARGV to add extra compile flags, and I really don't want to parse for things to stick in a DEPENDS.
ADD_DEPENDENCIES is only for adding depends between two targets. It can not
be used for files. You have to use the DEPENDS on the ADD_CUSTOM_COMMAND.
-Bill
More information about the CMake
mailing list