summaryrefslogtreecommitdiffstats
path: root/externals/find-modules/Findenet.cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--externals/find-modules/Findenet.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/externals/find-modules/Findenet.cmake b/externals/find-modules/Findenet.cmake
index 663a2592f..6dae76f4c 100644
--- a/externals/find-modules/Findenet.cmake
+++ b/externals/find-modules/Findenet.cmake
@@ -4,10 +4,7 @@
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
- pkg_search_module(ENET QUIET IMPORTED_TARGET GLOBAL libenet)
- if (ENET_FOUND)
- add_library(enet::enet ALIAS PkgConfig::ENET)
- endif()
+ pkg_search_module(ENET QUIET IMPORTED_TARGET libenet)
endif()
include(FindPackageHandleStandardArgs)
@@ -15,3 +12,7 @@ find_package_handle_standard_args(enet
REQUIRED_VARS ENET_LINK_LIBRARIES
VERSION_VAR ENET_VERSION
)
+
+if (enet_FOUND AND NOT TARGET enet::enet)
+ add_library(enet::enet ALIAS PkgConfig::ENET)
+endif()