[CMake] Pseudo library

☂Josh Chia (谢任中) joshchia at gmail.com
Fri Aug 19 22:33:27 EDT 2011


I have a C++ .h file with template classes that require the Python and
Boost-Python libraries for successful linking. There is no associated .cpp
file.

I consider this .h file a library that other parts of my project can use.
The CMakefile.txt for those parts should not need to know the implementation
detail that the Python and Boost-Python libraries are needed. Is there a way
to create a pseudo-library, say, 'foo', that those other parts can link,
e.g. with target_link_libraries, so that they just need to link the pseudo
library 'foo' in order to effectively depend on and link to the Python and
Boost-Python libraries?

Note that my pseudo-library is pseudo because it doesn't have any .cpp file.
I can't actually compile that into a real library, and add_library won't
allow me to specify zero source  files.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110819/97f6413c/attachment.htm>


More information about the CMake mailing list