Hi

I have a generator that generates some, but not all of the source files.
My understanding was that I should use add_custom_command for that

When I do
set(EXIST_SOURCES A.cc B.cc C.cc)
set(GEN_SOURCES X.cc Y.cc Z.cc)
add_custom_command(OUTPUT ${GEN_SOURCES}
                       COMMAND generator
                       MAIN_DEPENDENCY gendir/generator   )
set_property(SOURCE ${GEN_SOURCES} PROPERTY GENERATED )
add_library(mylib OBJECT "${EXIST_SOURCES} ${GEN_SOURCES}" )

I get error "Cannot find source file : X.cc"

So, I tried

set(EXIST_SOURCES A.cc B.cc C.cc)
set(GEN_SOURCES X.cc Y.cc Z.cc)
add_custom_target(generate
              COMMAND generator
              COMMENT "Generate"
              DEPENDS gendir/generator   )
set_property(SOURCE ${GEN_SOURCES} PROPERTY GENERATED )
add_library(mylib OBJECT "${EXIST_SOURCES} ${GEN_SOURCES}" )
add_dependencies(mylib generate)

I get same error "Cannot find source file : X.cc"

I just don't get it...

Vania

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to