-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
38 lines (32 loc) · 1.09 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
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME ZombieV)
project(${PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)
find_package(OpenGL)
file(GLOB source_files
"src/*.cpp"
"src/Blur/*.cpp"
"src/LightEngine/*.cpp"
"src/Props/*.cpp"
"src/System/*.cpp"
"src/UnitedEngine/*.cpp"
"src/Weapons/*.cpp"
)
set(SOURCES ${source_files})
set(CMAKE_CXX_STANDARD 11)
# Detect and add SFML
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
find_package(SFML 2 REQUIRED COMPONENTS audio graphics window system)
add_executable(${PROJECT_NAME} ${SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE "include" "lib")
target_link_libraries(${PROJECT_NAME} sfml-system sfml-window sfml-graphics sfml-audio)
if (UNIX)
target_link_libraries(${PROJECT_NAME} pthread)
endif (UNIX)
# Copy data dir to the binary directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
if(MSVC)
foreach(lib ${SFML_LIBS})
get_target_property(lib_path ${lib} LOCATION)
file(COPY ${lib_path} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endforeach()
endif(MSVC)