[CMake] Proposal for new generator options

Jochen Wilhelmy j.wilhelmy at arcor.de
Sat Jan 16 11:07:55 EST 2010


Hi!

the first solution (Manual Replace) in
http://www.itk.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F

does not seem to work since in the gui of cmake (2.6 for windows) I 
don't see
any CMAKE_C_FLAGS_DEBUG etc. to modify.
the project (svn repository) is
http://llvm.org/svn/llvm-project/llvm/trunk

also a variable like CMAKE_MSVC_COMPILE_WITH_MT
is not a good solution since it would require the user to read the
manual of cmake. only a solution that is obvious when typing
cmake -h makes sense.

to understand why imagine a windows dummy using only visual studio
who wants to compile in open source projects (e.g. llvm). if he is
lucky the project uses cmake and then he only needs to download
it, type cmake -h and know what to do.

-Jochen


Philip Lowman schrieb:
> 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.
>
>   



More information about the CMake mailing list