-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
91 lines (82 loc) · 4.03 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.16)
project(DeltaShadow VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Add CMake modules
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
# Использовать стандарт C++11.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Инициализация зависимостей.
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(SDL_gfx REQUIRED)
find_package(SDL_mixer REQUIRED)
add_executable(${PROJECT_NAME}
AnimTile.h
DeltaShadow.Program.cpp DeltaShadow.Program.h
Environment/PrimaryScreen.cpp Environment/PrimaryScreen.h
Environment/SpecialFolder.cpp Environment/SpecialFolder.h
Program.h
RoomLayers.h
SdlDotNetCompat/Audio/Mixer.cpp SdlDotNetCompat/Audio/Mixer.h
SdlDotNetCompat/Audio/Music.cpp SdlDotNetCompat/Audio/Music.h
SdlDotNetCompat/Audio/MusicPlayer.cpp SdlDotNetCompat/Audio/MusicPlayer.h
SdlDotNetCompat/Audio/Sound.cpp SdlDotNetCompat/Audio/Sound.h
SdlDotNetCompat/Core/BaseSdlResource.cpp SdlDotNetCompat/Core/BaseSdlResource.h
SdlDotNetCompat/Core/EventHandler.cpp SdlDotNetCompat/Core/EventHandler.h
SdlDotNetCompat/Core/Events.cpp SdlDotNetCompat/Core/Events.h
SdlDotNetCompat/Core/QuitEventArgs.cpp SdlDotNetCompat/Core/QuitEventArgs.h
SdlDotNetCompat/Core/SdlEventArgs.cpp SdlDotNetCompat/Core/SdlEventArgs.h
SdlDotNetCompat/Core/SdlException.cpp SdlDotNetCompat/Core/SdlException.h
SdlDotNetCompat/Core/TickEventArgs.cpp SdlDotNetCompat/Core/TickEventArgs.h
SdlDotNetCompat/Core/UserEventArgs.cpp SdlDotNetCompat/Core/UserEventArgs.h
SdlDotNetCompat/Drawing/Color.cpp SdlDotNetCompat/Drawing/Color.h
SdlDotNetCompat/Drawing/Point.h
SdlDotNetCompat/Drawing/Rectangle.cpp SdlDotNetCompat/Drawing/Rectangle.h
SdlDotNetCompat/Drawing/Size.h
SdlDotNetCompat/Graphics/Surface.cpp SdlDotNetCompat/Graphics/Surface.h
SdlDotNetCompat/Graphics/Video.cpp SdlDotNetCompat/Graphics/Video.h
SdlDotNetCompat/Graphics/VideoExposeEventArgs.cpp SdlDotNetCompat/Graphics/VideoExposeEventArgs.h
SdlDotNetCompat/Graphics/VideoInfo.cpp SdlDotNetCompat/Graphics/VideoInfo.h
SdlDotNetCompat/Graphics/VideoResizeEventArgs.cpp SdlDotNetCompat/Graphics/VideoResizeEventArgs.h
SdlDotNetCompat/Input/ActiveEventArgs.cpp SdlDotNetCompat/Input/ActiveEventArgs.h
SdlDotNetCompat/Input/Joystick.cpp SdlDotNetCompat/Input/Joystick.h
SdlDotNetCompat/Input/Joysticks.cpp SdlDotNetCompat/Input/Joysticks.h
SdlDotNetCompat/Input/Keyboard.cpp SdlDotNetCompat/Input/Keyboard.h
SdlDotNetCompat/Input/KeyboardEventArgs.cpp SdlDotNetCompat/Input/KeyboardEventArgs.h
SdlDotNetCompat/Input/Mouse.cpp SdlDotNetCompat/Input/Mouse.h
SdlDotNetCompat/Input/MouseButtonEventArgs.cpp SdlDotNetCompat/Input/MouseButtonEventArgs.h
SdlDotNetCompat/Input/MouseMotionEventArgs.cpp SdlDotNetCompat/Input/MouseMotionEventArgs.h
Util/BinaryStreamReader.cpp Util/BinaryStreamReader.h
Util/BinaryStreamWriter.cpp Util/BinaryStreamWriter.h
Util/File.cpp Util/File.h
Util/Random.cpp Util/Random.h
program_main.cpp
)
# Сборка для Linux/Unix
if(UNIX AND NOT MACOS)
target_include_directories(${PROJECT_NAME} PRIVATE
${SDL_INCLUDE_DIR}
${SDL_IMAGE_INCLUDE_DIR}
${SDL_GFX_INCLUDE_DIR}
${SDL_MIXER_INCLUDE_DIR}
)
target_link_libraries(${PROJECT_NAME} PRIVATE
${SDL_LIBRARY}
${SDL_IMAGE_LIBRARIES}
${SDL_GFX_LIBRARIES}
${SDL_MIXER_LIBRARY}
)
endif()
# Копирует папку res из корня проекта в папку сборки если они отличаются.
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res ${CMAKE_BINARY_DIR}/res)
endif()
# Установка.
#install(TARGETS DeltaShadow
# BUNDLE DESTINATION .
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
#)