From 814d2ad12ded94da6885d7e111ca365e4a90abd2 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 5 Jan 2023 15:07:38 +0800 Subject: [PATCH] cmake: detect qt library type Fixes: #200 Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 772b39c..aac2431 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,13 @@ set(__qt_inst_dir ${__qt_inst_dir}/../../..) cmake_path(NORMAL_PATH __qt_inst_dir) message("Qt install dir: ${__qt_inst_dir}") message("Qt version: ${QT_VERSION}") -# TODO: output shared/static Qt. +get_target_property(__qt_type Qt${QT_VERSION_MAJOR}::Core TYPE) +if(__qt_type STREQUAL "STATIC_LIBRARY") + set(__qt_type static) +else() + set(__qt_type shared) +endif() +message("Qt library type: ${__qt_type}") message("#######################################") message("FramelessHelper version: ${PROJECT_VERSION}") message("FramelessHelper commit hash: ${PROJECT_VERSION_COMMIT}")