From 26f5d500b908939ad0d61b723b3ee51e3eba9885 Mon Sep 17 00:00:00 2001 From: Michael M Date: Mon, 14 Aug 2017 15:12:28 -0700 Subject: [PATCH] FindMiniupnpc: expose imported library target --- CMake/FindMiniupnpc.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMake/FindMiniupnpc.cmake b/CMake/FindMiniupnpc.cmake index 79b00c0621..f9a14e2a89 100644 --- a/CMake/FindMiniupnpc.cmake +++ b/CMake/FindMiniupnpc.cmake @@ -17,3 +17,11 @@ find_package_handle_standard_args(MINIUPNPC DEFAULT_MSG MINIUPNPC_INCLUDE_DIR MI set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY}) set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR}) mark_as_advanced(MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY MINIUPNPC_API_VERSION_STR) + +if (MINIUPNPC_FOUND AND NOT TARGET miniupnpc) + add_library(Miniupnpc::miniupnpc UNKNOWN IMPORTED) + set_target_properties(Miniupnpc::miniupnpc PROPERTIES + IMPORTED_LOCATION ${MINIUPNPC_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${MINIUPNPC_INCLUDE_DIRS} + ) +endif()