[CMake] Newbie question: TARGET_LINK_LIBRARIES vs. ADD_DEPENDENCIES

Christian Convey christian.convey at gmail.com
Tue Aug 7 09:01:35 EDT 2007


I've got two subprojects: A library FOO, and a program BAR.

If I have this:
ADD_EXECUTABLE(BAR main.cpp)
TARGET_LINK_LIBRARIES(BAR FOO)


Then does CMake somehow realize that it needs to build its FOO library
before trying to link the BAR program?

Or do I need to explicitly tell it to do this, using a command such as
the following?
ADD_DEPENDENCIES(FOO BAR)

Thanks,
Christian


More information about the CMake mailing list