[CMake] Debug vs Release "install" area

Scott Aron Bloom scott at towel42.com
Thu May 12 16:07:38 EDT 2016


Looking for some advice.

In order to make our Visual Studio debugging environment, as self-contained (and easy to use for the developers) as possible, we use developers must run an install.  We also use the resulting release based Install for our packaging into our installer.

We change the prefix variable CMAKE_INSTALL_PREFIX, to  ${CMAKE_BINARY_DIR}/Install, as well as having a each application call a function that places a .user.vcxproj that sets the PATH appropriately.

It really works great, except there is one caveat.  VC++ has libraries that are debug vs release dependent, so if your debug build happens to pick up a release DLL (or vice versa) you can (will) be in trouble in random ways.

Typically, when I change over, I simply delete the install, and re-install.

Ideally, I would like to know is there any way to set the CMAKE_INSTALL_PREFIX variable separately for debug vs release? If so how?

A second option, which I thought of...

Is to generate a file "DEBUG.BUILD.TXT" and then at the START of the installation process, run a script for debug builds, that says if the file doesn't exist, delete everything and carry on.  If running for a release install, if it DOES exist delete and carry on.


Any thoughts on this?

Thanks

Scott


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160512/e84780fc/attachment-0001.html>


More information about the CMake mailing list