MantisBT - CMake
View Issue Details
0011819CMakeCMakepublic2011-02-08 10:262016-06-10 14:31
Ryan Pavlik 
Kitware Robot 
normalmajoralways
closedmoved 
Windows7
CMake 2.8.3 
 
0011819: VS 2010 fails when PROJECT_LABEL contains :
Always reproducible - build fails as follows:

1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>Build started 2/8/2011 9:22:53 AM.
1>PrepareForBuild:
1> Creating directory "C:\Users\rpavlik\Desktop\build\bug-vc10\Debug\".
1>InitializeBuildStatus:
1> Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>CustomBuild:
1> Checking Build System
1> CMake does not need to re-run because C:/Users/rpavlik/Desktop/build/bug-vc10/CMakeFiles/generate.stamp is up-to-date.
1>FinalizeBuildStatus:
1> Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
1> Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.43
2>------ Build started: Project: Core: Main App, Configuration: Debug Win32 ------
2>Build started 2/8/2011 9:22:54 AM.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(253,5): error MSB3491: Could not write lines to file "app.dir\Debug\Core: Main App.lastbuildstate". The given path's format is not supported.
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.04
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
3>Project not selected to build for this solution configuration
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
This self-contained CMakeLists.txt file (creating a dummy source file) should work fine on VS 2008 and other generators, but fails to build on VS 2010.

cmake_minimum_required(VERSION 2.6.2)
project(example)

file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" "int main() { return 0; }")
add_executable(app "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
set_property(TARGET
    app
    PROPERTY
    PROJECT_LABEL
    "Core: Main App")
No tags attached.
Issue History
2011-02-08 10:26Ryan PavlikNew Issue
2011-02-08 10:36David ColeAssigned To => David Cole
2011-02-08 10:36David ColeStatusnew => assigned
2011-02-08 10:46David ColeNote Added: 0025326
2011-02-08 10:46David ColeStatusassigned => resolved
2011-02-08 10:46David ColeFixed in Version => CMake 2.8.4
2011-02-08 10:46David ColeResolutionopen => no change required
2011-02-08 13:24Ryan PavlikNote Added: 0025336
2011-02-08 13:24Ryan PavlikStatusresolved => feedback
2011-02-08 13:24Ryan PavlikResolutionno change required => reopened
2011-10-26 00:04David ColeAssigned ToDavid Cole =>
2011-10-26 00:04David ColeStatusfeedback => backlog
2016-06-10 14:28Kitware RobotNote Added: 0041798
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotFixed in VersionCMake 2.8.4 =>
2016-06-10 14:28Kitware RobotResolutionreopened => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0025326)
David Cole   
2011-02-08 10:46   
The PROJECT_LABEL CMake target property maps directly to the "ProjectName" attribute of the generated VS 2010 project.

VS 2010 then uses ProjectName as a basis for some of its build output/logging files. Therefore.... anything in PROJECT_LABEL should be a character with which you can validly name a file, and ":" is not one of those characters.

I think this is simply something that you need to be aware of, and avoid using ":" (and the other not-legal-in-filenames characters) in the PROJECT_LABEL value.

"-" works in target and file names, so presumably you could simply replace your ":" with "-" as a workaround.
(0025336)
Ryan Pavlik   
2011-02-08 13:24   
Could a warning be issued when setting this property to such a value, or perhaps at generate time for msvc 2010, so that the issue is more easily traceable since it does work with other generators just fine?
(0041798)
Kitware Robot   
2016-06-10 14:28   
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.