/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

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