osrm-backend/example/CMakeLists.txt

35 lines
1.1 KiB
CMake
Raw Permalink Normal View History

cmake_minimum_required(VERSION 3.18)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE)
message(FATAL_ERROR "In-source builds are not allowed.
Please create a directory and run cmake from there, passing the path to this source directory as the last argument.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.")
endif()
2016-05-27 11:53:51 -04:00
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_BUILD_TYPE Release)
endif()
project(osrm-example C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "Building on a 64 bit system")
else()
message(STATUS "Building on a 32 bit system")
endif()
2016-05-27 11:53:51 -04:00
link_directories(${LibOSRM_LIBRARY_DIRS})
add_executable(osrm-example example.cpp)
find_package(LibOSRM REQUIRED)
2017-06-28 11:53:54 -04:00
target_link_libraries(osrm-example ${LibOSRM_LIBRARIES} ${LibOSRM_DEPENDENT_LIBRARIES})
2016-05-27 11:53:51 -04:00
include_directories(SYSTEM ${LibOSRM_INCLUDE_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LibOSRM_CXXFLAGS}")