From a424ee24f781fae0e1ae0d4566db36267398fa36 Mon Sep 17 00:00:00 2001 From: Jiwoo Park Date: Fri, 15 Mar 2024 23:54:13 +0900 Subject: [PATCH] Don't add executable targets when UPNPC_BUILD_SAMPLE is OFF --- miniupnpc/CMakeLists.txt | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/miniupnpc/CMakeLists.txt b/miniupnpc/CMakeLists.txt index 5a20728..7d3cd70 100644 --- a/miniupnpc/CMakeLists.txt +++ b/miniupnpc/CMakeLists.txt @@ -139,19 +139,16 @@ if (UPNPC_BUILD_STATIC) add_executable (upnpc-static src/upnpc.c) target_link_libraries (upnpc-static PRIVATE libminiupnpc-static) target_include_directories(upnpc-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + + add_executable (upnp-listdevices-static src/listdevices.c) + target_link_libraries (upnp-listdevices-static PRIVATE libminiupnpc-static) + target_include_directories(upnp-listdevices-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + if (NOT UPNPC_NO_INSTALL) - install (TARGETS upnpc-static + install (TARGETS upnpc-static upnp-listdevices-static RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif () - - add_executable (upnp-listdevices-static src/listdevices.c) - target_link_libraries (upnp-listdevices-static PRIVATE libminiupnpc-static) - target_include_directories(upnp-listdevices-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) - if (NOT UPNPC_NO_INSTALL) - install (TARGETS upnp-listdevices-static - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() endif () if (UPNPC_BUILD_SHARED) @@ -188,19 +185,16 @@ if (UPNPC_BUILD_SHARED) add_executable (upnpc-shared src/upnpc.c) target_link_libraries (upnpc-shared PRIVATE libminiupnpc-shared) target_include_directories(upnpc-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + + add_executable (upnp-listdevices-shared src/listdevices.c) + target_link_libraries (upnp-listdevices-shared PRIVATE libminiupnpc-shared) + target_include_directories(upnp-listdevices-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + if (NOT UPNPC_NO_INSTALL) - install (TARGETS upnpc-shared + install (TARGETS upnpc-shared upnp-listdevices-shared RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif () - - add_executable (upnp-listdevices-shared src/listdevices.c) - target_link_libraries (upnp-listdevices-shared PRIVATE libminiupnpc-shared) - target_include_directories(upnp-listdevices-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) - if (NOT UPNPC_NO_INSTALL) - install (TARGETS upnp-listdevices-shared - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - endif() endif () if (UPNPC_BUILD_TESTS)