-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (56 loc) · 2.04 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
cmake_minimum_required(VERSION 3.5)
project (SilvergunProject)
include(FetchContent)
FetchContent_Declare(
allegro5
GIT_REPOSITORY https://github.com/liballeg/allegro5.git
GIT_TAG 5.2.9.1
)
FetchContent_Declare(
silvergun
GIT_REPOSITORY https://github.com/AtomicSponge/silvergun.git
GIT_TAG main
)
FetchContent_GetProperties(allegro5)
FetchContent_GetProperties(silvergun)
if(NOT allegro5_POPULATED)
FetchContent_Populate(allegro5)
if (MSVC)
set(SHARED ON)
else()
set(SHARED OFF)
endif()
set(WANT_TESTS OFF)
set(WANT_EXAMPLES OFF)
set(WANT_DEMO OFF)
add_subdirectory(${allegro5_SOURCE_DIR} ${allegro5_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
if(NOT silvergun_POPULATED)
FetchContent_MakeAvailable(silvergun)
endif()
add_executable(slvdemo src/main.cpp)
target_compile_options(slvdemo PRIVATE)
if(CMAKE_BUILD_TYPE MATCHES Debug)
target_compile_options(slvdemo PRIVATE "-DSLV_BUILD_DEBUG")
endif()
target_include_directories(slvdemo PUBLIC ${allegro5_SOURCE_DIR}/include)
target_include_directories(slvdemo PUBLIC ${allegro5_BINARY_DIR}/include)
target_include_directories(slvdemo PUBLIC ${silvergun_SOURCE_DIR}/include)
target_link_libraries(slvdemo LINK_PUBLIC allegro allegro_main allegro_audio allegro_acodec allegro_font allegro_image allegro_primitives)
# These include files are typically copied into the correct places via allegro's install
# target, but we do it manually.
file(COPY ${allegro5_SOURCE_DIR}/addons/acodec/allegro5/allegro_acodec.h
DESTINATION ${allegro5_SOURCE_DIR}/include/allegro5
)
file(COPY ${allegro5_SOURCE_DIR}/addons/audio/allegro5/allegro_audio.h
DESTINATION ${allegro5_SOURCE_DIR}/include/allegro5
)
file(COPY ${allegro5_SOURCE_DIR}/addons/font/allegro5/allegro_font.h
DESTINATION ${allegro5_SOURCE_DIR}/include/allegro5
)
file(COPY ${allegro5_SOURCE_DIR}/addons/image/allegro5/allegro_image.h
DESTINATION ${allegro5_SOURCE_DIR}/include/allegro5
)
file(COPY ${allegro5_SOURCE_DIR}/addons/primitives/allegro5/allegro_primitives.h
DESTINATION ${allegro5_SOURCE_DIR}/include/allegro5
)