Files
wfassoc/example/qwfassoc/CMakeLists.txt
T

36 lines
1.3 KiB
CMake
Raw Normal View History

2026-06-23 20:46:56 +08:00
cmake_minimum_required(VERSION 3.20)
2026-08-18 20:27:08 +08:00
project(qwfassoc LANGUAGES CXX)
2026-06-23 20:46:56 +08:00
# Qt 6 requires C++17 at minimum.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
2026-06-23 21:38:54 +08:00
# Let CMake auto-process Q_OBJECT, .ui files and .qrc resources for every
# subproject below.
2026-06-23 20:46:56 +08:00
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
2026-06-23 21:38:54 +08:00
# Qt and LinguistTools are used by both subprojects, so they are looked up at
# the top level. The same is true for wfassoc: although only the qwfassoc
# library links against it directly, PUBLIC propagation from the library
# target makes the dependency available to qwfassoc-standalone as well.
2026-08-17 10:38:39 +08:00
# wfassoc ships a standard config-mode package (wfassocConfig.cmake); point
# CMAKE_PREFIX_PATH or wfassoc_ROOT at its install prefix to locate it.
2026-06-23 21:38:54 +08:00
# toml11 is only needed when the standalone executable is built, so it is
# looked up conditionally below.
2026-06-23 20:46:56 +08:00
find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools)
2026-08-18 20:27:08 +08:00
find_package(wfassoc 1.0.0 REQUIRED)
2026-06-23 20:46:56 +08:00
2026-06-23 21:38:54 +08:00
# The standalone executable is optional: embedders may want only the library.
2026-08-18 20:27:08 +08:00
option(QWFASSOC_BUILD_STANDALONE "Build the qwfassoc-standalone executable" OFF)
2026-06-23 20:46:56 +08:00
2026-06-23 21:38:54 +08:00
add_subdirectory(qwfassoc)
2026-06-23 20:46:56 +08:00
2026-06-23 21:38:54 +08:00
if(QWFASSOC_BUILD_STANDALONE)
find_package(toml11 REQUIRED)
add_subdirectory(qwfassoc-standalone)
endif()