View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015577CMakeCMakepublic2015-05-20 11:382015-11-02 09:15
ReporterCedric Guerin 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 3.2.2 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015577: The 'project' command overwrites CMAKE_CONFIGURATION_TYPES.
DescriptionIf you have cmake files in a hierarchy of directories like in the sample provided, and use additional project commands in subdirectories (in my case in order to generate additional Visual Studio Solutions with only a subset of all the libraries generated), the project command will change the value of CMAKE_CONFIGURATION_TYPES to what appears to be a merge of the initial value outside any project declaration and it's current value, and this value will even be stored in the cache, affecting completely unrelated directory subhierarchies.
Steps To ReproduceSimply run cmake on the provided sample.
Additional InformationThe output of the provided sample in a fresh build directory is:

CMAKE_CONFIGURATION_TYPES at start is :
CMAKE_CONFIGURATION_TYPES before global project is : Debug;Release;Default
CMAKE_CONFIGURATION_TYPES after global project is : Debug;Release;Extra
CMAKE_CONFIGURATION_TYPES before libraries project is : Debug;Release;Extra
CMAKE_CONFIGURATION_TYPES after libraries project is : Debug;Release;Default;Extra
CMAKE_CONFIGURATION_TYPES for runtimes is : Debug;Release;Default;Extra

While the expected output whould be for CMAKE_CONFIGURATION_TYPES to remain at Debug;Release;Extra once set.

Note that you can remove the assigment to CMAKE_CONFIGURATION_TYPES outside any project, it's only there to help identify what occurs. Without it, cmake considers that the value outside of any project is the one stored in CMakeCache.txt (or the 4 default configurations if there is no CMakeCache.txt), but the overall behavior is the same.
TagsNo tags attached.
Attached Fileszip file icon Project.zip [^] (1,953 bytes) 2015-05-20 11:38

 Relationships

  Notes
(0038789)
Brad King (manager)
2015-05-21 09:18

This refactoring should fix it:

 VS: Do not accumulate configurations globally
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f4bb4e9 [^]
(0039820)
Robert Maynard (manager)
2015-11-02 09:15

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-05-20 11:38 Cedric Guerin New Issue
2015-05-20 11:38 Cedric Guerin File Added: Project.zip
2015-05-21 09:18 Brad King Note Added: 0038789
2015-05-21 09:18 Brad King Assigned To => Brad King
2015-05-21 09:18 Brad King Status new => resolved
2015-05-21 09:18 Brad King Resolution open => fixed
2015-05-21 09:18 Brad King Fixed in Version => CMake 3.3
2015-05-21 09:18 Brad King Target Version => CMake 3.3
2015-11-02 09:15 Robert Maynard Note Added: 0039820
2015-11-02 09:15 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team