1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

fix installing shared Boost libraries

This commit is contained in:
Andrey Filipenkov 2022-07-27 12:18:43 +03:00
parent 2d3002bc1d
commit 0a1f824add

View File

@ -516,7 +516,21 @@ macro(add_main_lib TARGET_NAME LIBRARY_TYPE)
else()
set(LINKED_LIB_REAL ${LINKED_LIB})
endif()
install(TARGETS ${LINKED_LIB_REAL} LIBRARY DESTINATION ${LIB_DIR} COMPONENT core)
get_target_property(_imported ${LINKED_LIB_REAL} IMPORTED)
if(_imported)
set(INSTALL_TYPE IMPORTED_RUNTIME_ARTIFACTS)
get_target_property(BOOST_DEPENDENCIES ${LINKED_LIB_REAL} INTERFACE_LINK_LIBRARIES)
foreach(BOOST_DEPENDENCY IN LISTS BOOST_DEPENDENCIES)
get_target_property(BOOST_DEPENDENCY_TYPE ${BOOST_DEPENDENCY} TYPE)
if(BOOST_DEPENDENCY_TYPE STREQUAL "SHARED_LIBRARY")
install(IMPORTED_RUNTIME_ARTIFACTS ${BOOST_DEPENDENCY} LIBRARY DESTINATION ${LIB_DIR} COMPONENT core)
endif()
endforeach()
else()
set(INSTALL_TYPE TARGETS)
endif()
install(${INSTALL_TYPE} ${LINKED_LIB_REAL} LIBRARY DESTINATION ${LIB_DIR} COMPONENT core)
endforeach()
endif()
endmacro()