-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.11.3) | ||
|
||
# Set the C++ standard we will use | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||
|
||
# Add the path of the cmake files to the CMAKE_MODULE_PATH | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) | ||
|
||
project(OSM_A_star_search) | ||
|
||
# Project Output Paths | ||
set(MAINFOLDER ${PROJECT_SOURCE_DIR}) | ||
set(LIBRARY_OUTPUT_PATH "${MAINFOLDER}/lib") | ||
# Set library output path to /lib | ||
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib") | ||
|
||
# Locate Project Prerequisites | ||
# Locate project prerequisites | ||
find_package(io2d REQUIRED) | ||
find_package(Cairo) | ||
find_package(GraphicsMagick) | ||
|
||
# Add Build Targets | ||
# Set IO2D flags | ||
set(IO2D_WITHOUT_SAMPLES 1) | ||
set(IO2D_WITHOUT_TESTS 1) | ||
|
||
# Add the pugixml and GoogleTest library subdirectories | ||
add_subdirectory(thirdparty/pugixml) | ||
add_subdirectory(thirdparty/googletest) | ||
|
||
# Find all executables | ||
file(GLOB project_SRCS src/*.cpp src/*.h) | ||
|
||
# Add project executable | ||
add_executable(OSM_A_star_search ${project_SRCS}) | ||
add_executable(OSM_A_star_search src/main.cpp src/model.cpp src/render.cpp src/route_model.cpp src/route_planner.cpp) | ||
|
||
target_link_libraries(OSM_A_star_search | ||
PRIVATE io2d::io2d | ||
PUBLIC pugixml | ||
) | ||
|
||
# Add the testing executable | ||
add_executable(test test/utest_rp_a_star_search.cpp src/route_planner.cpp src/model.cpp src/route_model.cpp) | ||
|
||
target_link_libraries(test | ||
gtest_main | ||
pugixml | ||
) | ||
|
||
# Set options for Linux or Microsoft Visual C++ | ||
if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" ) | ||
target_link_libraries(OSM_A_star_search PUBLIC pthread) | ||
endif() | ||
|
||
if(MSVC) | ||
target_compile_options(OSM_A_star_search PUBLIC /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /wd4459) | ||
endif() | ||
|
||
# Create a library for unit tests | ||
add_library(route_planner OBJECT src/route_planner.cpp src/model.cpp src/route_model.cpp) | ||
target_include_directories(route_planner PRIVATE thirdparty/pugixml/src) | ||
|
||
# Add testing executable | ||
add_executable(test test/utest_rp_a_star_search.cpp) | ||
target_link_libraries(test gtest_main route_planner pugixml) | ||
add_test(NAME test COMMAND test) | ||
unset(TESTING CACHE) |