Re: [CMake] How to let the user select the compiler and compiler flags.

2013-04-01 Thread Daniel Carrera
Hi David, Thanks. That seems to work well. I tweaked your idea to allow the user to have two different config files. To do that, instead of using -C, I have two "include" lines in my CMakeLists.txt. It seems to work well. I just have to make sure I explain clearly which file takes precedence. Che

Re: [CMake] How to let the user select the compiler and compiler flags.

2013-04-01 Thread David Cole
Do use CACHE with your set statements to put them in the cache, and then use the -C command line argument to prime the cache with your file, rather than including it in your CMakeLists file. That should have the effect you're seeking... HTH, David C. On Apr 1, 2013, at 3:54 AM, Daniel Carrera

[CMake] How to let the user select the compiler and compiler flags.

2013-04-01 Thread Daniel Carrera
Hi all, I am just getting started with CMake. Here is my question: Is there a good way to have an external config file that specifies both the compiler an compile flags? The program is compiled many times, and it makes sense to have the compiler and flags in a config file rather than have them in