11cmake_minimum_required (VERSION 3.18)
22
3+ set (CMAKE_CXX_STANDARD 20)
4+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
5+ set (CMAKE_CXX_EXTENSIONS OFF )
6+
7+ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE )
8+ message (FATAL_ERROR "In-source builds are not allowed.
9+ Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
10+ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them." )
11+ endif ()
12+
13+ # detect if this is included as subproject and if so expose
14+ # some variables to its parent scope
15+ get_directory_property (BUILD_AS_SUBPROJECT PARENT_DIRECTORY )
16+ if (BUILD_AS_SUBPROJECT)
17+ message (STATUS "Building libosrm as subproject." )
18+ endif ()
19+
20+ # set OSRM_BUILD_DIR location (might be used in various scripts)
21+ if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
22+ set (ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
23+ endif ()
24+
325option (ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON )
426option (BUILD_TOOLS "Build OSRM tools" OFF )
527option (BUILD_PACKAGE "Build OSRM package" OFF )
@@ -40,28 +62,6 @@ if (ENABLE_CONAN)
4062 endif ()
4163endif ()
4264
43- set (CMAKE_CXX_STANDARD 20)
44- set (CMAKE_CXX_STANDARD_REQUIRED ON )
45- set (CMAKE_CXX_EXTENSIONS OFF )
46-
47- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE )
48- message (FATAL_ERROR "In-source builds are not allowed.
49- Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
50- This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them." )
51- endif ()
52-
53- # detect if this is included as subproject and if so expose
54- # some variables to its parent scope
55- get_directory_property (BUILD_AS_SUBPROJECT PARENT_DIRECTORY )
56- if (BUILD_AS_SUBPROJECT)
57- message (STATUS "Building libosrm as subproject." )
58- endif ()
59-
60- # set OSRM_BUILD_DIR location (might be used in various scripts)
61- if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR})
62- set (ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
63- endif ()
64-
6565if (ENABLE_CLANG_TIDY)
6666 find_program (CLANG_TIDY_COMMAND NAMES clang-tidy)
6767 if (NOT CLANG_TIDY_COMMAND)
@@ -433,10 +433,6 @@ endif()
433433# to ensure that osrm binaries play well with other binaries like nodejs
434434find_package (ZLIB REQUIRED)
435435add_dependency_includes(${ZLIB_INCLUDE_DIRS} )
436- message (STATUS "Zlib found: ${ZLIB_FOUND} " )
437- message (STATUS "Zlib include dirs: ${ZLIB_INCLUDE_DIRS} " )
438- message (STATUS "Zlib libraries: ${ZLIB_LIBRARIES} " )
439- message (STATUS "Using zlib include dirs ${ZLIB_INCLUDE_DIRS} " )
440436set (ZLIB_LIBRARY ${ZLIB_LIBRARIES} )
441437
442438add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
@@ -500,7 +496,6 @@ set(UPDATER_LIBRARIES
500496 ${ZLIB_LIBRARY} )
501497set (CONTRACTOR_LIBRARIES
502498 ${BOOST_BASE_LIBRARIES}
503- ${ZLIB_LIBRARY}
504499 ${CMAKE_THREAD_LIBS_INIT}
505500 ${LUA_LIBRARIES}
506501 ${TBB_LIBRARIES}
@@ -515,7 +510,6 @@ set(ENGINE_LIBRARIES
515510 ${ZLIB_LIBRARY} )
516511set (STORAGE_LIBRARIES
517512 ${BOOST_BASE_LIBRARIES}
518- ${ZLIB_LIBRARY}
519513 ${CMAKE_THREAD_LIBS_INIT}
520514 ${TBB_LIBRARIES}
521515 ${MAYBE_RT_LIBRARY}
0 commit comments