29 March 2013

How to define CMake options


The most time, defining (and exporting) CFLAGS and CXXFLAGS options
before using cmake is enough.

For UNIX Makefiles generation/use, cmake options can be specified in cmake/compiler/ directory files.
For instance for GCC, options can be defined in file:
cmake/compiler/gcc/settings.cmake

When using in Eclipse CDT, options can be updated/adapted in file which is produced in same time of Eclipse project Metadata files:
CMakeCache.txt

For instance, it is then possible to add options to gcc with CMAKE_CXX_FLAGS:STRING and CMAKE_C_FLAGS:STRING.

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: