[CMake] pkg-config support

Werner Smekal smekal at iap.tuwien.ac.at
Sat Dec 27 14:54:06 EST 2008


Hi,


> Thanks, seems like this approach would do the trick. But how do I get,
> for example, C++ flags for compilation? Now I have in my
> CMakeLists.txt:
> get_property (COMPILETIME_OPTIONS
>     TARGET torrent-rasterbar
>     PROPERTY COMPILE_DEFINITIONS
>     )
> get_property (CPPFLAGS
>     TARGET torrent-rasterbar
>     PROPERTY COMPILE_FLAGS
>     )
> And after these lines the variables COMPILETIME_OPTIONS and CPPFLAGS
> are both empty.
>   

These are empty, since these are additional flags to be used for the 
target - if you didn't set them, they are empty. You are looking for the 
global variables CMAKE_CXX_FLAGS_DEBUG 
(http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_LANG_FLAGS_DEBUG) 
or similar, look at the global variables here: 
http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Variables%20for%20Languages.

On the other side: These are the flags used to build your library not 
the flags for using you library. This may not be the same flags, or?

Regards,
Werner
>
>   


-- 
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria
DVR-Nr: 0005886

email: smekal at iap.tuwien.ac.at
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
       +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499



More information about the CMake mailing list