[CMake] Fwd: How to build INSTALL project from the command line?
John Drescher
drescherjm at gmail.com
Tue Nov 10 17:23:08 EST 2009
---------- Forwarded message ----------
From: John Drescher <drescherjm at gmail.com>
Date: Tue, Nov 10, 2009 at 5:22 PM
Subject: Re: [CMake] How to build INSTALL project from the command line?
To: Aaron_Wright at selinc.com
On Tue, Nov 10, 2009 at 5:09 PM, <Aaron_Wright at selinc.com> wrote:
>
> I've been trying to build the INSTALL project as part of the solution from
> the commandline. For example, after running:
>
> cmake -G "Visual Studio 9 2008" ..
>
> I've tried:
>
> msbuild /t:INSTALL /p:Configuration=Release solution.sln
>
> But this builds ALL_BUILD and then tells me tells me:
>
> The project "INSTALL" is not selected for building in solution configuration
> "Release|Win32"
>
> Is there a way to make this work from cmake's end? I've tried every
> commandline swtich I can think of for msbuild but have had no luck. I can
> build the INSTALL.vcproj directly, but this looses the dependencies between
> projects, like INSTALL's dependency on ALL_BUILD. I'd like to get this done
> with one call if possible.
I have each project configure an install.bat.in file that creates an
install.bat file in the build folder
Here is a sample install.bat.in
devenv @PROJECT_BINARY_DIR@\@PROJECT_NAME at .sln /build Debug /project INSTALL
devenv @PROJECT_BINARY_DIR@\@PROJECT_NAME at .sln /build
@RELEASE_BUILD_NAME@ /project INSTALL
Then the generated install.bat
devenv X:/32Bit/VC.80/Qt/QtBasicUtils\QtBasicUtils.sln /build Debug
/project INSTALL
devenv X:/32Bit/VC.80/Qt/QtBasicUtils\QtBasicUtils.sln /build
RelWithDebInfo /project INSTALL
And the configuration in my CMakeLists.txt
IF (MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebInfo" CACHE STRING
"Debug;RelWithDebInfo" FORCE)
SET (RELEASE_BUILD_NAME "RelWithDebInfo")
ELSE(MAKE_DEBUGRELEASE)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Debug;Release" FORCE)
SET (RELEASE_BUILD_NAME "Release")
ENDIF (MAKE_DEBUGRELEASE)
configure_file (
"${PROJECT_SOURCE_DIR}/install.bat.in"
"${PROJECT_BINARY_DIR}/Batch/install.bat"
)
--
John M. Drescher
More information about the CMake
mailing list