Fix build with tunnel support when compiling with CMake.

This commit is contained in:
Ghislain MARY 2014-09-30 11:15:58 +02:00
parent 2479a567a5
commit b1efcd8cfc
2 changed files with 15 additions and 1 deletions

View file

@ -61,6 +61,13 @@ endif()
find_package(BelleSIP REQUIRED)
find_package(MS2 REQUIRED)
find_package(XML2 REQUIRED)
if(ENABLE_TUNNEL)
find_package(Tunnel)
if(NOT TUNNEL_FOUND)
message(WARNING "Could not find the tunnel library!")
set(ENABLE_TUNNEL OFF CACHE BOOL "Enable tunnel support" FORCE)
endif()
endif()
include_directories(
@ -72,6 +79,9 @@ include_directories(
${MS2_INCLUDE_DIRS}
${XML2_INCLUDE_DIRS}
)
if(ENABLE_TUNNEL)
include_directories(${TUNNEL_INCLUDE_DIRS})
endif()
if(MSVC)
include_directories(${CMAKE_PREFIX_PATH}/include/MSVC)

View file

@ -53,7 +53,6 @@ set(SOURCE_FILES
info.c
linphonecall.c
linphonecore.c
linphone_tunnel_stubs.c
linphone_tunnel_config.c
lpconfig.c
lsd.c
@ -89,6 +88,8 @@ if(ENABLE_TUNNEL)
TunnelManager.cc
)
add_definitions(-DTUNNEL_ENABLED)
else()
list(APPEND SOURCE_FILES linphone_tunnel_stubs.c)
endif()
set(GENERATED_SOURCE_FILES
@ -116,6 +117,9 @@ set(LIBS
${MS2_LIBRARIES}
${XML2_LIBRARIES}
)
if(ENABLE_TUNNEL)
list(APPEND LIBS ${TUNNEL_LIBRARIES})
endif()
if(WIN32)
list(APPEND LIBS shlwapi)
endif()