1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-02 10:24:01 +02:00

Build portfwd dynamically

This commit is contained in:
Dominik Schmidt
2011-05-21 12:12:07 +02:00
parent 8dc7bca9dd
commit 864dc8d096
6 changed files with 59 additions and 14 deletions

View File

@@ -6,9 +6,6 @@ SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(MINIUPNP_DIR "third-party/miniupnpc-1.4.20100609/")
SET(NATPMP_DIR "third-party/libnatpmp-20100202")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
ADD_DEFINITIONS(-Wall -O2 -DNDEBUG)
IF(WIN32)
ADD_DEFINITIONS(-DWIN32 -DMINIUPNP_EXPORTS )
@@ -16,10 +13,11 @@ ELSE()
ADD_DEFINITIONS(-fPIC)
ENDIF()
INCLUDE_DIRECTORIES(${MINIUPNP_DIR} include)
SET( CMAKE_C_FLAGS ${CLEAN_C_FLAGS} )
ADD_LIBRARY(portfwd STATIC
ADD_DEFINITIONS( -DPORTFWDDLLEXPORT_PRO )
ADD_LIBRARY(tomahawk_portfwd SHARED
# the needed bits of miniupnpc (no python module, no tests, no cli)
${MINIUPNP_DIR}/connecthostport.c
@@ -29,8 +27,8 @@ ADD_LIBRARY(portfwd STATIC
${MINIUPNP_DIR}/miniupnpc.c
${MINIUPNP_DIR}/miniwget.c
${MINIUPNP_DIR}/minixml.c
${MINIUPNP_DIR}/minixmlvalid.c
${MINIUPNP_DIR}/upnpc.c
#${MINIUPNP_DIR}/minixmlvalid.c - contains main() like upnp.c, so building a shared lib fails
#${MINIUPNP_DIR}/upnpc.c
${MINIUPNP_DIR}/upnpcommands.c
${MINIUPNP_DIR}/upnperrors.c
${MINIUPNP_DIR}/upnpreplyparse.c
@@ -40,9 +38,17 @@ ADD_LIBRARY(portfwd STATIC
)
IF(WIN32)
TARGET_LINK_LIBRARIES( portfwd "ws2_32.dll" "iphlpapi.a" )
TARGET_LINK_LIBRARIES( tomahawk_portfwd "ws2_32.dll" "iphlpapi.a" )
ENDIF()
INSTALL( TARGETS tomahawk_portfwd
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
BUNDLE DESTINATION library
)
#INSTALL(FILES include/portfwd/portfwddllmacro.h include/portfwd/portfwd.h DESTINATION include/portfwd)
#ADD_EXECUTABLE(portfwd-demo
# src/main.cpp
# )