-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.2)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set(CMAKE_CXX_STANDARD 17)
if (POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
project(nanowars)
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 1)
find_package(SFGUI REQUIRED)
find_package(SFML REQUIRED COMPONENTS system audio graphics window)
find_package(Boost REQUIRED)
find_package(Rapidjson REQUIRED)
find_package(Box2D REQUIRED)
file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
if(BUILD_TESTS)
include_directories(${CATCH2_INCLUDE_DIR})
file(GLOB_RECURSE SOURCE_TEST_FILES ${CMAKE_CURRENT_SOURCE_DIR}/test/*.cpp)
add_executable(nanowars_tests ${SOURCE_TEST_FILES} ${SOURCE_FILES})
target_link_libraries(nanowars_tests ${SFML_LIBRARIES} ${SFGUI_LIBRARY} ${BOX2D_LIBRARY})
target_compile_definitions(nanowars_tests PRIVATE TEST_BUILD)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${SFML_INCLUDE_DIR})
include_directories(${SFGUI_INCLUDE_DIR})
include_directories(${BOX2D_INCLUDE_DIR})
include_directories(${RAPIDJSON_INCLUDEDIR})
add_executable(nanowars ${SOURCE_FILES})
target_link_libraries(nanowars ${SFML_LIBRARIES} ${SFGUI_LIBRARY} ${BOX2D_LIBRARY})