summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-10-05 19:31:49 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-10-05 19:31:49 (GMT)
commitdacc47853d39fe55aadf9fc25a2e63b12ab0bbe9 (patch)
tree5056112d7c09e1ffc3491767cd61f7a1591a133f /CMakeLists.txt
parent51047564bfefc793677c2de2bfc53d018fc28096 (diff)
parentfd3249e11afeb38284ee8e2012134de4d410c92b (diff)
downloadCMake-dacc47853d39fe55aadf9fc25a2e63b12ab0bbe9.zip
CMake-dacc47853d39fe55aadf9fc25a2e63b12ab0bbe9.tar.gz
CMake-dacc47853d39fe55aadf9fc25a2e63b12ab0bbe9.tar.bz2
Merge topic 'vs-project-groups'
fd3249e New USE_FOLDERS property OFF by default. (#3796)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt32
1 files changed, 25 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e8b928..c8337f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -180,15 +180,33 @@ MACRO(CMAKE_SETUP_TESTING)
ENDMACRO(CMAKE_SETUP_TESTING)
+# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
+# organization feature. Default to ON for non-Express users. Express users must
+# explicitly turn off this option to build CMake in the Express IDE...
+#
+OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
+MARK_AS_ADVANCED(CMAKE_USE_FOLDERS)
+
+
+#-----------------------------------------------------------------------
+# a macro that only sets the FOLDER target property if it's
+# "appropriate"
+#-----------------------------------------------------------------------
MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
- # Really, I just want this to be an "if(TARGET ${tgt})" ...
- # but I'm not sure that our min req'd., CMake 2.4.5 can handle
- # that... so I'm just activating this for now, with a version
- # compare, and only for MSVC builds.
- IF(MSVC)
- IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
- SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
+ IF(CMAKE_USE_FOLDERS)
+ SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+
+ # Really, I just want this to be an "if(TARGET ${tgt})" ...
+ # but I'm not sure that our min req'd., CMake 2.4.5 can handle
+ # that... so I'm just activating this for now, with a version
+ # compare, and only for MSVC builds.
+ IF(MSVC)
+ IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
+ SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
+ ENDIF()
ENDIF()
+ ELSE()
+ SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF)
ENDIF()
ENDMACRO(CMAKE_SET_TARGET_FOLDER)