generated from SFML/cmake-sfml-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (33 loc) · 811 Bytes
/
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
cmake_minimum_required(VERSION 3.21)
project(
Fyshx
VERSION 0.1.0
DESCRIPTION "Foo"
LANGUAGES CXX C)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x
)
FetchContent_MakeAvailable(SFML)
FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 9.1.0
)
FetchContent_MakeAvailable(fmt)
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.cpp)
add_executable(Fyshx ${SOURCES})
target_compile_features(
Fyshx PUBLIC
cxx_std_17
)
target_link_libraries(Fyshx
PRIVATE
sfml-graphics
fmt
)
if (WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET Fyshx POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:Fyshx> $<TARGET_FILE_DIR:Fyshx> COMMAND_EXPAND_LISTS)
endif()
install(TARGETS Fyshx)