Repair master SDK build by using find_library in Windows to select path file from SDK libraries

This commit is contained in:
Julien Wadel 2020-10-09 13:38:52 +02:00
parent 7421844dea
commit 039e581d90

View file

@ -427,7 +427,21 @@ endif()
set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" )
set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES})
set(LIBRARIES_LIST ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES})
if(WIN32)
set(LIBRARIES)
foreach(LIBRARY ${LIBRARIES_LIST})# Search for lib full path
find_library(FIND_LIBRARY_ITEM_${LIBRARY} NAMES ${LIBRARY} lib${LIBRARY} REQUIRED)#find_library need a specific variable name each time
if(FIND_LIBRARY_ITEM_${LIBRARY})
list(APPEND LIBRARIES ${FIND_LIBRARY_ITEM_${LIBRARY}})
else()
message(SEND_ERROR "${LIBRARY} not found!")
endif()
endforeach()
else()
set(LIBRARIES ${LIBRARIES_LIST})
endif()
if(ENABLE_BUILD_VERBOSE)
message("LIBRARIES : ${LIBRARIES}")