From bb3440f7c46a3a2478f63bf9609202e5996d100d Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Tue, 6 Dec 2022 04:17:44 +0100 Subject: cmake: correct find modules --- externals/find-modules/Findenet.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'externals/find-modules/Findenet.cmake') 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() -- cgit v1.2.3