[CMake] Generate content of flags.make manually

Matthias Möller M.Moller at tudelft.nl
Wed Feb 1 19:35:34 EST 2017


Dear all,

for a JIT compiler framework I would like to store the compiler settings created by CMake and used to compile the main code in an XML file.
Under Linux/Mac I find all information I would need in the flags.make file that is generated if I choose "Unix Makefile” as target.

Example:

# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.7

# compile CXX with /usr/local/homebrew/bin/g++-6
CXX_FLAGS =  -Wall -Wno-long-long -Wattributes -ftrack-macro-expansion=0 -fopenmp -O2 -g    -std=c++11

CXX_DEFINES = -DMOTOR_DATA_DIR=\"/Users/mmoller/codes/gismo.svn/motor/filedata/\"

CXX_INCLUDES = -I/Users/mmoller/codes/gismo.svn/devel/src -I/Users/mmoller/codes/gismo.svn/stable/src -I/Users/mmoller/codes/gismo.svn/stable/external -I/Users/mmoller/codes/gismo.svn/stable/extensions -I/Users/mmoller/codes/gismo.svn/build-gcc6-compflow/stable/extensions/gsCoDiPack/CoDiPack/include -I/Users/mmoller/codes/gismo.svn/build-gcc6-compflow/stable -I/Users/mmoller/codes/gismo.svn/devel/external -I/Users/mmoller/codes/gismo.svn/build-gcc6-compflow/devel -I/Users/mmoller/codes/gismo.svn/motor/src -I/Users/mmoller/codes/gismo.svn/motor/tud/src


Is there an easy mechanism to explicitly force the generation of the above variables in CMakeLists.txt so that I could pass them to a configure file?

Thanks in advanced and kind regards,
Matthias



More information about the CMake mailing list