[CMake] CMake Visual Studio Configuration Single

J Decker d3ck0r at gmail.com
Mon Jun 30 07:59:59 EDT 2014


On Mon, Jun 30, 2014 at 3:09 AM, David Cole <dlrdave at aol.com> wrote:

> You can set CMAKE_CONFIGURATION_TYPES to your own list of configurations
> (including limiting it to a single configuration) as long as you set it
> *before* the project command in your CMakeLists.txt file. This technique
> works with the Visual Studio and Xcode generators. See the following bug
> reports for reference.
>
>    http://www.cmake.org/Bug/view.php?id=6788
>    http://www.cmake.org/Bug/view.php?id=8914
>
> I'm not sure why you would recommend anything related to CMAKE_BUILD_TYPE
> for the Visual Studio generators. I would be curious to know exactly how
> you are using it, because internally, CMAKE_BUILD_TYPE (to the best of my
> knowledge) is completely ignored by the Visual Studio generators. Any
> positive things happening in your project because of your use of it must be
> because of the way you use it in your CMakeLists files... I'm thinking it's
> probably only used at CMake time, unless you're passing it as args to
> custom commands or something... in which case, you'll be passing the same
> CMake configure time CMAKE_BUILD_TYPE value regardless of what config your
> end user chooses to build in Visual Studio. Which would be confusing at
> best.
>
> VS and Xcode use a list of configurations, with the "active" configuration
> chosen at build time by the developer. Makefile and ninja systems use
> CMAKE_BUILD_TYPE -- VS and Xcode do not.
>
>
> Hmm I see; I guess I just pass it to
       build_command( BUILD_COMMAND CONFIGURATION ${CMAKE_BUILD_TYPE}
TARGET install )
and that results with
      c:\tools\unix\cmake\bin\cmake.exe --build . --config release --target
INSTALL -- /m:4 /v:m

probably other places I use it too

HTH,
> David C.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140630/9f3a1ae8/attachment.html>


More information about the CMake mailing list