diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-08 09:31:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-08 09:31:45 +0300 |
commit | 741d5a6c065a528129a3d0ec7638a8b510282301 (patch) | |
tree | b437fe2c40980dae35040fc82909a1a9971b8a67 /build_files/cmake/macros.cmake | |
parent | a6525449099e9912073479a8ca1789ba5773799d (diff) |
fix for CMake file grouping with MSVC project files.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 42aa9d1f8b5..3392398fd44 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -14,17 +14,15 @@ MACRO(BLENDERLIB_NOLIST ADD_LIBRARY(${name} ${INC_ALL} ${sources}) # Group by location on disk - SOURCE_GROUP(Files FILES CMakeLists.txt) + SOURCE_GROUP("Source Files" FILES CMakeLists.txt) SET(ALL_FILES ${sources} ${INC_ALL}) FOREACH(SRC ${ALL_FILES}) - STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR} "Files" REL_DIR "${SRC}") - STRING(REGEX REPLACE "[\\\\/][^\\\\/]*$" "" REL_DIR "${REL_DIR}") - STRING(REGEX REPLACE "^[\\\\/]" "" REL_DIR "${REL_DIR}") - IF(REL_DIR) - SOURCE_GROUP(${REL_DIR} FILES ${SRC}) - ELSE(REL_DIR) - SOURCE_GROUP(Files FILES ${SRC}) - ENDIF(REL_DIR) + GET_FILENAME_COMPONENT(SRC_EXT ${SRC} EXT) + IF(${SRC_EXT} MATCHES ".h" OR ${SRC_EXT} MATCHES ".hpp") + SOURCE_GROUP("Header Files" FILES ${SRC}) + ELSE() + SOURCE_GROUP("Source Files" FILES ${SRC}) + ENDIF() ENDFOREACH(SRC) ENDMACRO(BLENDERLIB_NOLIST) |