Permalink
Browse files

Organized projects into folders, for IDEs that support it (e.g. Visua…

…l Studio)
  • Loading branch information...
1 parent b85bf69 commit ef78b6d0f3981bc9b184512d43c66ec6714a6b6a @LaurentGomila LaurentGomila committed Feb 25, 2013
Showing with 15 additions and 2 deletions.
  1. +5 −1 CMakeLists.txt
  2. +7 −1 cmake/Macros.cmake
  3. +3 −0 src/SFML/Main/CMakeLists.txt
View
@@ -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)
View
@@ -139,14 +139,17 @@ 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")
set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")
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")
@@ -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)

0 comments on commit ef78b6d

Please sign in to comment.