-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (53 loc) · 1.78 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
cmake_minimum_required(VERSION 3.22)
project(SnakeQT)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(ZSTD_TAG release)
set(ZLIB_TAG develop)
if (WIN32)
set(MZ_FORCE_FETCH_LIBS ON)
endif (WIN32)
find_package(Qt5 COMPONENTS
Core
Gui
Widgets
Xml
Network
REQUIRED)
add_subdirectory(minizip-ng)
link_directories(minizip-ng)
qt5_add_resources(RESOURCE_ADDED resources.qrc)
add_executable(SnakeQT ${RESOURCE_ADDED}
src/main.cpp
src/jeu.cpp
src/map.cpp
src/constants.hpp
src/inmemoryzip.cpp
src/network_manager.cpp
src/screens/snakewindow.cpp
src/screens/mainmenu.hpp
src/screens/gamescreen.cpp
src/screens/editorscreen.cpp
src/screens/snakewindow.cpp
src/screens/gamearea.cpp
src/screens/browsemapscreen.cpp
src/screens/endgamescreen.hpp src/screens/endgamescreen.cpp)
target_link_libraries(SnakeQT
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Xml
Qt5::Network
minizip
)
add_custom_command(
TARGET SnakeQT POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt5::Core> $<TARGET_FILE_DIR:SnakeQT>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt5::Gui> $<TARGET_FILE_DIR:SnakeQT>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt5::Widgets> $<TARGET_FILE_DIR:SnakeQT>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt5::Xml> $<TARGET_FILE_DIR:SnakeQT>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Qt5::Network> $<TARGET_FILE_DIR:SnakeQT>
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:minizip> $<TARGET_FILE_DIR:SnakeQT>
)