-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (67 loc) · 2.02 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
cmake_minimum_required(VERSION 3.13)
project(
Arcade
VERSION 1.0
DESCRIPTION "A simple Arcade"
LANGUAGES CXX
)
##############################################################################
# arcade binary
add_executable(arcade)
set_target_properties(arcade PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
)
add_custom_command(TARGET arcade PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/assets $<TARGET_FILE_DIR:arcade>/assets
)
##############################################################################
# arcade main menu
add_library(arcade_menu_main SHARED)
set_target_properties(arcade_menu_main PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/menu/"
)
##############################################################################
# Game .so libs
add_library(arcade_nibbler SHARED)
set_target_properties(arcade_nibbler PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_library(arcade_snake SHARED)
set_target_properties(arcade_snake PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
##############################################################################
# Graphics .so libs
add_library(arcade_ncurses SHARED)
set_target_properties(arcade_ncurses PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_library(arcade_sdl2 SHARED)
set_target_properties(arcade_sdl2 PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_library(arcade_sfml SHARED)
set_target_properties(arcade_sfml PROPERTIES
CXX_STANDARD 20
COMPILE_FLAGS "-fno-gnu-unique"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
add_subdirectory(src)