mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
Merge pull request #12794 from abouvier/cmake-simpleini-module
cmake: support simpleini config and pc file
This commit is contained in:
commit
f70821ce0d
1 changed files with 12 additions and 10 deletions
|
@ -2,18 +2,20 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
find_path(SimpleIni_INCLUDE_DIR SimpleIni.h)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(SimpleIni
|
|
||||||
REQUIRED_VARS SimpleIni_INCLUDE_DIR
|
|
||||||
)
|
|
||||||
|
|
||||||
if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni)
|
find_package(SimpleIni QUIET CONFIG)
|
||||||
add_library(SimpleIni::SimpleIni INTERFACE IMPORTED)
|
if (SimpleIni_CONSIDERED_CONFIGS)
|
||||||
set_target_properties(SimpleIni::SimpleIni PROPERTIES
|
find_package_handle_standard_args(SimpleIni CONFIG_MODE)
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SimpleIni_INCLUDE_DIR}"
|
else()
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_search_module(SIMPLEINI QUIET IMPORTED_TARGET simpleini)
|
||||||
|
find_package_handle_standard_args(SimpleIni
|
||||||
|
REQUIRED_VARS SIMPLEINI_INCLUDEDIR
|
||||||
|
VERSION_VAR SIMPLEINI_VERSION
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(SimpleIni_INCLUDE_DIR)
|
if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni)
|
||||||
|
add_library(SimpleIni::SimpleIni ALIAS PkgConfig::SIMPLEINI)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue