Hi Michael > set(SRCS a.c b.c d.c e.c) > > add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/f.c > COMMAND ... > DEPENDS ${SRCS} > COMMENT "Generating f.c" > VERBATIM) > list(APPEND SRCS ${CMAKE_BINARY_DIR}/f.c) > > add_executable(main ${SRCS})
Thanks - that worked nicely. Now I have another problem. I need to link to the Python libraries. So I specify: FIND_PACKAGE(PythonLibs REQUIRED) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) <snip> message (${PYTHON_LIBRARY}) add_library( Kernel STATIC ${SRCS} ) TARGET_LINK_LIBRARIES(Kernel ${PYTHON_LIBRARY}) The message shows: /usr/lib64/libpython2.4.so but this path does not appear in the link command so the build fails. I am trying to build a static library so am worried why ${PYTHON_LIBRARY} is a shared library. By the way, is it normal CMake style to write CMAKE commands in upper or lower case? Can you help with these questions please? BR David _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake