diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-23 08:18:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-23 08:18:53 +0400 |
commit | f4415ce84a71964d90c53dfe8f219444e78e80aa (patch) | |
tree | 5860cbb795934c962e59f118be3b6cc597750448 /build_files/cmake/macros.cmake | |
parent | c6976e7351e448b8ab82757b9e1a665162b0960c (diff) |
- CMake now only uses SOURCE_GROUP with MSVC lib configuration, saves recursive header search when not using msvc.
- uv layout export wasn't setting the default filename.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 08a571cceaf..9237f01a950 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1,30 +1,45 @@ -MACRO(BLENDERLIB_NOLIST - name - sources - includes) - # Gather all headers - FILE(GLOB_RECURSE INC_ALL *.h) - - INCLUDE_DIRECTORIES(${includes}) - ADD_LIBRARY(${name} ${INC_ALL} ${sources}) +IF(MSVC) + # only MSVC uses SOURCE_GROUP + MACRO(BLENDERLIB_NOLIST + name + sources + includes) + + MESSAGE(STATUS "Configuring library ${name}") + + # Gather all headers + FILE(GLOB_RECURSE INC_ALL *.h) + + INCLUDE_DIRECTORIES(${includes}) + ADD_LIBRARY(${name} ${INC_ALL} ${sources}) + + # Group by location on disk + SOURCE_GROUP(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) + ENDFOREACH(SRC) + ENDMACRO(BLENDERLIB_NOLIST) +ELSE(MSVC) - # Group by location on disk - SOURCE_GROUP(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) - ENDFOREACH(SRC) + MACRO(BLENDERLIB_NOLIST + name + sources + includes) - MESSAGE(STATUS "Configuring library ${name}") -ENDMACRO(BLENDERLIB_NOLIST) + MESSAGE(STATUS "Configuring library ${name}") + INCLUDE_DIRECTORIES(${includes}) + ADD_LIBRARY(${name} ${sources}) + ENDMACRO(BLENDERLIB_NOLIST) +ENDIF(MSVC) MACRO(BLENDERLIB name |