[CMake] POST_BUILD in a different directory
Judicaël Bedouet
j.bedouet at infonie.fr
Thu Apr 24 08:16:32 EDT 2008
Hello,
I would like to use the POST_BUILD option of the command
ADD_CUSTOM_COMMAND in a CMakeLists.txt, different from the
CMakeLists.txt which is used to
generate the target. I made this test.
In the top level source directory,
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
PROJECT (test CXX)
ADD_SUBDIRECTORY (lib1)
ADD_SUBDIRECTORY (lib2)
In the directory lib1/,
ADD_LIBRARY (lib1 lib1.cpp)
ADD_CUSTOM_COMMAND (TARGET lib1 POST_BUILD
COMMAND echo
ARGS "Hello"
COMMENT "echo hello 1"
)
In the directory lib2/,
ADD_CUSTOM_COMMAND (TARGET lib1 POST_BUILD
COMMAND echo
ARGS "Hello"
COMMENT "echo hello 2"
)
The echo command in lib2/ is never executed.
This is a dummy example but in the case of my project, I would like to
generate a library in directory lib\ and documentation in directory
doc\. Documentation must be regenerated only when the library is
rebuilt.
Is there a way to make the option POST_BUILD works in another directory ?
I'm working under Linux with cmake 2.6-0 RC-8.
Thanks,
J. Bedouet
More information about the CMake
mailing list