summaryrefslogtreecommitdiffstats
path: root/externals/find-modules/Findinih.cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--externals/find-modules/Findinih.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/externals/find-modules/Findinih.cmake b/externals/find-modules/Findinih.cmake
index 844396471..8d1a07243 100644
--- a/externals/find-modules/Findinih.cmake
+++ b/externals/find-modules/Findinih.cmake
@@ -4,10 +4,7 @@
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
- pkg_search_module(INIREADER QUIET IMPORTED_TARGET GLOBAL INIReader)
- if (INIREADER_FOUND)
- add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
- endif()
+ pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader)
endif()
include(FindPackageHandleStandardArgs)
@@ -15,3 +12,7 @@ find_package_handle_standard_args(inih
REQUIRED_VARS INIREADER_LINK_LIBRARIES
VERSION_VAR INIREADER_VERSION
)
+
+if (inih_FOUND AND NOT TARGET inih::INIReader)
+ add_library(inih::INIReader ALIAS PkgConfig::INIREADER)
+endif()