generated from SFML/cmake-sfml-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (52 loc) · 1.44 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
51
52
53
54
55
56
57
58
cmake_minimum_required(VERSION 3.21)
project(c-Gamedev LANGUAGES CXX)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
# Define the source files and header files separately
set(SOURCES
src/main.cpp
src/Player.cpp
src/Game.cpp
src/Configuration.cpp
src/Action.cpp
src/Collision.cpp
src/Entity.cpp
src/Enemy.cpp
src/Meteor.cpp
src/Saucer.cpp
src/Shoot.cpp
src/World.cpp
)
set(HEADERS
include/Player.hpp
include/Game.hpp
include/Configuration.hpp
include/ResourceManager.hpp
include/Action.hpp
include/ActionMap.hpp
include/ActionTarget.hpp
include/Player.tpl
include/ActionMap.tpl
include/ActionTarget.tpl
include/Collision.hpp
include/Entity.hpp
include/Entity.tpl
include/Enemy.hpp
include/Meteor.hpp
include/random.hpp
include/Saucer.hpp
include/Shoot.hpp
include/World.hpp
)
# Create the executable target and link libraries
add_executable(c-Gamedev ${SOURCES} ${HEADERS})
target_link_libraries(c-Gamedev PRIVATE sfml-graphics sfml-audio)
target_compile_features(c-Gamedev PRIVATE cxx_std_17)
if (WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET c-Gamedev POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:c-Gamedev> $<TARGET_FILE_DIR:c-Gamedev> COMMAND_EXPAND_LISTS)
endif()
install(TARGETS c-Gamedev)