This commit is contained in:
Andrei Astafev 2022-10-14 17:50:39 +03:00
parent 48377e27ec
commit e87e190cd3
7 changed files with 28 additions and 18 deletions

View File

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

View File

@ -1,6 +1,8 @@
include_guard(GLOBAL)
function(myx_create_packages NAME)
function(myx_create_packages TARGET_NAME)
myx_skip_external_target(${TARGET_NAME})
set(options)
set(oneValueArgs DEBIAN_PACKAGE_TYPE CPACK_DEBIAN_PACKAGE_SECTION CPACK_DEBIAN_PACKAGE_PRIORITY
CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CPACK_PACKAGE_CONTACT)
@ -9,20 +11,28 @@ function(myx_create_packages NAME)
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Общие настройки для пакета: организация, автор, версия
if(NOT ${PROJECT_NAME}_VENDOR)
set(CPACK_PACKAGE_VENDOR "unknown vendor")
myx_message_warning("\${PROJECT_NAME}_VENDOR variable is required for packaging but unset")
else()
set(CPACK_PACKAGE_VENDOR ${${PROJECT_NAME}_VENDOR})
endif()
if(NOT ${PROJECT_NAME}_CONTACT)
set(CPACK_PACKAGE_CONTACT "unknown maintainer <nonexistent@mailbox")
myx_message_warning("\${PROJECT_NAME}_CONTACT variable is required for packaging but unset")
if(${PROJECT_NAME}_AUTHOR AND ${PROJECT_NAME}_EMAIL)
set(CPACK_PACKAGE_CONTACT "${${PROJECT_NAME}_AUTHOR} <${${PROJECT_NAME}_EMAIL}>")
else()
set(CPACK_PACKAGE_CONTACT "unknown maintainer <nonexistent@mailbox>")
myx_message_warning("\${PROJECT_NAME}_CONTACT variable is required for packaging but unset")
endif()
else()
set(CPACK_PACKAGE_CONTACT ${${PROJECT_NAME}_CONTACT})
endif()
if(NOT ${PROJECT_NAME}_VENDOR)
if(${PROJECT_NAME}_AUTHOR)
set(CPACK_PACKAGE_VENDOR "${${PROJECT_NAME}_AUTHOR}")
else()
set(CPACK_PACKAGE_VENDOR "unknown vendor")
myx_message_warning("\${PROJECT_NAME}_VENDOR variable is required for packaging but unset")
endif()
else()
set(CPACK_PACKAGE_VENDOR ${${PROJECT_NAME}_VENDOR})
endif()
string(TOLOWER ${PROJECT_NAME} PN)
set(CPACK_PACKAGE_NAME ${PN})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
@ -171,7 +181,7 @@ function(myx_create_packages NAME)
if(UNIX AND NOT TARGET deb)
add_custom_target(deb WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND cpack -G DEB)
add_dependencies(deb ${NAME})
add_dependencies(deb ${TARGET_NAME})
endif()
endif()

View File

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

View File

@ -1 +1 @@
2.0.19
2.0.20

View File

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

2
debian/changelog vendored
View File

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

View File

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