-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (60 loc) · 2 KB
/
Copy pathCMakeLists.txt
File metadata and controls
71 lines (60 loc) · 2 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
cmake_minimum_required(VERSION 3.20)
project(structview_qt6 CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
# Allow older cmake_minimum_required in FetchContent dependencies
set(CMAKE_POLICY_VERSION_MINIMUM 3.5 CACHE STRING "" FORCE)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Xml)
# Ensure the platform static library is built with -fPIC
# (required because we link it into a shared .wlx library)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(FetchContent)
# ---------------------------------------------------------------------------
# yaml-cpp — YAML 1.2 parser (using system package)
# ---------------------------------------------------------------------------
find_package(yaml-cpp REQUIRED)
# ---------------------------------------------------------------------------
# toml++ — header-only TOML parser (v3.4.0)
# ---------------------------------------------------------------------------
FetchContent_Declare(tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(tomlplusplus)
# Pull in the platform library (builds libwlxbase_wlqt.a)
add_subdirectory(
${CMAKE_CURRENT_SOURCE_DIR}/../wlxbase_wlqt
${CMAKE_CURRENT_BINARY_DIR}/wlxbase_wlqt
)
# NOTE: Headers with Q_OBJECT must be listed explicitly so AUTOMOC processes them.
add_library(structview_qt6 SHARED
include/StructViewWidget.h
include/TextFormatEngine.h
src/wlx_entry.cpp
src/StructViewWidget.cpp
src/JsonEngine.cpp
src/XmlEngine.cpp
src/IniEngine.cpp
src/CborEngine.cpp
src/YamlEngine.cpp
src/TomlEngine.cpp
)
set_target_properties(structview_qt6 PROPERTIES
PREFIX ""
SUFFIX ".wlx"
)
target_include_directories(structview_qt6 PRIVATE
include
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk
)
target_link_libraries(structview_qt6 PRIVATE
wlxbase_wlqt
Qt6::Widgets
Qt6::Gui
Qt6::Core
Qt6::Xml
yaml-cpp
tomlplusplus::tomlplusplus
)