update CMakeLists.txt

CMakeLists.txt: always includes minissdpc.c
This commit is contained in:
Thomas Bernard 2021-08-12 23:39:18 +02:00
parent 92b1c8198d
commit 4975eeabe2
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF

View File

@ -56,27 +56,23 @@ configure_file (${CMAKE_CURRENT_SOURCE_DIR}/miniupnpcstrings.h.cmake ${CMAKE_CUR
target_include_directories(miniupnpc-private INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) target_include_directories(miniupnpc-private INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
set (MINIUPNPC_SOURCES set (MINIUPNPC_SOURCES
igd_desc_parse.c src/igd_desc_parse.c
miniupnpc.c src/miniupnpc.c
minixml.c src/minixml.c
minisoap.c src/minisoap.c
minissdpc.c src/minissdpc.c
miniwget.c src/miniwget.c
upnpcommands.c src/upnpcommands.c
upnpdev.c src/upnpdev.c
upnpreplyparse.c src/upnpreplyparse.c
upnperrors.c src/upnperrors.c
connecthostport.c src/connecthostport.c
portlistingparse.c src/portlistingparse.c
receivedata.c src/receivedata.c
addr_is_reserved.c src/addr_is_reserved.c
${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h ${CMAKE_CURRENT_BINARY_DIR}/miniupnpcstrings.h
) )
if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "AmigaOS")
set (MINIUPNPC_SOURCES ${MINIUPNPC_SOURCES} minissdpc.c)
endif ()
if (WIN32) if (WIN32)
target_link_libraries(miniupnpc-private INTERFACE ws2_32 iphlpapi) target_link_libraries(miniupnpc-private INTERFACE ws2_32 iphlpapi)
elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS") elseif (CMAKE_SYSTEM_NAME STREQUAL "SunOS")
@ -131,7 +127,7 @@ if (UPNPC_BUILD_STATIC)
endif() endif()
if (UPNPC_BUILD_SAMPLE) if (UPNPC_BUILD_SAMPLE)
add_executable (upnpc-static upnpc.c) add_executable (upnpc-static src/upnpc.c)
target_link_libraries (upnpc-static PRIVATE libminiupnpc-static) target_link_libraries (upnpc-static PRIVATE libminiupnpc-static)
target_include_directories(upnpc-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(upnpc-static PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
endif () endif ()
@ -168,12 +164,12 @@ if (UPNPC_BUILD_SHARED)
endif() endif()
if (UPNPC_BUILD_SAMPLE) if (UPNPC_BUILD_SAMPLE)
add_executable (upnpc-shared upnpc.c) add_executable (upnpc-shared src/upnpc.c)
target_link_libraries (upnpc-shared PRIVATE libminiupnpc-shared) target_link_libraries (upnpc-shared PRIVATE libminiupnpc-shared)
target_include_directories(upnpc-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(upnpc-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
endif () endif ()
add_executable (listdevices listdevices.c) add_executable (listdevices src/listdevices.c)
target_link_libraries (listdevices PRIVATE libminiupnpc-shared) target_link_libraries (listdevices PRIVATE libminiupnpc-shared)
target_include_directories(listdevices PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(listdevices PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
endif () endif ()
@ -183,40 +179,40 @@ if (UPNPC_BUILD_TESTS)
target_link_libraries(miniupnpc-tests INTERFACE miniupnpc-private) target_link_libraries(miniupnpc-tests INTERFACE miniupnpc-private)
target_compile_definitions(miniupnpc-tests INTERFACE MINIUPNP_STATICLIB) target_compile_definitions(miniupnpc-tests INTERFACE MINIUPNP_STATICLIB)
add_executable (testminixml testminixml.c minixml.c igd_desc_parse.c) add_executable (testminixml src/testminixml.c src/minixml.c src/igd_desc_parse.c)
target_include_directories (testminixml PRIVATE target_include_directories (testminixml PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries (testminixml PRIVATE miniupnpc-tests) target_link_libraries (testminixml PRIVATE miniupnpc-tests)
add_executable (minixmlvalid minixmlvalid.c minixml.c) add_executable (minixmlvalid src/minixmlvalid.c src/minixml.c)
target_link_libraries (minixmlvalid PRIVATE miniupnpc-tests) target_link_libraries (minixmlvalid PRIVATE miniupnpc-tests)
add_executable (testupnpreplyparse testupnpreplyparse.c add_executable (testupnpreplyparse src/testupnpreplyparse.c
minixml.c upnpreplyparse.c) src/minixml.c src/upnpreplyparse.c)
target_include_directories (testupnpreplyparse PRIVATE target_include_directories (testupnpreplyparse PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries (testupnpreplyparse PRIVATE miniupnpc-tests) target_link_libraries (testupnpreplyparse PRIVATE miniupnpc-tests)
add_executable (testigddescparse testigddescparse.c add_executable (testigddescparse src/testigddescparse.c
igd_desc_parse.c minixml.c miniupnpc.c miniwget.c minissdpc.c src/igd_desc_parse.c src/minixml.c src/miniupnpc.c src/miniwget.c src/minissdpc.c
upnpcommands.c upnpreplyparse.c minisoap.c connecthostport.c src/upnpcommands.c src/upnpreplyparse.c src/minisoap.c src/connecthostport.c
portlistingparse.c receivedata.c addr_is_reserved.c src/portlistingparse.c src/receivedata.c src/addr_is_reserved.c
) )
target_include_directories (testigddescparse PRIVATE target_include_directories (testigddescparse PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries (testigddescparse PRIVATE miniupnpc-tests) target_link_libraries (testigddescparse PRIVATE miniupnpc-tests)
add_executable (testminiwget testminiwget.c add_executable (testminiwget src/testminiwget.c
miniwget.c miniupnpc.c minisoap.c upnpcommands.c minissdpc.c src/miniwget.c src/miniupnpc.c src/minisoap.c src/upnpcommands.c src/minissdpc.c
upnpreplyparse.c minixml.c igd_desc_parse.c connecthostport.c src/upnpreplyparse.c src/minixml.c src/igd_desc_parse.c src/connecthostport.c
portlistingparse.c receivedata.c addr_is_reserved.c src/portlistingparse.c src/receivedata.c src/addr_is_reserved.c
) )
target_include_directories (testminiwget PRIVATE target_include_directories (testminiwget PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries (testminiwget PRIVATE miniupnpc-tests) target_link_libraries (testminiwget PRIVATE miniupnpc-tests)
add_executable (testaddr_is_reserved testaddr_is_reserved.c add_executable (testaddr_is_reserved src/testaddr_is_reserved.c
addr_is_reserved.c src/addr_is_reserved.c
) )
target_link_libraries (testaddr_is_reserved PRIVATE miniupnpc-tests) target_link_libraries (testaddr_is_reserved PRIVATE miniupnpc-tests)