View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015879CMakeCMakepublic2015-12-11 16:562016-05-02 08:30
ReporterJavier Martinez 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionunable to reproduce 
PlatformWindowsOSWindowsOS Version7
Product VersionCMake 3.4.1 
Target VersionFixed in Version 
Summary0015879: Wrong configuration name emitted by generator expression
DescriptionCMake has issues with the $<CONFIG> and $<CONFIG:name> generator expressions when one configuration name is a substring of another. The attached reproducer has Debug, Release and ReleaseInternal as the configuration names. In this case ReleaseInternal is used instead of Release.
Steps To Reproduce- Generate solution (I placed the CMakeLists/txt file in the /bin folder and used cmake.exe . to generate the solution)
- Open the generated solution Test.sln
- Open the properties for TestProject -> CMake Rules ->stamp.txt.rule
- Click on Configuration Properties -> Custom Build Tools -> General
- On Configuration select Release
- Inspect the Command Line property, it reads "Printing comment for ReleaseInternal" instead of "Printing comment for Release"
Additional InformationTested with CMake version cmake-3.4.1-win32-x86
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (387 bytes) 2015-12-11 16:56 [Show Content]
png file icon CMake_0015879_1.png [^] (135,783 bytes) 2015-12-15 14:13

 Relationships

  Notes
(0039978)
Brad King (manager)
2015-12-14 08:46

With CMake 3.4.1 and the VS 2015 generator I get the expected content in the .vcxproj file:

$ grep -B 1 'Printing comment' TestProject.vcxproj
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo Printing comment for Debug
--
      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo Printing comment for Release
--
      <Command Condition="'$(Configuration)|$(Platform)'=='ReleaseInternal|Win32'">setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo Printing comment for ReleaseInternal

I also see the proper output at build time:

 $ cmake --build . --config Release --target TestProject
 ...
 Printing comment for Release

 $ cmake --build . --config ReleaseInternal --target TestProject
 ...
 Printing comment for ReleaseInternal
(0039986)
Javier Martinez (reporter)
2015-12-15 14:14

I can confirm that the correct output is printed when I compile with the VS 2013 IDE. However, if the command is inspected in the IDE as the reproduction steps indicate the wrong command is displayed. Is this a CMake or a VS issue?
(0039993)
Brad King (manager)
2015-12-17 08:28

If the correct output is generated by the build, and the correct content appears in the .vcxproj file, then this is almost certainly a VS issue. CMake is generating the proper content into the file. If you do try to report this to MS, please first reproduce it in .vcxproj file created purely through VS and not with CMake. That will make it clearer.
(0040986)
Robert Maynard (manager)
2016-05-02 08:30

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

 Issue History
Date Modified Username Field Change
2015-12-11 16:56 Javier Martinez New Issue
2015-12-11 16:56 Javier Martinez File Added: CMakeLists.txt
2015-12-14 08:46 Brad King Note Added: 0039978
2015-12-15 08:47 Brad King Status new => resolved
2015-12-15 08:47 Brad King Resolution open => unable to reproduce
2015-12-15 14:13 Javier Martinez File Added: CMake_0015879_1.png
2015-12-15 14:14 Javier Martinez Note Added: 0039986
2015-12-17 08:28 Brad King Note Added: 0039993
2016-05-02 08:30 Robert Maynard Note Added: 0040986
2016-05-02 08:30 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team