-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
36 lines (30 loc) · 1.23 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
cmake_minimum_required(VERSION 3.16)
project(CS202-Project LANGUAGES CXX)
set(BUILD_SHARED_LIBS OFF)
set(TGUI_BACKEND SFML_GRAPHICS)
set(TGUI_BUILD_GUI_BUILDER ON)
set(TGUI_SHARED_LIBS OFF)
set(SFML_DIR ${CMAKE_BINARY_DIR}/_deps/sfml-build/SFMLConfig.cmake)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
FetchContent_Declare(TGUI
GIT_REPOSITORY https://github.com/texus/TGUI.git
GIT_TAG 0.10)
FetchContent_MakeAvailable(TGUI)
file(GLOB SRC_FILES "src/*.cpp")
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} PRIVATE sfml-system sfml-window sfml-graphics sfml-audio TGUI::TGUI)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_SCHEME_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_BINARY_DIR}/_deps/sfml-src/extlibs/bin/x64/openal32.dll
${CMAKE_SOURCE_DIR})
install(TARGETS ${PROJECT_NAME})