IF(NOT DEFINED GLOBAL_AND_LOCAL_EXTERN_ACGL) SET(GLOBAL_AND_LOCAL_EXTERN_ACGL TRUE) # Define global and local acgl dependency locations IF(NOT DEFINED ACGL_LOCAL_EXTERN_DIR) SET(ACGL_LOCAL_EXTERN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern") ENDIF() IF(USE_LOCAL_ACGL) FIND_PATH(LOCAL_EXTERN_ACGL_DIR NAMES acgl PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_ACGL_DIR) SET(BUILD_ACGL TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_ACGL_DIR CACHE) ENDIF() IF(USE_LOCAL_ANGELSCRIPT) FIND_PATH(LOCAL_EXTERN_ANGELSCRIPT_DIR NAMES angelscript PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_ANGELSCRIPT_DIR) SET(BUILD_ANGELSCRIPT TRUE) ELSE() SET(NEED_ANGELSCRIPT_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_ANGELSCRIPT_DIR CACHE) ENDIF() IF(USE_LOCAL_BOX2D) FIND_PATH(LOCAL_EXTERN_BOX2D_DIR NAMES box2d PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_BOX2D_DIR) SET(BUILD_BOX2D TRUE) ELSE() SET(NEED_BOX2D_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_BOX2D_DIR CACHE) ENDIF() IF(USE_LOCAL_BULLET) FIND_PATH(LOCAL_EXTERN_BULLET_DIR NAMES bullet PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_BULLET_DIR) SET(BUILD_BULLET TRUE) ELSE() SET(NEED_BULLET_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_BULLET_DIR CACHE) ENDIF() IF(USE_LOCAL_FREETYPE) FIND_PATH(LOCAL_EXTERN_FREETYPE_DIR NAMES freetype PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_FREETYPE_DIR) SET(BUILD_FREETYPE TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_FREETYPE_DIR CACHE) ENDIF() IF(USE_LOCAL_GLEW) FIND_PATH(LOCAL_EXTERN_GLEW_DIR NAMES glew PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_GLEW_DIR) SET(BUILD_GLEW TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_GLEW_DIR CACHE) ENDIF() IF(USE_LOCAL_GLM) FIND_PATH(LOCAL_EXTERN_GLM_DIR NAMES glm PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_GLM_DIR) SET(BUILD_GLM TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_GLM_DIR CACHE) ENDIF() IF(USE_LOCAL_GOOGLETEST) FIND_PATH(LOCAL_EXTERN_GOOGLETEST_DIR NAMES googletest PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_GOOGLETEST_DIR) SET(BUILD_GOOGLETEST TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_GOOGLETEST_DIR CACHE) ENDIF() IF(USE_LOCAL_LUA) FIND_PATH(LOCAL_EXTERN_LUA_DIR NAMES lua PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_LUA_DIR) SET(BUILD_LUA TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_LUA_DIR CACHE) ENDIF() IF(USE_LOCAL_OGG) FIND_PATH(LOCAL_EXTERN_OGG_DIR NAMES ogg PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_OGG_DIR) SET(BUILD_OGG TRUE) ELSE() SET(NEED_OGG_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_OGG_DIR CACHE) ENDIF() IF(USE_LOCAL_OPENAL) FIND_PATH(LOCAL_EXTERN_OPENAL_DIR NAMES openal PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_OPENAL_DIR) SET(BUILD_OPENAL TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_OPENAL_DIR CACHE) ENDIF() IF(USE_LOCAL_SLB) FIND_PATH(LOCAL_EXTERN_SLB_DIR NAMES slb PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_SLB_DIR) SET(BUILD_SLB TRUE) ELSE() SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_SLB_DIR CACHE) ENDIF() IF(USE_LOCAL_VORBIS) FIND_PATH(LOCAL_EXTERN_VORBIS_DIR NAMES vorbis PATHS "${ACGL_LOCAL_EXTERN_DIR}" NO_DEFAULT_PATH) IF(LOCAL_EXTERN_VORBIS_DIR) SET(BUILD_VORBIS TRUE) ELSE() SET(NEED_VORBIS_GLOBAL_EXTERN_DIR TRUE) ENDIF() UNSET(LOCAL_EXTERN_VORBIS_DIR CACHE) ENDIF() IF(NEED_ACGL_GLOBAL_EXTERN_DIR) FIND_PATH(ACGL_GLOBAL_EXTERN_DIR NAMES acgl PATHS "${CMAKE_CURRENT_SOURCE_DIR}/../.." "${CMAKE_CURRENT_SOURCE_DIR}/../../SDK" NO_DEFAULT_PATH) ELSE() UNSET(ACGL_GLOBAL_EXTERN_DIR CACHE) UNSET(ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME CACHE) ENDIF() IF(ACGL_GLOBAL_EXTERN_DIR AND NOT DEFINED ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME) SET(ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME TRUE CACHE INTERNAL "") ELSEIF(ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME) SET(ACGL_GLOBAL_EXTERN_DIR_FOUND_FIRST_TIME FALSE CACHE INTERNAL "") ENDIF() IF(BUILD_ACGL) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/acgl") ENDIF() IF(BUILD_ANGELSCRIPT) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/angelscript") ENDIF() IF(BUILD_BOX2D) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/box2d") ENDIF() IF(BUILD_FREETYPE) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/freetype") ENDIF() IF(BUILD_BULLET) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/bullet") ENDIF() IF(BUILD_GLEW) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/glew") ENDIF() IF(BUILD_GLM) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/glm") ENDIF() IF(BUILD_GOOGLETEST) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/googletest") ENDIF() IF(BUILD_LUA) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/lua") ENDIF() IF(BUILD_OGG) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/ogg") ENDIF() IF(BUILD_OPENAL) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/openal") ENDIF() IF(BUILD_SLB) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/slb") ENDIF() IF(BUILD_VORBIS) ADD_SUBDIRECTORY("${ACGL_LOCAL_EXTERN_DIR}/vorbis") ENDIF() ENDIF()