[CMake] Exporting Compiler Flags, Include Directories, etc

Fabian Scheler fabian.scheler at gmail.com
Wed Mar 26 09:25:29 EDT 2014


Hi everybody,

I am currently working on a cmake-buildsystem for a project that
exposes a plugin-interface. This plugin-interface also targets
make-based buildsystems and therefore I wanted to generate a small
makefile-fragment that contains appropriate CFLAGS, LDFLAGS etc. that
should be used to compile the plugin.

What is the best to accomplish this task? I tried to gather target and
directory properties without too much success (it worked well for
include directories but not for COMPILE_DEFINITIONS & Co.). I also
stumbled upon INTERFACE_COMPILE_DEFINITIONS but I have no clue how it
should be used.

Maybe, somebody could point me to some example doing such a thing. The
main point would be to harvest compiler flags from CMAKE - using
configure_file is not a problem.

Thanks in advance!

Ciao, Fabian


More information about the CMake mailing list