-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (69 loc) · 2.28 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
cmake_minimum_required(VERSION 3.25)
#=======================================================================#
#==============================# Project #==============================#
#=======================================================================#
project(
Starlight
VERSION "0.1.0"
DESCRIPTION "Cross-platform real-time 3D game engine"
HOMEPAGE_URL "https://github.com/NekkoDroid/Starlight"
LANGUAGES CXX
)
#=====================#
#=====# Targets #=====#
#=====================#
set_property(GLOBAL PROPERTY USE_FOLDERS TRUE)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMake)
set(CMAKE_FOLDER Source)
add_subdirectory(Source/Starlight)
add_subdirectory(Source/Moonlight)
#====================#
#=====# Export #=====#
#====================#
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if (NOT CMAKE_INSTALL_EXPORTDIR)
set(CMAKE_INSTALL_EXPORTDIR "" CACHE STRING "Project export files (DATAROOTDIR/cmake/PROJECT_NAME)")
set(CMAKE_INSTALL_EXPORTDIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME}")
mark_as_advanced(CMAKE_INSTALL_EXPORTDIR)
endif ()
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/PackageConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_EXPORTDIR}
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
COMPATIBILITY ExactVersion
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_EXPORTDIR}
COMPONENT Starlight
)
install(
EXPORT LibraryTargets
COMPONENT Library
DESTINATION ${CMAKE_INSTALL_EXPORTDIR}
NAMESPACE ${PROJECT_NAME}::
)
install(
EXPORT ProgramTargets
COMPONENT Program
DESTINATION ${CMAKE_INSTALL_EXPORTDIR}
NAMESPACE ${PROJECT_NAME}::
)
#=====================#
#=====# License #=====#
#=====================#
if (NOT CMAKE_INSTALL_LICENSEDIR)
set(CMAKE_INSTALL_LICENSEDIR "" CACHE STRING "Project license files (DATAROOTDIR/licenses/PROJECT_NAME)")
set(CMAKE_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DATAROOTDIR}/licenses/${PROJECT_NAME}")
mark_as_advanced(CMAKE_INSTALL_LICENSEDIR)
endif ()
install(
FILES "${PROJECT_SOURCE_DIR}/LICENSE.txt"
DESTINATION ${CMAKE_INSTALL_LICENSEDIR}
)