diff options
author | Naios <naios-dev@live.de> | 2015-03-29 16:13:22 +0200 |
---|---|---|
committer | Naios <naios-dev@live.de> | 2015-03-29 16:13:22 +0200 |
commit | ed4722b6e6314e9dce920fe90138dc714c734251 (patch) | |
tree | 86be10038d4b7f565dd316835f34e2be574e4f6a /cmake/showoptions.cmake | |
parent | 83bbe00785a7ee7c8141d83bfe94a1415466c64d (diff) |
CMake: Use source_groups to represent the source tree
* It let ide's (like vs) display the source tree.
* Disabled by default.
* Soft requirement is cmake >= 2.8.12 .
* Offers 2 modes: flat & hierarchical.
* For detailed description see #14471
* Thanks @click for help and advises.
* Closes #14471
(cherry picked from commit c386711972260aa7b877cdc8cb49d24576ce1902)
Conflicts:
src/server/authserver/CMakeLists.txt
Diffstat (limited to 'cmake/showoptions.cmake')
-rw-r--r-- | cmake/showoptions.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 44d161cab8d..87a372260a0 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -62,6 +62,29 @@ else() message("* Use coreside debug : No (default)") endif() +if( WITH_SOURCE_TREE STREQUAL "flat" OR WITH_SOURCE_TREE STREQUAL "hierarchical" ) + # TODO: Remove this after Debian 8 is released and set general required version to 2.8.12 + # Debian 7 is shipped with CMake 2.8.9 . But DIRECTORY flag of get_filename_component requires 2.8.12 . + if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) + message("* Show source tree : Yes - ${WITH_SOURCE_TREE}") + set(_WITH_SOURCE_TREE ${WITH_SOURCE_TREE} CACHE INTERNAL "WITH_SOURCE_TREE support enabled.") + else() + message("* Show source tree : No (default)") + + message("") + message(" *** WITH_SOURCE_TREE - WARNING!") + message(" *** This functionality is ONLY supported on CMake 2.8.12 or higher.") + message(" *** You are running ${CMAKE_VERSION}, which does not have the functions needed") + message(" *** to create a sourcetree - this option is thus forced to disabled!") + message("") + + set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.") + endif() +else() + message("* Show source tree : No (default)") + set(_WITH_SOURCE_TREE "" CACHE INTERNAL "WITH_SOURCE_TREE support disabled.") +endif() + if ( WITHOUT_GIT ) message("* Use GIT revision hash : No") message("") |