This commit is contained in:
Andrei Astafev 2024-03-12 10:00:35 +03:00
parent 013b61ab75
commit 9e5b642d3f
7 changed files with 15 additions and 18 deletions

View File

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

View File

@ -59,25 +59,22 @@ function(myx_add_interface_library TARGET_NAME)
if(ARG_LINK_LIBRARIES) if(ARG_LINK_LIBRARIES)
foreach(__lib ${ARG_LINK_LIBRARIES}) foreach(__lib ${ARG_LINK_LIBRARIES})
if(TARGET ${__lib}) if(TARGET ${__lib})
if(${CMAKE_VERSION} VERSION_GREATER "3.15.0") set(__exlib ${__lib})
target_link_libraries(${TARGET_NAME} INTERFACE ${__lib}) if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
install(
TARGETS ${__lib}
EXPORT ${TARGET_NAME}Targets
COMPONENT DEV)
else()
get_target_property(__target_type ${__lib} TYPE) get_target_property(__target_type ${__lib} TYPE)
if(__target_type STREQUAL "OBJECT_LIBRARY") if(__target_type STREQUAL "OBJECT_LIBRARY")
if(TARGET "${__lib}_static") if(TARGET "${__lib}_static")
target_link_libraries(${TARGET_NAME} INTERFACE "${__lib}_static") set(__exlib "${__lib}_static")
elseif(TARGET "${__lib}_shared") elseif(TARGET "${__lib}_shared")
target_link_libraries(${TARGET_NAME} INTERFACE "${__lib}_shared") set(__exlib "${__lib}_shared")
endif()
else()
target_link_libraries(${TARGET_NAME} INTERFACE ${__lib})
endif() endif()
endif() endif()
endif() endif()
target_link_libraries(${TARGET_NAME} INTERFACE ${__exlib})
# install(TARGETS ${__exlib}
# EXPORT ${TARGET_NAME}Targets
# COMPONENT DEV)
endif()
endforeach() endforeach()
endif() endif()

View File

@ -3,7 +3,7 @@
## Установка ## Установка
В корневом каталоге проекта создать каталог `cmake` и распаковать в него В корневом каталоге проекта создать каталог `cmake` и распаковать в него
[архив](../../../releases/download/2.4.25/myx-cmake-local-2.4.25.tar.xz ). [архив](../../../releases/download/2.4.26/myx-cmake-local-2.4.26.tar.xz ).
## Использование ## Использование

View File

@ -1 +1 @@
2.4.25 2.4.26

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR) cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(myx-cmake VERSION 2.4.25 LANGUAGES) project(myx-cmake VERSION 2.4.26 LANGUAGES)
include(GNUInstallDirs) include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
myx-cmake (2.4.25) unstable; urgency=medium myx-cmake (2.4.26) unstable; urgency=medium
* New version. * New version.

View File

@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR})
set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR}) set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR})
endif() endif()
if(MYX_CMAKE_DIR) if(MYX_CMAKE_DIR)
find_package(MyxCMake 2.4.25 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) find_package(MyxCMake 2.4.26 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH)
myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==")
else() else()
if(MYX_CMAKE_USE_SYSTEM) if(MYX_CMAKE_USE_SYSTEM)
find_package(MyxCMake 2.4.25 REQUIRED) find_package(MyxCMake 2.4.26 REQUIRED)
myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==")
else() else()
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake) include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)