[CMake] CMAKE changing Visual Studio Settings

Eric Clark eclark at ara.com
Tue Jul 22 17:12:46 EDT 2014



> -----Original Message-----
> From: CMake [mailto:cmake-bounces at cmake.org] On Behalf Of John
> Drescher
> Sent: Monday, July 21, 2014 3:55 PM
> To: Joseph Rosensweig
> Cc: CMake ML
> Subject: Re: [CMake] CMAKE changing Visual Studio Settings
> 
> > So CMAKE can't control the options int he *.user files I guess :-\?
> > Would a potential workaround be to find a command line tool that can
> > edit these and run it as a post-build script?
> 
> CMake gives you the functionality needed to edit these via your own script. I
> mean reading and writing files replacing text.

In our CMake system, we wanted to be able to set the program to execute when "Start Debugging" was clicked in Visual Studio. This option is stored in the *.user file and thus you cannot change it via CMake directly. However, you CAN build a template of the *.user file and put some CMake variables inside of it. Then, when you build the project files with CMake, you can use the configure_file command to create the user's *.user file from the template and the values you have for each variable in the template. This option works beautifully and it is very easy to setup.

Hope this helps...
Eric

> 
> John
> --
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list