[CMake] ADD_DEPENDENCIES() and NonExisitngDependent is NOT an error?

Claus Klein claus.klein at arcormail.de
Thu Jul 26 12:11:38 EDT 2012


We use a complex cmake project with a lot of build order dependencies.
If something is misspelled, I would expect that cmake find this error.


Example:

cmake_minimum_required(VERSION 2.8.5)
project(ftplibcpp CXX)

add_executable(ftpList ftpList.cpp)
target_link_libraries(ftpList ftpcpp ${LIBS})

ADD_DEPENDENCIES(ftpList ftpcpp;NonExisitngDependent)   # this is ok  
for cmake but should be an error?
ADD_DEPENDENCIES(NonExistingTarget ftpcpp;NonExisitngDependent) #  
cmake ERROR

---------------------------------

CMake Error at CMakeLists.txt:8 (ADD_DEPENDENCIES):
   add_dependencies Adding dependency to non-existent target:
   NonExistingTarget

...

IMO this should be too an error if one of the dependency targets does  
not exist at a cmake project.

Can anyone please help?

Thanks in advance
Best Regards
Claus



More information about the CMake mailing list