[CMake] Debug vs Release "install" area

J Decker d3ck0r at gmail.com
Fri May 13 22:10:50 EDT 2016


I meant to also add; when I first was porting my projects to cmake, I
thought this was a thing I wanted to do also... turns out, it's just a
lot easier to make 2 build trees and build one release and one debug
and have the same output image exactly for both... then install one or
the other for use with other projects....  (no renaming files and
adding 'd', no extra subdirectories... bin/debug and bin/release... )

On Thu, May 12, 2016 at 1:07 PM, Scott Aron Bloom <scott at towel42.com> wrote:
> 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
>
>
>
>
>
>
> --
>
> 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