Re: [CMake] Idomatic cmake: Supporting gcc, icc, and clang with custom flags for each?

2016-05-17 Thread Gallagher, Timothy P
We do what Chuck showed inside our CMakeLists for different flags for each compiler. To answer your other question, I prefer to use the shorter form: > CC=icc FC=ifort CXX=icpc cmake /path/to/source which sets the CC, FC and CXX environment variables only for that ccmake command without cha

Re: [CMake] Idomatic cmake: Supporting gcc, icc, and clang with custom flags for each?

2016-05-17 Thread TCW via CMake
Hi Chuck, Interesting. The flat list is not so bad i guess. (As an include.) I was thinking that cmake might support some kind of hierarchical platform definition system like Qt's qmake. (Not that it's without foibles either.) On the compiler selection question I'm still wondering if normative

[CMake] Xcode, -isystem, and qt5_use_modules

2016-05-17 Thread Breannan Smith
When I generate a makefile project with CMake that calls qt5_use_modules, qt5_use_modules prepends all Qt5 includes with the -isystem flag. If I generate an Xcode project with the same CMakeLists.txt configuration, however, the -isystem flag is not prepended to includes when Xcode builds the projec

Re: [CMake] Idomatic cmake: Supporting gcc, icc, and clang with custom flags for each?

2016-05-17 Thread Chuck Atkins
Hi TCW, A typical approach for this is in the top level CMakeLists.txt to have: include(CompilerFlags) And then you can isolate the detection and specialization logic in a separate CompilerFlags.cmake: if(CMAKE_COMPILER_IS_GNUC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS" -extra --gcc-options") elsei