Commit 4561ff06 authored by Ghislain MARY's avatar Ghislain MARY

Define MEDIASTREAMER2_CPPFLAGS and MEDIASTREAMER2_LDFLAGS when searching for...

Define MEDIASTREAMER2_CPPFLAGS and MEDIASTREAMER2_LDFLAGS when searching for mediastreamer2 with CMake.
parent 9c50bbd0
......@@ -369,13 +369,13 @@ else()
set(PACKAGE_PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share")
endif()
set(LINK_FLAGS "")
if(APPLE)
set(APPLE_SPECIFIC_LINK_FLAGS )
if(ENABLE_VIDEO)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore" "-framework QTKit")
set(LINK_FLAGS "${LINK_FLAGS} -framework Cocoa -framework OpenGL -framework QuartzCore -framework QTKit")
endif()
if(ENABLE_MACSND)
list(APPEND APPLE_SPECIFIC_LINK_FLAGS "-framework Carbon" "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices")
set(LINK_FLAGS "${LINK_FLAGS} -framework Carbon -framework AudioUnit -framework CoreAudio -framework CoreServices")
endif()
set(PLUGINS_EXT ".dylib")
add_definitions(-DTARGET_OS_MAC=1)
......
......@@ -26,6 +26,7 @@
# MEDIASTREAMER2_FOUND - system has mediastreamer2
# MEDIASTREAMER2_INCLUDE_DIRS - the mediastreamer2 include directory
# MEDIASTREAMER2_LIBRARIES - The libraries needed to use mediastreamer2
# MEDIASTREAMER2_CPPFLAGS - The compilation flags needed to use mediastreamer2
# MEDIASTREAMER2_LDFLAGS - The linking flags needed to use mediastreamer2
include("${CMAKE_CURRENT_LIST_DIR}/Mediastreamer2Targets.cmake")
......@@ -43,4 +44,6 @@ if(BZRTP_FOUND)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${BZRTP_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${BZRTP_LIBRARIES})
endif()
set(MEDIASTREAMER2_CPPFLAGS "${ORTP_CPPFLAGS}")
set(MEDIASTREAMER2_LDFLAGS @LINK_FLAGS@)
set(MEDIASTREAMER2_FOUND 1)
......@@ -411,9 +411,8 @@ else()
endif()
endif()
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})
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
endif()
install(TARGETS mediastreamer_voip EXPORT Mediastreamer2Targets
......
......@@ -42,7 +42,6 @@ endif()
add_executable(mediastreamer2_tester ${SOURCE_FILES})
target_include_directories(mediastreamer2_tester PUBLIC ${CUNIT_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester mediastreamer_voip mediastreamer_base ${CUNIT_LIBRARIES})
string(REPLACE ";" " " APPLE_SPECIFIC_LINK_FLAGS_STR "${APPLE_SPECIFIC_LINK_FLAGS}")
if(NOT "${APPLE_SPECIFIC_LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS ${APPLE_SPECIFIC_LINK_FLAGS_STR})
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
endif()
......@@ -43,7 +43,6 @@ if(APPLE)
endif()
add_executable(mediastream ${MEDIASTREAM_SOURCE_FILES})
target_link_libraries(mediastream mediastreamer_voip mediastreamer_base)
string(REPLACE ";" " " APPLE_SPECIFIC_LINK_FLAGS_STR "${APPLE_SPECIFIC_LINK_FLAGS}")
if(NOT "${APPLE_SPECIFIC_LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastream PROPERTIES LINK_FLAGS ${APPLE_SPECIFIC_LINK_FLAGS_STR})
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
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