diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 07:18:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-05 07:18:53 +0300 |
commit | 36b8ebceb5020c0b697f4b3d23a3ac319ea5ab53 (patch) | |
tree | 0b92aaaedf94ca510cb0c92da39dc8b91d0ec1c2 /build_files/cmake/macros.cmake | |
parent | f0b01220e5f50da7eaab5a9f3a35e03ebfdbdaff (diff) |
added back include file globbing for cmake, thought this was needed for MSVC only but turns out QtCreator also needs this else it wont index headers.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index afd5f302314..42aa9d1f8b5 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1,45 +1,44 @@ -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) - - MACRO(BLENDERLIB_NOLIST - name - sources - includes) - - MESSAGE(STATUS "Configuring library ${name}") - INCLUDE_DIRECTORIES(${includes}) - ADD_LIBRARY(${name} ${sources}) - ENDMACRO(BLENDERLIB_NOLIST) -ENDIF(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) + +# # works fine but having the includes listed is helpful for IDE's (QtCreator/MSVC) +# MACRO(BLENDERLIB_NOLIST +# name +# sources +# includes) +# +# MESSAGE(STATUS "Configuring library ${name}") +# INCLUDE_DIRECTORIES(${includes}) +# ADD_LIBRARY(${name} ${sources}) +# ENDMACRO(BLENDERLIB_NOLIST) + MACRO(BLENDERLIB name |