[CMake] SubDirs and Libraries

Brad King brad.king at kitware.com
Thu Oct 5 16:40:01 EDT 2006


James Mansion wrote:
> I think you need a dependency declaration too don't you?
> 
> I've seen VStudio 2k3 build out of order without.
> 
>> # App/CMakeLists.txt
>> ADD_EXECUTABLE(myexe ...)
>> TARGET_LINK_LIBRARIES(myexe mylib)
> 
> It seems actually a little more complicated in practice
> because you probably want mylib's headers (possibly including
> configured ones) to be available to myexe's files too.

Currently this can be done by setting up INCLUDE_DIRECTORIES in the top
level CMakeLists.txt file.  However there will be support in the future
for specifying a user interface for a target.  Then a library will be
able to specify the include directories needed to use it, and when
something links to it the source files of the other target will get the
necessary include path automatically.  This is probably a ways off though.

-Brad


More information about the CMake mailing list