View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013571CMakeCMakepublic2012-10-04 11:492013-04-17 08:54
Reporterrlandert 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSWindowsOS Version
Product VersionCMake 2.8.9 
Target VersionCMake 2.8.11Fixed in VersionCMake 2.8.11 
Summary0013571: Empty FOLDERs in Visual Studio Solutions shown from external targets
DescriptionIn the Visual Studio Solutions of targets which are defined in subfolders, all Visual Studio FOLDERS (target property) from previously defined targets are shown, even if these targets are not contained in the solution.

Example (see attachment):

In the toplevel directory there is a project definition for project test, which includes the two subdirectories test1 and test2 via:
 * add_subdirectory(test1)
 * add_subdirectory(test2)

Inside these folders the projects test1 and test2 are defined, which generate the executables test1.exe and test2.exe.

For these targets the Visual Studio Folders are defined in the according CMakeLists.txt files via:
 * set_property(TARGET test1 PROPERTY FOLDER "test1Dir")
 * set_property(TARGET test2 PROPERTY FOLDER "test2Dir")

In the global solution file test.sln both targets are shown in the correct folders:
 * test1Dir/test1
 * test2Dir/test2

In the solution files for the subprojects, the (empty) folder for the other target is shown although it is not part of the solution. E.g. in solution test1.sln the empty folder test2Dir is shown.

Tested with CMake 2.8.9 and Visual Studio 2008.
Steps To Reproduce1. Unpack attached file
2. Generate Visual Studio Solutions with CMake
3. Open test.sln -> targets test1 and test2 are correctly shown in subfolder test1Dir and test2Dir
4. Open test1/test1.sln -> empty folder test2Dir is shown
5. Open test2/test2.sln -> empty folder test1Dir is shown
Additional InformationThe reason seems to be that the variable VisualStudioFolders in the file cmGlobalVisualStudio7Generator.cxx is not cleared between the generation of the different Solution files.

My solution was to call VisualStudioFolders.clear() at the beginning of the method cmGlobalVisualStudio7Generator::WriteTargetsToSolution, although i'm not sure whether this is the correct place for this. The patch can be found in the attached file.
TagsNo tags attached.
Attached Fileszip file icon CMake_FolderIssue.zip [^] (1,822 bytes) 2012-10-04 11:49

 Relationships

  Notes
(0031307)
David Cole (manager)
2012-10-24 15:04
edited on: 2012-10-24 15:16

I've pushed a fix for this issue to the CMake stage repo in the topic branch "fix-13571-avoid-empty-sln-folders"

As soon as 2.8.10 is final, I'll merge it to 'next' for dashboard testing, and then after that, it will get merged to 'master' and be available as soon as we start building the 2.8.11 release.

Thanks for the bug report! (And the patch!)

(0031379)
David Cole (manager)
2012-11-01 17:57

Fix pushed to 'next':

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d7de641 [^]

You can use a nightly build of CMake if you need the fix before the 2.8.11 release.
(0032870)
Robert Maynard (manager)
2013-04-17 08:54

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

 Issue History
Date Modified Username Field Change
2012-10-04 11:49 rlandert New Issue
2012-10-04 11:49 rlandert File Added: CMake_FolderIssue.zip
2012-10-24 15:02 David Cole Assigned To => David Cole
2012-10-24 15:02 David Cole Status new => assigned
2012-10-24 15:03 David Cole Target Version => CMake 2.8.11
2012-10-24 15:04 David Cole Note Added: 0031307
2012-10-24 15:16 David Cole Note Edited: 0031307
2012-11-01 17:57 David Cole Note Added: 0031379
2012-11-01 17:57 David Cole Status assigned => resolved
2012-11-01 17:57 David Cole Fixed in Version => CMake 2.8.11
2012-11-01 17:57 David Cole Resolution open => fixed
2013-04-17 08:54 Robert Maynard Note Added: 0032870
2013-04-17 08:54 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team