Обновление

This commit is contained in:
Andrei Astafev 2022-10-01 17:02:15 +03:00
parent 547ed6d0f1
commit d61dde9ed2

View File

@ -11,6 +11,8 @@ function(myx_install_library NAME)
return()
endif()
get_target_property(type ${NAME} TYPE)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${NAME}ConfigVersion.cmake
VERSION ${PROJECT_VERSION}
@ -43,22 +45,30 @@ function(myx_install_library NAME)
COMPONENT dev
)
if(TARGET ${NAME}_shared)
install(
TARGETS ${NAME}_shared
EXPORT ${NAME}Targets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
if(${type} STREQUAL "OBJECT_LIBRARY")
if(TARGET ${NAME}_shared)
install(
TARGETS ${NAME}_shared
EXPORT ${NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
if(TARGET ${NAME}_static)
install(
TARGETS ${NAME}_static
EXPORT ${NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
endif()
if(TARGET ${NAME}_static)
if(${type} STREQUAL "INTERFACE_LIBRARY")
install(
TARGETS ${NAME}_static
TARGETS ${NAME}
EXPORT ${NAME}Targets
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()