Commit 782a7275 authored by Ghislain MARY's avatar Ghislain MARY

Fix CMake FindPackage when building statically in grouped mode.

parent ecc40cd8
......@@ -38,12 +38,20 @@ if(@ENABLE_SHARED@)
set(MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_TARGETNAME} mediastreamer_base)
else()
set(MEDIASTREAMER2_TARGETNAME mediastreamer_voip-static)
get_target_property(MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_TARGETNAME} LOCATION)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_TARGETNAME})
else()
get_target_property(MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_TARGETNAME} LOCATION)
endif()
get_target_property(MEDIASTREAMER2_LINK_LIBRARIES ${MEDIASTREAMER2_TARGETNAME} INTERFACE_LINK_LIBRARIES)
if(MEDIASTREAMER2_LINK_LIBRARIES)
list(APPEND MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_LINK_LIBRARIES})
list(REMOVE_ITEM MEDIASTREAMER2_LIBRARIES mediastreamer_base-static)
get_target_property(MEDIASTREAMER2_BASE_LIBRARIES mediastreamer_base-static LOCATION)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(MEDIASTREAMER2_BASE_LIBRARIES mediastreamer_base-static)
else()
get_target_property(MEDIASTREAMER2_BASE_LIBRARIES mediastreamer_base-static LOCATION)
endif()
list(APPEND MEDIASTREAMER2_LIBRARIES ${MEDIASTREAMER2_BASE_LIBRARIES})
endif()
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