This commit is contained in:
Andrei Astafev 2022-10-01 17:02:49 +03:00
parent a2a5277839
commit 8d2dbfec22

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}
@ -30,8 +32,6 @@ function(myx_install_library NAME)
COMPONENT dev
)
get_target_property(type ${NAME} TYPE)
install(EXPORT ${NAME}Targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NAME}
COMPONENT dev
@ -45,12 +45,12 @@ function(myx_install_library NAME)
COMPONENT dev
)
if(${type} STREQUAL "OBJECT_LIBRARY")
if(TARGET ${NAME}_shared)
install(
TARGETS ${NAME}_shared
EXPORT ${NAME}Targets
LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
@ -59,11 +59,11 @@ function(myx_install_library NAME)
install(
TARGETS ${NAME}_static
EXPORT ${NAME}Targets
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
endif()
if(${type} STREQUAL "INTERFACE_LIBRARY")
install(
@ -72,5 +72,4 @@ function(myx_install_library NAME)
COMPONENT lib
)
endif()
endfunction()