Files
wfassoc/example/qwfassoc/CMakeLists.txt
T
yyc12345 27235c2619 fix: fix qwfassoc build error
- fix qwfassoc build error
- set version of wfassoc to official version
- add version restriction when qwfassoc finding wfassoc
- rename qwfassoc project name in cmake configuration file
- set standalone build to OFF in default
2026-08-18 20:27:08 +08:00

36 lines
1.3 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(qwfassoc LANGUAGES CXX)
# Qt 6 requires C++17 at minimum.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Let CMake auto-process Q_OBJECT, .ui files and .qrc resources for every
# subproject below.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# 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.
# wfassoc ships a standard config-mode package (wfassocConfig.cmake); point
# CMAKE_PREFIX_PATH or wfassoc_ROOT at its install prefix to locate it.
# toml11 is only needed when the standalone executable is built, so it is
# looked up conditionally below.
find_package(Qt6 REQUIRED COMPONENTS Widgets LinguistTools)
find_package(wfassoc 1.0.0 REQUIRED)
# The standalone executable is optional: embedders may want only the library.
option(QWFASSOC_BUILD_STANDALONE "Build the qwfassoc-standalone executable" OFF)
add_subdirectory(qwfassoc)
if(QWFASSOC_BUILD_STANDALONE)
find_package(toml11 REQUIRED)
add_subdirectory(qwfassoc-standalone)
endif()