aboutsummaryrefslogtreecommitdiff
path: root/cmake/macros/GroupSources.cmake
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-03-16 17:44:35 +0100
committerNaios <naios-dev@live.de>2016-03-19 23:19:56 +0100
commit90274d0337e5bf62d7e0ab4d08f04419d6f81446 (patch)
tree6bc71943b9f2886a7209878de0cdf71c2554ff1d /cmake/macros/GroupSources.cmake
parenta5c2c0c037b7f5fdef49aa37052c9f58e39488db (diff)
CMake: Remove the workaround for source groups below CMake 2.8.12
* Set the default option to hierarchical * Add a new "hierarchical-folders" option which enables folders inside IDE's. (cherry picked from commit bf773ccc417b47d01502c8151cea6188e33e16aa)
Diffstat (limited to 'cmake/macros/GroupSources.cmake')
-rw-r--r--cmake/macros/GroupSources.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/macros/GroupSources.cmake b/cmake/macros/GroupSources.cmake
index 198d8c3e187..f8e252fe41a 100644
--- a/cmake/macros/GroupSources.cmake
+++ b/cmake/macros/GroupSources.cmake
@@ -10,7 +10,7 @@
macro(GroupSources dir)
# Skip this if WITH_SOURCE_TREE is not set (empty string).
- if (NOT ${_WITH_SOURCE_TREE} STREQUAL "")
+ if (NOT ${WITH_SOURCE_TREE} STREQUAL "")
# Include all header and c files
file(GLOB_RECURSE elements RELATIVE ${dir} *.h *.hpp *.c *.cpp *.cc)
@@ -21,7 +21,7 @@ macro(GroupSources dir)
if (NOT ${element_dir} STREQUAL "")
# If the file is in a subdirectory use it as source group.
- if (${_WITH_SOURCE_TREE} STREQUAL "flat")
+ if (${WITH_SOURCE_TREE} STREQUAL "flat")
# Build flat structure by using only the first subdirectory.
string(FIND ${element_dir} "/" delemiter_pos)
if (NOT ${delemiter_pos} EQUAL -1)
@@ -44,3 +44,8 @@ macro(GroupSources dir)
endforeach()
endif()
endmacro()
+
+if (WITH_SOURCE_TREE STREQUAL "hierarchical-folders")
+ # Use folders
+ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+endif()