[CMake] using cpp file which is not there

William A. Hoffman billlist at nycap.rr.com
Wed Jan 4 16:36:14 EST 2006


At 04:28 PM 1/4/2006, klaas.holwerda wrote:
>Hi,
>
>( Vc6 Cmake 2.2. beta )
>
>I have the next peace of Cmake, the first ADD_CUSTOM_COMMAND, does generate files used by the second ADD_LIBRARY.
>
>If the files are not  there at the start, Cmake tells me that they should be.
>How can i fool Cmake to ignore the fact that they are not there yet?
>
>Thanks,
>
>Klaas
>
>ADD_CUSTOM_COMMAND( OUTPUT ${luawraps_SOURCE_DIR}/src/luawraps.cpp
>COMMAND ${luawraps_BINARY_DIR}/src/genwxbind.bat
>DEPENDS
>   ${wxart2d_BINARY_DIR}/include/luasetup.h
>   ${luawraps_BINARY_DIR}/src/luawraps.i
>)
>
>ADD_LIBRARY( luawraps
>   ${a2d_PCH_SOURCE_FILE}
>   ${luawraps_SOURCE_DIR}/src/luawrap.cpp
>   ${luawraps_SOURCE_DIR}/src/luawraps.cpp
>   ${luawraps_SOURCE_DIR}/src/wxart2d_builtin.cpp
>   ${luawraps_SOURCE_DIR}/src/wxart2d_class.cpp
>   ${luawraps_SOURCE_DIR}/src/wxart2d_define.cpp
>   ${luawraps_SOURCE_DIR}/src/wxart2d_event.cpp
>   ${luawraps_SOURCE_DIR}/src/wxart2d_object.cpp    
>   ${luawraps_SOURCE_DIR}/src/wxledit.cpp
>   ${luawraps_HEADERS}
>)

You want to look at:
SET_SOURCE_FILES_PROPERTIES, and GENERATED,
something like this:

>SET_SOURCE_FILES_PROPERTIES(${luawraps_SOURCE_DIR}/src/luawrap.cpp PROPERTIES GENERATED 1)


-Bill




More information about the CMake mailing list