Some cmake improvements for modules

This commit is contained in:
Yehonal 2017-03-25 12:34:22 +01:00
parent 603753dfff
commit 12fa25c322
3 changed files with 29 additions and 7 deletions

View file

@ -58,6 +58,19 @@ MACRO(CU_SET_CACHE name val)
set(${name} ${val} CACHE INTERNAL "CU Var") set(${name} ${val} CACHE INTERNAL "CU Var")
ENDMACRO() ENDMACRO()
#
# CU_LIST_ADD_CACHE
#
MACRO(CU_LIST_ADD_CACHE name val)
# avoid duplicates
if (";${${name}};" MATCHES ";${val};")
# nothing to do for now
else()
set(${name} ${val} ${${name}} CACHE INTERNAL "CU Var")
endif()
ENDMACRO()
# #
# CU_SET_PATH # CU_SET_PATH
@ -72,14 +85,19 @@ ENDMACRO()
# CU_ADD_INC_PATH # CU_ADD_INC_PATH
# #
MACRO(CU_ADD_INC_PATH val) MACRO(CU_ADD_INC_PATH val)
set(CU_INC_PATHS
${CU_INC_PATHS}
${val}
)
#update cache if (";${CU_INC_PATHS};" MATCHES ";${val};")
CU_SET_CACHE("CU_INC_PATHS" "${CU_INC_PATHS}") # nothing to do for now
include_directories(${val}) else()
set(CU_INC_PATHS
${CU_INC_PATHS}
${val}
)
#update cache
CU_SET_CACHE("CU_INC_PATHS" "${CU_INC_PATHS}")
include_directories(${val})
endif()
ENDMACRO() ENDMACRO()

View file

@ -10,6 +10,8 @@
# Enable precompiled headers when using the GCC compiler. # Enable precompiled headers when using the GCC compiler.
CU_RUN_HOOK(BEFORE_SCRIPTS_LIBRARY)
CU_SET_PATH("AC_SCRIPTS_DIR" "${CMAKE_CURRENT_LIST_DIR}") CU_SET_PATH("AC_SCRIPTS_DIR" "${CMAKE_CURRENT_LIST_DIR}")
if (USE_SCRIPTPCH) if (USE_SCRIPTPCH)
@ -74,6 +76,7 @@ message(STATUS "SCRIPT PREPARATION COMPLETE")
message("") message("")
include_directories( include_directories(
${scripts_INCLUDE_DIRS}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/modules/worldengine/deps/recastnavigation/Detour ${CMAKE_SOURCE_DIR}/modules/worldengine/deps/recastnavigation/Detour
${CMAKE_SOURCE_DIR}/modules/worldengine/deps/recastnavigation/Recast ${CMAKE_SOURCE_DIR}/modules/worldengine/deps/recastnavigation/Recast

View file

@ -65,6 +65,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/modules/worldengine/nucleus/src/Threading ${CMAKE_SOURCE_DIR}/modules/worldengine/nucleus/src/Threading
${CMAKE_SOURCE_DIR}/modules/worldengine/nucleus/src/Utilities ${CMAKE_SOURCE_DIR}/modules/worldengine/nucleus/src/Utilities
${CMAKE_SOURCE_DIR}/modules/acore/game-framework/src/Addons ${CMAKE_SOURCE_DIR}/modules/acore/game-framework/src/Addons
${game_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/game ${CMAKE_SOURCE_DIR}/src/game
${CMAKE_SOURCE_DIR}/src/game/Accounts ${CMAKE_SOURCE_DIR}/src/game/Accounts
${CMAKE_SOURCE_DIR}/src/game/Achievements ${CMAKE_SOURCE_DIR}/src/game/Achievements