vendredi 26 janvier 2018

Appending CXX_FLAGS in cmake invocation

I am wondering if it is possible to append to inferred variables when calling cmake. Due either the compiler or the app supplied CMakeLists.txt C++11 support isn't detected by cmake even though it is supported and the application requires it. If I do:

cmake-DCMAKE_CXX_FLAGS='-std=c++11' ../source_dir

The flags get overwritten and I wouldn't like to lose the inferred flags. I could manually run without overwriting and just copy the flags and append c++11 but I think there must be a better solution.

I have found a number of posts on adding c++11 support to CMakeLists.txt but not in cmake call, so I am wondering if this is possible at all. Please let me know.

Aucun commentaire:

Enregistrer un commentaire