Commit c30a0d81 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Simplify CMakeLists.txt.

parent f8685eec
cmake_minimum_required(VERSION 2.6)
project(BELLESIP C)
if(NOT ANTLR3_ROOT_DIR)
set(ANTLR3_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../antlr3)
endif()
if(NOT ANTLR3C_INCLUDE_DIR)
set(ANTLR3C_INCLUDE_DIR ${ANTLR3_ROOT_DIR}/runtime/C/include)
endif()
if(NOT POLARSSL_INCLUDE_DIR)
set(POLARSSL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../polarssl/include)
endif()
if(NOT ORTP_ROOT_DIR)
set(ORTP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../linphone/oRTP)
endif()
include_directories(
include/
${CMAKE_CURRENT_BINARY_DIR}/src/
src/
${CMAKE_INSTALL_PREFIX}/include
)
if(USE_INSTALLED_COMPONENTS)
include_directories(${CMAKE_INSTALL_PREFIX}/include)
else()
include_directories(
${ANTLR3C_INCLUDE_DIR}
${POLARSSL_INCLUDE_DIR}
)
if(WIN32)
include_directories(${ORTP_ROOT_DIR}/build/vsx/oRTP/oRTP/)
endif(WIN32)
endif()
add_subdirectory(include)
add_subdirectory(src)
if(INSTALL_COMPONENT_IN_POSTBUILD)
add_install_target(INSTALL_libbellesip COMP_libbellesip libbellesip)
endif()
file(GLOB HEADER_FILES "belle-sip/*.h")
install(FILES ${HEADER_FILES}
COMPONENT COMP_libbellesip
DESTINATION include/belle-sip
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
find_library(LIBANTLR3C NAMES antlr3c)
find_library(LIBPOLARSSL NAMES polarssl)
set(SDP_GENERATED_SOURCE_FILES
${CMAKE_CURRENT_BINARY_DIR}/belle_sdpLexer.c
${CMAKE_CURRENT_BINARY_DIR}/belle_sdpLexer.h
......@@ -70,31 +73,22 @@ add_definitions(
if(WIN32)
set(LIBS ws2_32)
endif(WIN32)
set(LIBS ${LIBS} libantlr3c libpolarssl)
set(LIBS ${LIBS} ${LIBANTLR3C} ${LIBPOLARSSL})
add_library(libbellesip SHARED ${SOURCE_FILES})
set_target_properties(libbellesip PROPERTIES VERSION 1.2.4 SOVERSION 1)
add_library(bellesip SHARED ${SOURCE_FILES})
set_target_properties(bellesip PROPERTIES VERSION 1.2.4 SOVERSION 1)
target_link_libraries(libbellesip ${LIBS})
target_link_libraries(bellesip ${LIBS})
install(TARGETS libbellesip
COMPONENT COMP_libbellesip
install(TARGETS bellesip
DESTINATION ${LIB_INSTALL_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
if(WIN32)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/libbellesip.pdb
COMPONENT COMP_libbellesip
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/bellesip.pdb
DESTINATION ${LIB_INSTALL_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
endif(WIN32)
if(USE_INSTALLED_COMPONENTS)
add_dependencies(libbellesip
INSTALL_libantlr3c
INSTALL_libpolarssl
INSTALL_libortp)
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment