Commit bef21a36 authored by Ghislain MARY's avatar Ghislain MARY

Fix MEDIASTREAMER2_CPPFLAGS and MEDIASTREAMER2_LDFLAGS with CMake.

parent 4561ff06
......@@ -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 "")
set(LINK_FLAGS )
if(APPLE)
if(ENABLE_VIDEO)
set(LINK_FLAGS "${LINK_FLAGS} -framework Cocoa -framework OpenGL -framework QuartzCore -framework QTKit")
list(APPEND LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore" "-framework QTKit")
endif()
if(ENABLE_MACSND)
set(LINK_FLAGS "${LINK_FLAGS} -framework Carbon -framework AudioUnit -framework CoreAudio -framework CoreServices")
list(APPEND LINK_FLAGS "-framework Carbon" "-framework AudioUnit" "-framework CoreAudio" "-framework CoreServices")
endif()
set(PLUGINS_EXT ".dylib")
add_definitions(-DTARGET_OS_MAC=1)
......
......@@ -44,6 +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_CPPFLAGS ${ORTP_CPPFLAGS})
set(MEDIASTREAMER2_LDFLAGS @LINK_FLAGS@)
set(MEDIASTREAMER2_FOUND 1)
......@@ -411,8 +411,9 @@ else()
endif()
endif()
endif()
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
install(TARGETS mediastreamer_voip EXPORT Mediastreamer2Targets
......
......@@ -42,6 +42,7 @@ 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})
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
......@@ -43,6 +43,7 @@ if(APPLE)
endif()
add_executable(mediastream ${MEDIASTREAM_SOURCE_FILES})
target_link_libraries(mediastream mediastreamer_voip mediastreamer_base)
if(NOT "${LINK_FLAGS}" STREQUAL "")
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(mediastream PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
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