-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
94 lines (73 loc) · 2.12 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
86
87
88
89
90
91
92
93
94
#================= Project Setup ==========================
# CMake
cmake_minimum_required(VERSION 3.23.0...3.25.0)
# Project
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
project(Stex
VERSION 0.5.0.1
LANGUAGES CXX
DESCRIPTION "A tool to pack/unpack Klei TEX format atlases"
)
# Get helper scripts
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchOBCMake.cmake)
fetch_ob_cmake("v0.3.7")
# Initialize project according to standard rules
include(OB/Project)
ob_standard_project_setup()
# Additional Project Variables
set(PROJECT_FORMAL_NAME "Stexatlaser")
# Configuration options
# Handled by fetched libs, but set this here formally since they aren't part of the main project
option(BUILD_SHARED_LIBS "Build Stex with shared libraries" OFF)
# C++
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Build augmentation
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
enable_language("RC")
endif()
#================= Build =========================
# Import Qt
set(STEX_QT_COMPONENTS
Core
Gui
Xml
)
# Find Qt package
include(OB/Qt)
ob_find_package_qt(REQUIRED COMPONENTS ${STEX_QT_COMPONENTS})
# Fetch Qx (build and import from source)
set(STEX_QX_COMPONENTS
Core
Io
Xml
)
# Fetch Qx
include(OB/FetchQx)
ob_fetch_qx(
REF "v0.5.8"
COMPONENTS
${STEX_QX_COMPONENTS}
)
# Fetch libsquish
include(OB/FetchLibSquish)
ob_fetch_modern_libsquish("8a6aad970285a536170de9b3fc63735a72674561")
# Process Targets
set(APP_TARGET_NAME ${PROJECT_NAMESPACE_LC}_${PROJECT_NAMESPACE_LC})
set(APP_ALIAS_NAME ${PROJECT_NAMESPACE})
add_subdirectory(app)
#--------------------Package Config-----------------------
ob_standard_project_package_config(
COMPATIBILITY "SameMinorVersion"
CONFIG STANDARD
TARGET_CONFIGS
TARGET "${PROJECT_NAMESPACE}::${APP_ALIAS_NAME}" COMPONENT "${APP_ALIAS_NAME}" DEFAULT
)
#================= Install ==========================
ob_standard_project_misc_install()
#====================== CPack ==============================
include(OB/Packaging)
ob_standard_project_package(VENDOR "oblivioncth")