Skip to content

Commit 67fca9f

Browse files
wip
1 parent 99b3e8f commit 67fca9f

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

CMakeLists.txt

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
cmake_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+
325
option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON)
426
option(BUILD_TOOLS "Build OSRM tools" OFF)
527
option(BUILD_PACKAGE "Build OSRM package" OFF)
@@ -40,28 +62,6 @@ if (ENABLE_CONAN)
4062
endif()
4163
endif()
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-
6565
if (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
434434
find_package(ZLIB REQUIRED)
435435
add_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}")
440436
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
441437

442438
add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
@@ -500,7 +496,6 @@ set(UPDATER_LIBRARIES
500496
${ZLIB_LIBRARY})
501497
set(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})
516511
set(STORAGE_LIBRARIES
517512
${BOOST_BASE_LIBRARIES}
518-
${ZLIB_LIBRARY}
519513
${CMAKE_THREAD_LIBS_INIT}
520514
${TBB_LIBRARIES}
521515
${MAYBE_RT_LIBRARY}

0 commit comments

Comments
 (0)