blob: 3cf221478d3a4bb21fd301e70d068df110e13358 (
plain)
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
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# We can't create the same interface imported target multiple times, CMake will complain if we do
# that. This can happen if the find_package call is done in multiple different subdirectories.
if(TARGET Hunspell::Hunspell)
set(Hunspell_FOUND ON)
return()
endif()
find_package(PkgConfig)
pkg_check_modules(hunspell hunspell IMPORTED_TARGET)
set(__hunspell_target_name "PkgConfig::hunspell")
if (NOT TARGET "${__hunspell_target_name}")
set(Hunspell_FOUND 0)
return()
endif()
add_library(Hunspell::Hunspell INTERFACE IMPORTED)
target_link_libraries(Hunspell::Hunspell INTERFACE ${__hunspell_target_name})
set(Hunspell_FOUND TRUE)
unset(__hunspell_target_name)
|