Commit cc365769 authored by Ghislain MARY's avatar Ghislain MARY

Handle Apple specific link flags.

parent 705401c3
......@@ -318,6 +318,15 @@ else()
set(PACKAGE_PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share")
endif()
if(APPLE)
set(APPLE_SPECIFIC_LINK_FLAGS )
if(ENABLE_VIDEO)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore" "-framework QTKit")
endif()
if(ENABLE_MACSND)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Carbon" "-framework AudioUnit")
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/mediastreamer-config.h PROPERTIES GENERATED ON)
add_definitions(-DHAVE_CONFIG_H)
......
......@@ -26,6 +26,7 @@
# MS2_INCLUDE_DIRS - the mediastreamer2 include directory
# MS2_LIBRARIES - The libraries needed to use mediastreamer2
# MS2_CPPFLAGS - The compilation flags needed to use mediastreamer2
# MS2_LDFLAGS - The linking flags needed to use mediastreamer2
find_package(ORTP REQUIRED)
if(@ENABLE_GSM@)
......@@ -161,12 +162,14 @@ if(WIN32)
endif(WIN32)
list(REMOVE_DUPLICATES MS2_INCLUDE_DIRS)
list(REMOVE_DUPLICATES MS2_LIBRARIES)
set(MS2_CPPFLAGS ${ORTP_CPPFLAGS})
set(MS2_CPPFLAGS "${ORTP_CPPFLAGS}")
set(MS2_LDFLAGS "@APPLE_SPECIFIC_LINK_FLAGS@")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MS2
DEFAULT_MSG
MS2_INCLUDE_DIRS MS2_LIBRARIES MS2_BASE_LIBRARY MS2_VOIP_LIBRARY MS2_CPPFLAGS
MS2_INCLUDE_DIRS MS2_LIBRARIES MS2_BASE_LIBRARY MS2_VOIP_LIBRARY
)
mark_as_advanced(MS2_INCLUDE_DIRS MS2_LIBRARIES MS2_BASE_LIBRARY MS2_VOIP_LIBRARY MS2_CPPFLAGS)
mark_as_advanced(MS2_INCLUDE_DIRS MS2_LIBRARIES MS2_BASE_LIBRARY MS2_VOIP_LIBRARY MS2_CPPFLAGS MS2_LDFLAGS)
......@@ -394,17 +394,9 @@ else()
endif()
endif()
endif()
if(APPLE)
set(APPLE_SPECIFIC_LINK_FLAGS )
if(ENABLE_VIDEO)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore")
endif()
if(ENABLE_MACSND)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Carbon" "-framework AudioUnit")
endif()
if(APPLE_SPECIFIC_LINK_FLAGS)
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS ${APPLE_SPECIFIC_LINK_FLAGS})
endif()
string(REPLACE ";" " " APPLE_SPECIFIC_LINK_FLAGS_STR "${APPLE_SPECIFIC_LINK_FLAGS}")
if(NOT "${APPLE_SPECIFIC_LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS ${APPLE_SPECIFIC_LINK_FLAGS_STR})
endif()
install(TARGETS mediastreamer_voip
......
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