From 4447b134e223b0269d9643a50e272f47b81ac198 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 1 Oct 2022 16:51:41 +0300 Subject: [PATCH] update --- CMakeLists.txt | 2 +- cmake/myx/MyxCMakeConfigVersion.cmake | 2 +- cmake/myx/lib/InstallLibrary.cmake | 64 +++++++++++++-------------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 220dd5e..45d8c0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/cmake/myx/MyxCMakeConfigVersion.cmake b/cmake/myx/MyxCMakeConfigVersion.cmake index c3b26c6..29f425e 100644 --- a/cmake/myx/MyxCMakeConfigVersion.cmake +++ b/cmake/myx/MyxCMakeConfigVersion.cmake @@ -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() diff --git a/cmake/myx/lib/InstallLibrary.cmake b/cmake/myx/lib/InstallLibrary.cmake index b1b94af..c623b74 100644 --- a/cmake/myx/lib/InstallLibrary.cmake +++ b/cmake/myx/lib/InstallLibrary.cmake @@ -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()