This commit is contained in:
Andrei Astafev 2022-10-01 16:51:41 +03:00
parent f6ff19e9f5
commit 4447b134e2
3 changed files with 32 additions and 36 deletions

View File

@ -15,7 +15,7 @@ project(pow VERSION 1.1.1 LANGUAGES CXX)
# поиск версии в каталогах перечисленных в переменной `CMAKE_MODULES_DIR`.
###
if(MYX_CMAKE_USE_SYSTEM)
find_package(MyxCMake 1.99.9 NO_DEFAULT_PATH QUIET REQUIRED)
find_package(MyxCMake 1.99.10 NO_DEFAULT_PATH QUIET REQUIRED)
else()
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)
endif()

View File

@ -1,4 +1,4 @@
set(MYX_CMAKE_PACKAGE_VERSION "1.99.9")
set(MYX_CMAKE_PACKAGE_VERSION "1.99.10")
if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()

View File

@ -25,44 +25,12 @@ function(myx_install_library NAME)
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT dev
)
get_target_property(type ${NAME} TYPE)
if(type STREQUAL INTERFACE_LIBRARY)
install(
TARGETS ${NAME}
EXPORT ${NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
if(type STREQUAL OBJECT)
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()
install(
EXPORT ${NAME}Targets
install(EXPORT ${NAME}Targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${NAME}
COMPONENT dev
)
@ -75,4 +43,32 @@ 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
)
endif()
if(TARGET ${NAME}_static)
install(
TARGETS ${NAME}_static
EXPORT ${NAME}Targets
ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib
)
endif()
if(${type} STREQUAL "INTERFACE_LIBRARY")
install(
TARGETS ${NAME}
EXPORT ${NAME}Targets
COMPONENT lib
)
endif()
endfunction()