[CMake] Building multiple releases for a visual studio project
Torri, Stephen CIV NSWCDD, W15
stephen.torri at navy.mil
Tue Jun 8 16:20:39 EDT 2010
> From: John Drescher [mailto:drescherjm at gmail.com]
> Sent: Tue 6/8/2010 3:55 PM
> To: Torri, Stephen CIV NSWCDD, W15
> Cc: cmake at cmake.org
> Subject: Re: [CMake] Building multiple releases for a visual studio project
>
> > On Tue, Jun 8, 2010 at 2:52 PM, Torri, Stephen CIV NSWCDD, W15 <stephen.torri at navy.mil> wrote:
> > I was wondering if it was possible to have a CMake project that builds a Microsoft Visual Studio Project produce an
> > NSIS installer for each kind of build (e.g. debug, release, RelWithDebug). Right now I can build the project via Visual
> > Studio for all the build types which is great. Now I would like to have one NSIS installer for each type. Is that possible?
>
>
> Copy the package then switch the build type in visual studio and then
> run package. The file overwrites the previous nsis package with the
> same name but I am pretty sure it builds for the current
> configuration.
I see I can do "cpack -G NSIS -C Debug ../" from my build directory to get it to produce a NSIS file for the debug version. It would be nice to be able to set a name for each release build in the top CMakeLists.txt file. So you could have something like:
<New Feature>
Append project name allow option to override default name.
---------------------------------------------------------------------------------
CPACK_PACKAGE_NAME - works the same as it does now to provide a name for the package.
For each build append the name of the release to the name. For example
CPACK_PACKAGE_NAME = "MyLib"
If I do "cpack -C Debug" then I get a package with the name
MyLib-0.0.1-win32-Debug.exe
Now if I provide a CPACK_PACKAGE_NAME_APPENDIX_<config> then use the provided string as an appendix to the package name. If this is not present then use the default name.
Therefore if I provide:
CPACK_PACKAGE_NAME_APPENDIX_DEBUG = "dbg"
I would get
MyLib-0.0.1-win32-dbg.exe
if I did the same cpack command above.
Its an idea. This way you could write a script to build all the package types you want from the command line.
Stephen
More information about the CMake
mailing list