diff options
author | Naios <naios-dev@live.de> | 2016-03-16 17:44:35 +0100 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2016-03-18 14:28:01 +0100 |
commit | bf773ccc417b47d01502c8151cea6188e33e16aa (patch) | |
tree | d4c96b408e9f731ae66c313f3a9f81b6b6568aba /cmake/macros/GroupSources.cmake | |
parent | 03d249f0631c3561070ebbdd7301115507c68876 (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.
Diffstat (limited to 'cmake/macros/GroupSources.cmake')
-rw-r--r-- | cmake/macros/GroupSources.cmake | 9 |
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() |