PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

/thirdparty/libportfwd/CMakeLists.txt

http://github.com/tomahawk-player/tomahawk
CMake | 58 lines | 36 code | 9 blank | 13 comment | 1 complexity | e7c81f048993dacfaec0e6cf67f7adb4 MD5 | raw file
 1PROJECT(libportfwd)
 2CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
 3SET(CMAKE_VERBOSE_MAKEFILE ON)
 4#SET(CMAKE_INSTALL_PREFIX ".")
 5
 6SET(MINIUPNP_DIR    "third-party/miniupnpc-1.6/")
 7SET(NATPMP_DIR      "third-party/libnatpmp-20100808")
 8
 9ADD_DEFINITIONS(-Wall -O2 -DNDEBUG)
10IF(WIN32)
11	ADD_DEFINITIONS(-DWIN32 )
12ELSE()
13	ADD_DEFINITIONS(-fPIC)
14ENDIF()
15INCLUDE_DIRECTORIES( ${MINIUPNP_DIR} include ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS} )
16SET( CMAKE_C_FLAGS ${CLEAN_C_FLAGS} )
17
18ADD_DEFINITIONS( -DPORTFWDDLLEXPORT_STATIC -DSTATICLIB )
19if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
20  ADD_DEFINITIONS( -DMACOSX -D_DARWIN_C_SOURCE )
21endif ()
22
23ADD_LIBRARY(tomahawk_portfwd STATIC
24        # the needed bits of miniupnpc (no python module, no tests, no cli)
25        ${MINIUPNP_DIR}/connecthostport.c
26        ${MINIUPNP_DIR}/igd_desc_parse.c
27        ${MINIUPNP_DIR}/minisoap.c
28        ${MINIUPNP_DIR}/minissdpc.c
29        ${MINIUPNP_DIR}/miniupnpc.c
30        ${MINIUPNP_DIR}/miniwget.c
31        ${MINIUPNP_DIR}/minixml.c
32        ${MINIUPNP_DIR}/minixmlvalid.c
33        ${MINIUPNP_DIR}/portlistingparse.c
34        ${MINIUPNP_DIR}/receivedata.c
35        #${MINIUPNP_DIR}/minixmlvalid.c - contains main() like upnp.c, so building a shared lib fails
36        #${MINIUPNP_DIR}/upnpc.c
37        ${MINIUPNP_DIR}/upnpcommands.c
38        ${MINIUPNP_DIR}/upnperrors.c
39        ${MINIUPNP_DIR}/upnpreplyparse.c
40
41        # Our wrapper:
42        src/portfwd.cpp
43)
44
45IF(WIN32)
46	TARGET_LINK_LIBRARIES( tomahawk_portfwd "ws2_32.dll" "iphlpapi.a" )
47ENDIF()
48
49#INSTALL(FILES include/portfwd/portfwddllmacro.h include/portfwd/portfwd.h DESTINATION include/portfwd)
50
51#ADD_EXECUTABLE(portfwd-demo
52#               src/main.cpp
53#              )
54#TARGET_LINK_LIBRARIES(portfwd-demo portfwd)
55
56#INSTALL(TARGETS portfwd ARCHIVE DESTINATION lib${LIB_SUFFIX})
57#INSTALL(TARGETS portfwd-demo RUNTIME DESTINATION bin)
58#INSTALL(DIRECTORY include/portfwd DESTINATION include PATTERN "*~" EXCLUDE)