fix for CMake file grouping with MSVC project files.
This commit is contained in:
parent
a652544909
commit
741d5a6c06
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue