From ef78b6d0f3981bc9b184512d43c66ec6714a6b6a Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Mon, 25 Feb 2013 19:17:46 +0100 Subject: [PATCH] Organized projects into folders, for IDEs that support it (e.g. Visual Studio) --- CMakeLists.txt | 6 +++++- cmake/Macros.cmake | 8 +++++++- src/SFML/Main/CMakeLists.txt | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ee21828..959a4037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ endif() # disable the rpath stuff set(CMAKE_SKIP_BUILD_RPATH TRUE) -# Setup Mac OS X stuff +# setup Mac OS X stuff if(MACOSX) # SFML_BUILD_FRAMEWORKS needs two things : # first, it's available only for release @@ -123,6 +123,10 @@ if(LINUX) endif() endif() +# enable project folders +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") + # add the subdirectories add_subdirectory(src/SFML) if(SFML_BUILD_EXAMPLES) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 224407b0..06ae101f 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -139,6 +139,9 @@ macro(sfml_add_library target) set_target_properties(${target} PROPERTIES SOVERSION ${VERSION_MAJOR}) set_target_properties(${target} PROPERTIES VERSION ${VERSION_MAJOR}.${VERSION_MINOR}) + # set the target's folder (for IDEs that support it, e.g. Visual Studio) + set_target_properties(${target} PROPERTIES FOLDER "SFML") + # for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled if(WINDOWS AND COMPILER_GCC AND SFML_USE_STATIC_STD_LIBS) if(NOT GCC_VERSION VERSION_LESS "4") @@ -146,7 +149,7 @@ macro(sfml_add_library target) endif() endif() - # If using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default + # if using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default # (exported ones are explicitely marked) if(NOT WINDOWS AND ((COMPILER_GCC AND NOT GCC_VERSION VERSION_LESS "4") OR (COMPILER_CLANG AND NOT CLANG_VERSION VERSION_LESS "3"))) set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden) @@ -219,6 +222,9 @@ macro(sfml_add_example target) # set the debug suffix set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + # set the target's folder (for IDEs that support it, e.g. Visual Studio) + set_target_properties(${target} PROPERTIES FOLDER "Examples") + # for gcc >= 4.0 on Windows, apply the SFML_USE_STATIC_STD_LIBS option if it is enabled if(WINDOWS AND COMPILER_GCC AND SFML_USE_STATIC_STD_LIBS) if(NOT GCC_VERSION VERSION_LESS "4") diff --git a/src/SFML/Main/CMakeLists.txt b/src/SFML/Main/CMakeLists.txt index 55c0d161..2a3575e9 100644 --- a/src/SFML/Main/CMakeLists.txt +++ b/src/SFML/Main/CMakeLists.txt @@ -14,5 +14,8 @@ set_target_properties(sfml-main PROPERTIES DEBUG_POSTFIX -d) # insert the major version number in the output filename set_target_properties(sfml-main PROPERTIES OUTPUT_NAME "sfml-main") +# set the target's folder (for IDEs that support it, e.g. Visual Studio) +set_target_properties(sfml-main PROPERTIES FOLDER "SFML") + # setup the install rule install(TARGETS sfml-main ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT devel)