[cmake-developers] [CMake 0012570]: VS10 property pages for single source file gone

Mantis Bug Tracker mantis at public.kitware.com
Thu Nov 10 11:21:35 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12570 
====================================================================== 
Reported By:                Niels Dekker
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12570
Category:                   CMake
Reproducibility:            have not tried
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-11-10 18:21 WAST
Last Modified:              2011-11-10 18:21 WAST
====================================================================== 
Summary:                    VS10 property pages for single source file gone
Description: 
I described this issue at "[CMake] Visual Studio 10 property pages for single
source file gone with CMake 2.8.5 and 2.8.6",
http://www.cmake.org/pipermail/cmake/2011-November/047345.html (below here). The
issue was confirmed by Domagoj Saric and J Decker.

----- Original Message ----- 
From: "Niels Dekker - address until 2014" 
To: <cmake at cmake.org>
Sent: Thursday, November 10, 2011 16:14
Subject: [CMake] Visual Studio 10 property pages for single source file gone
with CMake 2.8.5 and 2.8.6
---------------------------------------------------------------------------
When Visual Studio 10 vcxproj files are generated by CMake 2.8.5 or 2.8.6, 
it is typically impossible to view the C/C++ properties of a single source 
file. CMake 2.8.0 to 2.8.4 do not seem to have this issue. It looks like the 
issue is caused by the fact that CMake 2.8.5 started storing the absolute 
path names of the source files (even when CMAKE_USE_RELATIVE_PATHS is ON).

Is that a known issue?

Visual Studio 10 does not allow viewing the C/C++ properties of source files 
that are listed by their absolute path names. See VS10 bug report 635294, 
"Using absolute path in ClCompile item prevents property pages from 
showing", by Niels M Hansen, 1/9/2011: 
https://connect.microsoft.com/VisualStudio/feedback/details/635294/using-absolute-path-in-clcompile-item-prevents-property-pages-from-showing

However, it seems like Visual Studio 10 *does* correctly support absolute 
path names *without* drive letter! Would it be possible for CMake to write 
the source file names *without* the drive letter, when it generates Visual 
Studio 10 vcxproj files? (Especially when the generated vcxproj files are 
located at the same drive as the source files.)
---------------------------------------------------------------------------


Steps to Reproduce: 
Create a file named "source.cpp" and a very simple CMakeLists.txt:

  project(foo)
  cmake_minimum_required(VERSION 2.8)
  add_executable(foo source.cpp)

Suppose both files are located at the directory "D:\dir". Generate a Visual
Studio 10 project, using CMake 2.8.5 or 2.8.6. The generated project file,
"foo.vcxproj", will have a line saying:

  <ClCompile Include="D:\dir\source.cpp" />

Open the generated solution file, "foo.sln", using Visual Studio 10. Right-click
"source.cpp" within the Solution Explorer of Visual Studio, select Properties,
and try to view the C/C++ Property Pages. Unfortunately, nothing is displayed!



Additional Information: 
Visual Studio appears to work fine when the drive letter ('D:') is removed from
the source file name ("D:\dir\source.cpp"), in both foo.vcxproj and
foo.vcxproj.filters. In general, I think removing the drive letter from the
source file paths is fine, as long as the build directory and the source file
paths have the same drive letter.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-11-10 18:21 Niels Dekker   New Issue                                    
======================================================================




More information about the cmake-developers mailing list