-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
122 lines (92 loc) · 4.28 KB
/
CMakeLists.txt
File metadata and controls
122 lines (92 loc) · 4.28 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Copyright 2025, Gerasim Troeglazov, 3dEyes@gmail.com. All rights reserved.
# Distributed under the terms of the MIT License.
#
# hvif-tools: Main CMake configuration
#
cmake_minimum_required(VERSION 3.16)
project(hvif-tools
VERSION 2.1.5
DESCRIPTION "Tools and libraries for Haiku Vector Icon Format"
LANGUAGES CXX
)
# ============================================================================
# Load required CMake modules early
# ============================================================================
include(CMakeDependentOption)
# ============================================================================
# Build options: Libraries
# ============================================================================
option(BUILD_HVIFTOOLS_LIB "Build libhviftools library" ON)
option(BUILD_IMAGETRACER_LIB "Build libimagetracer library" ON)
option(BUILD_SHARED_LIBS "Build shared libraries instead of static" OFF)
# ============================================================================
# Build options: CLI Tools
# ============================================================================
cmake_dependent_option(BUILD_ICON2ICON
"Build icon2icon: Universal icon format converter"
ON "BUILD_HVIFTOOLS_LIB" OFF)
cmake_dependent_option(BUILD_IMG2SVG
"Build img2svg: Bitmap to SVG vectorizer"
ON "BUILD_IMAGETRACER_LIB" OFF)
option(BUILD_IOM2HVIF "Build iom2hvif: Icon-O-Matic to HVIF converter (Haiku only)" OFF)
option(BUILD_MSGDUMP "Build msgdump: BMessage dump utility (debug tool)" OFF)
# ============================================================================
# Build options: Platform addons
# ============================================================================
if(WIN32)
cmake_dependent_option(BUILD_HVIF4WIN
"Build Windows thumbnail provider for HVIF/IOM files"
ON "BUILD_HVIFTOOLS_LIB" OFF)
else()
set(BUILD_HVIF4WIN OFF CACHE BOOL "Windows thumbnail provider (Windows only)" FORCE)
endif()
# ============================================================================
# Build options: Integration
# ============================================================================
option(BUILD_INKSCAPE_EXTENSIONS "Install Inkscape import/export extensions" OFF)
# ============================================================================
# Development options
# ============================================================================
option(HVIF_TOOLS_WARNINGS "Enable extra compiler warnings" OFF)
option(HVIF_TOOLS_WERROR "Treat warnings as errors" OFF)
option(HVIF_TOOLS_TESTS "Build unit tests" OFF)
option(HVIF_TOOLS_SANITIZERS "Enable sanitizers (ASan, UBSan)" OFF)
option(HVIF_TOOLS_INSTALL "Enable installation targets" ON)
# Stress testing
cmake_dependent_option(BUILD_STRESS_TEST
"Build stress testing utility for icon converters"
OFF "BUILD_HVIFTOOLS_LIB" OFF)
# ============================================================================
# Build type
# ============================================================================
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo"
)
endif()
# ============================================================================
# CMake modules
# ============================================================================
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CompilerSettings)
include(Dependencies)
# ============================================================================
# Subdirectories
# ============================================================================
add_subdirectory(external)
add_subdirectory(src)
if(BUILD_INKSCAPE_EXTENSIONS)
add_subdirectory(inkscape)
endif()
# ============================================================================
# Installation and packaging
# ============================================================================
if(HVIF_TOOLS_INSTALL)
include(InstallRules)
endif()
# ============================================================================
# Build summary
# ============================================================================
include(cmake/BuildInfo.cmake)