diff options
author | est31 <MTest31@outlook.com> | 2015-07-11 02:24:00 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-07-27 06:42:56 +0200 |
commit | c30a2d68541b6ff451d92709478b4e37cac86447 (patch) | |
tree | 03b92452d7b63e0a81f7e636e38e3c40c2ba1128 /src/CMakeLists.txt | |
parent | 454a29037061ba62d89af41ecae23b4424f41ea5 (diff) | |
download | minetest-c30a2d68541b6ff451d92709478b4e37cac86447.tar.gz minetest-c30a2d68541b6ff451d92709478b4e37cac86447.tar.bz2 minetest-c30a2d68541b6ff451d92709478b4e37cac86447.zip |
Add AreaStore data structure
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0ed0b8015..614e81908 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -180,6 +180,21 @@ endif(ENABLE_REDIS) find_package(SQLite3 REQUIRED) find_package(Json REQUIRED) +OPTION(ENABLE_SPATIAL "Enable SpatialIndex AreaStore backend" TRUE) +set(USE_SPATIAL FALSE) + +if(ENABLE_SPATIAL) + find_library(SPATIAL_LIBRARY spatialindex) + find_path(SPATIAL_INCLUDE_DIR spatialindex/SpatialIndex.h) + if(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR) + set(USE_SPATIAL TRUE) + message(STATUS "SpatialIndex AreaStore backend enabled.") + include_directories(${SPATIAL_INCLUDE_DIR}) + else(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR) + message(STATUS "SpatialIndex not found!") + endif(SPATIAL_LIBRARY AND SPATIAL_INCLUDE_DIR) +endif(ENABLE_SPATIAL) + if(NOT MSVC) set(USE_GPROF FALSE CACHE BOOL "Use -pg flag for g++") @@ -289,6 +304,7 @@ add_subdirectory(unittest) add_subdirectory(util) set(common_SRCS + areastore.cpp ban.cpp cavegen.cpp clientiface.cpp @@ -532,6 +548,9 @@ if(BUILD_CLIENT) if (USE_REDIS) target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY}) endif() + if (USE_SPATIAL) + target_link_libraries(${PROJECT_NAME} ${SPATIAL_LIBRARY}) + endif() endif(BUILD_CLIENT) @@ -556,6 +575,9 @@ if(BUILD_SERVER) if (USE_REDIS) target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY}) endif() + if (USE_SPATIAL) + target_link_libraries(${PROJECT_NAME}server ${SPATIAL_LIBRARY}) + endif() if(USE_CURL) target_link_libraries( ${PROJECT_NAME}server |