[CMake] Proposal for new generator options

Philip Lowman philip at yhbt.com
Fri Jan 15 19:30:10 EST 2010


On Fri, Jan 15, 2010 at 3:20 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:
> Hi!
>
> This proposal addresses the following issue:
> currently there is no solution for creating Visual Studio project
> files for static runtime without editing the cmake files.
> As the goal of cmake is to define a project in an abstract way it should
> be possible to generate for static runtime only via the command line
> interface
> since someone who never uses Visual Studio will probably not account
> for this issue.
>
> A solution could look like this:
> split the -G option into three options, e.g.
> -G the generator
> -V the Version
> - T the Target platfrom
>
> some examples:
> old: -G "Visual Studio 8 2005 Win64"
> new:
> -G "Visual Studio" -V 8 -T Win64
> or equivalent
> -G "Visual Studio" -V 2005 -T Win64
>
> old: -G "Eclipse CDT4 - Unix Makefiles"
> new: -G "Eclipse CDT" -V4 -T "Unix Makefiles"
>
> in this new system the static runtime is a target:
> -G "Visual Studio" -V 8 -T "Win32 static"
>
> of course the old generator names can continue to exist
> for backward compatibility.

There are at least 3 ways to solve this problem without introducing
any changes to CMake.  See the CMake FAQ.
http://www.itk.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F

If there is enough demand to add a feature to do this without
requiring CMakeLists.txt modifications, at least do something simpler
such as adding a variable like CMAKE_MSVC_COMPILE_WITH_MT or something
like that.  This way all that needs to be modified is
Modules/Platform/Windows-cl.cmake to set the initial cache differently
and perhaps adding a checkbox to the GUI when selecting the initial
generator.

-- 
Philip Lowman


More information about the CMake mailing list