[CMake] add_dependencies question
Nico Galoppo
ngaloppo at gmail.com
Tue Feb 19 11:38:27 EST 2008
Hi,
I'm trying to get a 'demo' program inside my project tree to link in
(and depend on) one of the built libraries from the same project tree.
I'm having trouble getting the build process for the demo app to
detect updates of the library. I've tried ADD_DEPENDENCIES() but to no
avail. This is what the tree looks like (partially)
fem/
-fem/
--src/
--include/
-fem_io/
--src/
--include
-demos/
--blendmaterials/
---src/
In toplevel fem/CMakeLists.txt
PROJECT(fem)
...
SET(CMAKE_DEBUG_POSTFIX "d")
SET(FEM_LIBS fem)
SET(FEM_LIBS_DEBUG femd)
In fem/fem/CMakeLists.txt
...
ADD_LIBRARY(fem ${FEM_LIBRARY_SOURCES} ${FEM_LIBRARY_HEADERS})
In fem/demos/blendmaterials/src/CMakeLists.txt:
...
ADD_EXECUTABLE(blendmaterials ${sources} ${headers})
ADD_DEPENDENCIES(blendmaterials fem fem_io)
TARGET_LINK_LIBRARIES(blendmaterials optimized ${FEM_LIBS} debug
${FEM_LIBS_DEBUG})
--
Nico Galoppo :: http://www.ngaloppo.org
More information about the CMake
mailing list