MantisBT - CMake
View Issue Details
0015017CMake(No Category)public2014-07-11 18:242016-06-10 14:31
rhl 
Kitware Robot 
normalfeaturealways
closedmoved 
CMake 3.0 
 
0015017: Changing compiler/library versions, Finding Packages, and etc.
Hi,

I really enjoy using CMake, it takes a lot of redundancy and hassle out of build systems. Thank you to
all developers involved :)

I am writing to request the developers to consider making a high level change to the way that the compilers are chosen and changed as well as packages are added.

It would be great if there was a way (say within ccmake) to selectively choose which of the many compilers on a system are available, and, when adding packages via find_package, if some list of the available FindXXX.cmake scripts could be made conveniently available. Regularly I am on a system with many compiler choices ( a modern os/x machine with homebrew will have clang by default, but gcc installed on the side potentially, or gcc symlinked to clang) and possibly many library versions. It would be great to be able to selectively choose when running cmake or ccmake which of these libraries/compilers I want to compile/link with based on what cmake is able to find when inspecting the system.

On linux with the environment-modules or like program, many many different compilers can be available, many flavors of gcc, icc, clang, etc.. I find it a hassle to have to modify the CMakeLists.txt each time i need to change the compiler and add/remove specific compiler flags.

I'm sure you are all busy and i'm not sure if anyone else is interested in this, or some variant of this idea..

At any rate, thanks again for all your hard work.
No tags attached.
Issue History
2014-07-11 18:24rhlNew Issue
2014-07-14 10:52Brad KingNote Added: 0036369
2014-07-14 10:53Brad KingNote Added: 0036370
2016-06-10 14:29Kitware RobotNote Added: 0042584
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036369)
Brad King   
2014-07-14 10:52   
You shouldn't be setting the compiler in CMakeLists.txt code.

You can set it in the CC and CXX environment variables before running cmake or ccmake. You can edit flags in the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS cache entries. Find results are also stored in the cache and can be edited in ccmake or cmake-gui. Local build trees are highly configurable without modifying CMakeLists.txt.
(0036370)
Brad King   
2014-07-14 10:53   
A more appropriate place to ask for help is on the mailing list:

 http://www.cmake.org/mailman/listinfo/cmake [^]
(0042584)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.