MantisBT - CMake
View Issue Details
0011436CMakeCMakepublic2010-11-10 08:542011-03-10 14:41
David Cole 
David Cole 
normalmajoralways
closedfixed 
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011436: Solution folder property does not work with include_external_msproject in cmake 2.8.3
Thanks to Jens Auer's report to the CMake mailing list:
http://www.cmake.org/pipermail/cmake/2010-November/thread.html#40588 [^]

I just downloaded the new cmake 2.8.3 release and found a bug. We
include several external VC++ projects in our solution and group them
into folders using the old SOLUTION_FOLDER patch. When I checked the new
property FOLDER in cmake 2.8.3, it turns out that it works for all
projects except those included by include_external_msproject. When you
modify the following example to point to an existing .vcproj-file and
open the generated solution in visual studio 2005, only the custom
target will be found in folder1/folder2:

set_property(GLOBAL PROPERTY USE_FOLDERS On)
cmake_minimum_required(VERSION 2.8.3)
project(project)
include_external_msproject(externalProject
<PATH_TO_SOME_EXTERNAL_VCPROJ_FILE>)
set_target_properties(externalProject PROPERTIES FOLDER folder1/folder2)
add_custom_target(infolder)
set_target_properties(infolder PROPERTIES FOLDER folder1/folder2)

I also had to put the set_property in the first line of the file to
activate solution folders support, setting it after the
cmake_minimum_required did not turn the support on. I don't know if this
is intended or not.
No tags attached.
related to 0003796closed David Cole Add Project Group command 
Issue History
2010-11-10 08:54David ColeNew Issue
2010-11-10 08:54David ColeStatusnew => assigned
2010-11-10 08:54David ColeAssigned To => David Cole
2010-11-10 09:02David ColeRelationship addedrelated to 0003796
2010-11-10 09:20David ColeNote Added: 0023131
2010-11-10 09:21David ColeNote Added: 0023132
2010-11-10 09:21David ColeStatusassigned => resolved
2010-11-10 09:21David ColeFixed in Version => CMake 2.8.4
2010-11-10 09:21David ColeResolutionopen => fixed
2011-03-10 14:41David ColeNote Added: 0025735
2011-03-10 14:41David ColeStatusresolved => closed

Notes
(0023131)
David Cole   
2010-11-10 09:20   
Should be fixed by this commit, just merged to 'next' :
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3cf739e2c784fbd6c8a93c1ac91bd4bcea5acbf [^]

Please confirm, if you can build from CMake 'next'...

Thanks!


By the way: the location of the line:
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

...should not matter... As you can see from the diff of the commit, in the test, I added that as the last line. The value of the property is used at "Generate" time to decide whether to include the folder information in the generated solution/project files or not. So as long as its value is set *somewhere* in the CMakeLists.txt file, it should work. I suspect you were thinking it wasn't working because of the bug itself, and then moved it to the top at the same time you added an empty custom target to see if it was an include_external_msproject bug...
(0023132)
David Cole   
2010-11-10 09:21   
see previous note for commit
(0025735)
David Cole   
2011-03-10 14:41   
Closing resolved issues that have not been updated in more than 3 months.