-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·47 lines (39 loc) · 1.65 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
# Cmake version
cmake_minimum_required(VERSION 3.0)
# C++ std 14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_EXE_LINKER_FLAGS "-no-pie")
# Project DeadGame-2048
set(PROJECT DeadGame-2048)
# Code file.
file(GLOB SOURCES "src/*.cpp" "src/*.c")
# Header file.
include_directories(${CMAKE_SOURCE_DIR}/local/include)
include_directories(include)
include_directories(lib)
# External lib.
link_directories(${CMAKE_SOURCE_DIR}/local/lib)
# Build exec file.
project(${PROJECT})
add_executable(${PROJECT} ${SOURCES})
target_link_libraries(${PROJECT} sfml-system sfml-graphics sfml-window)
add_custom_target(release)
add_dependencies(release ${PROJECT})
# Build AppImage.
set(UPDATE "gh-releases-zsync|TKNgu|DeadGame-2048|latest|DeadGame-2048-x86_64.AppImage.zsync")
add_custom_target(AppImage)
add_dependencies(AppImage ${PROJECT})
add_custom_command(TARGET AppImage
COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/DeadGame-2048 AppImage)
add_custom_command(TARGET AppImage
COMMAND ${CMAKE_COMMAND} -E
copy ${PROJECT} AppImage/bin/${PROJECT})
add_custom_command(TARGET AppImage
COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/data AppImage/data)
add_custom_command(TARGET AppImage
COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/usr/lib AppImage/lib)
add_custom_command(TARGET AppImage
COMMAND ${CMAKE_SOURCE_DIR}/tool/appimagetool-x86_64.AppImage AppImage/ -u \"gh-releases-zsync|TKNgu|DeadGame-2048|latest|DeadGame-2048-x86_64.AppImage.zsync\")