2009/10/9 jens persson <j...@persson.cx>: >> >> I think dependency from "extras" should work did you try with >> only "extras" and not "all"? > > Yes I get the following error: > > $ make complete > [100%] Built target bar > [100%] Built target extras > make[3]: *** No rule to make target `extras', needed by > `CMakeFiles/complete'. Stop. > make[2]: *** [CMakeFiles/complete.dir/all] Error 2 > make[1]: *** [CMakeFiles/complete.dir/rule] Error 2 > make: *** [complete] Error 2 > > > With this CMakeLists.txt file: > > PROJECT (tester) > CMAKE_MINIMUM_REQUIRED (VERSION 2.6) > CMAKE_POLICY (VERSION 2.6) > > add_executable(bar > bar.c > ) > add_custom_target(extras > DEPENDS bar > ) > add_custom_target(complete > DEPENDS extras > ) > > > I've tried to look into the makefiles but could not find the solution.
Better look in to the documentation first :-) From cmake --help-command add_custom_target "Dependencies listed with the DEPENDS argument may reference files and outputs of custom commands created with ADD_CUSTOM_COMMAND." the DEPENDS argument of ADD_CUSTOM_TARGET is here to cope with the fact that CMake cannot compute dependency precisely because it's a CUSTOM target whose input is unknown to CMake. thus you cannot use that to specify top-level target dependencies. You should use add_dependencies for that. Working CMakeLists.txt should looks like: PROJECT (tester) CMAKE_MINIMUM_REQUIRED (VERSION 2.6) CMAKE_POLICY (VERSION 2.6) add_executable(bar bar.c ) add_custom_target(extras) add_dependencies(extras bar) add_custom_target(complete) add_dependencies(complete extras) > Probably a bug. Will report it later. Finally I don't think this is a bug. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org _______________________________________________ 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