[CMake] depend on ADD_CUSTOM_COMMAND

klaas.holwerda kholwerd at xs4all.nl
Wed May 18 13:36:27 EDT 2005


Hi,

I don't know how to solve the following:
Its on Vc6.
I generate from the lua wrapping file a file 
${luawraps_BINARY_DIR}/src/wxLuaWrap.cpp
and this is used to build the library.
If  ${luawraps_BINARY_DIR}/src/wxLuaWrap.cpp at the start Cmake 
complains that the file does not exist, so i added a dummy there, just 
to at least be able to configure.
But still luawraps should depend on the custom command which creates the 
file.
I am aware of the PRE_BUILD options, but that is only for Vc7 or later.
How can i do it?

Thanks for any help here,

Klaas

ADD_LIBRARY( luawraps
     luawrap.cpp
    ${luawraps_BINARY_DIR}/src/wxLuaWrap.cpp
)

    ADD_CUSTOM_COMMAND( OUTPUT ${luawraps_BINARY_DIR}/src/wxLuaWrap.cpp
    COMMAND ${luawraps_BINARY_DIR}/src/wrap.bat
    DEPENDS
        ${luawraps_BINARY_DIR}/src/luasetup.h
        ${luawraps_SOURCE_DIR}/src/luawraps.i 
    ) 



More information about the CMake mailing list