MantisBT - CMake
View Issue Details
0015262CMakeCMakepublic2014-11-24 09:382016-06-10 14:31
Daniel Franke 
Kitware Robot 
normalminoralways
closedmoved 
Windows
CMake 2.8.12.2 
 
0015262: Visual Studio Generators: selection of runtime
On Windows with Intel Fortran and QuickWin libraries: we tried to use cmake-2.8.12 to generate a VS10 project to build applications with Intel Fortran and the quickwin libraries. In order for this to work, the runtime has to be specified as "QuickWin", not the default "MultiThreadedDLL". Right now this is only possible once the project is generated, by opening VS10, manually changing the runtime, saving, then building. Obviously a big roadblock for automated builds.

Browsing the cmake sources, there does not seem to be any support for changing this key parameter (see cmVisualStudioGeneratorOptions::ParseFinish in cmVisualStudioGeneratorOptions.cxx)? If this is the case, appropriate options to change the defaults by setting variables would be highly desirable.

To note: google found a similar report on the cmake mailing-list, but that seemed to have gone nowhere [1].

[1] http://www.cmake.org/pipermail/cmake/2011-December/048030.html [^]
No tags attached.
Issue History
2014-11-24 09:38Daniel FrankeNew Issue
2014-11-25 09:37Brad KingNote Added: 0037276
2014-11-26 06:00Daniel FrankeNote Added: 0037289
2014-11-26 10:47Brad KingNote Added: 0037297
2016-06-10 14:29Kitware RobotNote Added: 0042673
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0037276)
Brad King   
2014-11-25 09:37   
The selection of the runtime library field comes from mapping the corresponding flags. The CMAKE_<LANG>_FLAGS_<CONFIG> cache entry initializers are chosen here:

http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Platform/Windows-MSVC.cmake;hb=v3.0.2#l256 [^]

with -MD. That can be changed by the user in the cache to something else.

However, there is no mapping for the Intel-specific "QuickWin" value right now. The cmVisualStudioGeneratorOptions::ParseFinish method just translates between MSVC and Intel values.

What compiler flag does Intel use to specify this runtime library?
(0037289)
Daniel Franke   
2014-11-26 06:00   
An excerpt of a complete configuration as generated by VS10:
-- 8< --
<Tool Name="VFFortranCompilerTool" AdditionalOptions=" /W1 -Wall
-Wextra -Wno-unused-parameter -Wno-conversion"
SuppressStartupBanner="true" Preprocess="preprocessYes"
AdditionalIncludeDirectories="[snip]" PreprocessorDefinitions="CMAKE_INTDIR=\"Debug\"" ModulePath="..\..\finclude\$(ConfigurationName)" AssemblerListingLocation="Debug/" RuntimeLibrary="rtQuickWin" ExceptionHandling="0"/>
-- 8< --

Quickwin applications require: "/libs:qwin /subsystem:windows"; these flags seem to be implied by the 'RuntimeLibrary="rtQuickWin"' selection.

Please note that other graphics libraries may require yet different runtime settings. For example Winteracter (http://www.winteracter.com/ [^]) would need RuntimeLibrary="rtStandardGraphics".
(0037297)
Brad King   
2014-11-26 10:47   
Ah, now I remember that the Intel Fortran compiler has a few different flags that together select the RuntimeLibrary setting. The special logic for that is in both cmVisualStudioGeneratorOptions::StoreUnknownFlag and cmVisualStudioGeneratorOptions::ParseFinish. Please look at updating them to set and use a new FortranRuntimeQuickWin boolean member of the class.
(0042673)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.