[CMake] set a build dependence on an out of tree library

Benjamin Negrevergne Benjamin.Negrevergne at imag.fr
Mon Jul 26 11:17:43 EDT 2010


Hi everyone,

I am new to cmake, tell me if completely wrong about the way to do.
I have the following source tree :
.
├── algorithms/
│   └── algo1/
│       ├── x.h
│       ├── x.c
│   └── algo2/
│       ├── y.h
│       ├── y.c
├── library/
     └── library.c
     └── liblibrary.a


liblibrary.a is to be linked with algorithms algo1 and algo2.
For now I have the following commands in the CMakeList.txt of each algox/ :
add_library(library STATIC IMPORTED)
set_property(TARGET library PROPERTY IMPORTED_LOCATION 
../../library/liblibrary.a)

I would like to set a dependency so whenever I compile algo1 or algo2 
liblibrary.a is built.
Can anyone give me a hint ?


Ben.



More information about the CMake mailing list