-
Notifications
You must be signed in to change notification settings - Fork 30
/
CMakeLists.txt
50 lines (43 loc) · 1.17 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
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 3.10)
#Set up project
project(empire VERSION 1.0)
#Set executable
add_executable(${PROJECT_NAME}
src/main.cpp
src/Application.cpp
src/ResourceManager/ResourceHolder.cpp
src/Util/Common.cpp
src/Util/Random.cpp
src/Util/FPSCounter.cpp
src/Sim/ColonyStatistics.cpp
src/Sim/ColonyCreator.cpp
src/Sim/Map.cpp
src/Sim/CustomColonyCreator.cpp
src/Sim/Colony.cpp
src/Sim/RandomColonyCreator.cpp
src/Sim/World.cpp
src/Sim/Person.cpp
)
#Set C++17
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF)
#Set flags
if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
/W4 /WX)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall -Wextra -pedantic )
#-Werror) #Warning flags
endif()
#Set module path
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
#Find libraries
find_package(Threads)
find_package(SFML REQUIRED audio network graphics window system)
#Finally
target_link_libraries(${PROJECT_NAME}
Threads::Threads
${SFML_LIBRARIES}
${SFML_DEPENDENCIES}
)