Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
cmake: minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Oct 19, 2023
1 parent ff4b9f3 commit 3ed04de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions FramelessHelperConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

set(_@PROJECT_NAME@_supported_components Core Widgets Quick)
set(_@PROJECT_NAME@_available_components Core Gui)

foreach(_comp ${@PROJECT_NAME@_FIND_COMPONENTS})
if(_comp IN_LIST _@PROJECT_NAME@_supported_components)
set(__target @PROJECT_NAME@::${_comp})
foreach(_component ${@PROJECT_NAME@_FIND_COMPONENTS})
if(_component IN_LIST _@PROJECT_NAME@_supported_components)
set(__target @PROJECT_NAME@::${_component})
if(TARGET ${__target})
continue()
else()
set(__target_full @PROJECT_NAME@${_comp})
set(__target_full @PROJECT_NAME@${_component})
set(__targets_file "${CMAKE_CURRENT_LIST_DIR}/${__target_full}Targets.cmake")
if(EXISTS "${__targets_file}")
include("${__targets_file}")
add_library(${__target} ALIAS @PROJECT_NAME@::${__target_full})
if(NOT "x${_component}" STREQUAL "xCore")
list(APPEND _@PROJECT_NAME@_available_components ${_component})
endif()
else()
set(@PROJECT_NAME@_FOUND FALSE)
set(@PROJECT_NAME@_NOT_FOUND_MESSAGE "Can't find necessary configuration file for ${__target}, please make sure this component is built successfully and installed properly.")
Expand Down Expand Up @@ -67,4 +73,9 @@ include(FeatureSummary)
set_package_properties(@PROJECT_NAME@ PROPERTIES
DESCRIPTION "@PROJECT_DESCRIPTION@"
URL "@PROJECT_HOMEPAGE_URL@"
)
)

if(${@PROJECT_NAME@_FOUND})
find_dependency(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS ${_@PROJECT_NAME@_available_components})
find_dependency(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${_@PROJECT_NAME@_available_components})
endif()
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 1 files
+3 −8 utils.cmake

0 comments on commit 3ed04de

Please sign in to comment.