diff --git a/MyxCMake/MyxCMakeConfigVersion.cmake b/MyxCMake/MyxCMakeConfigVersion.cmake index 0534278..a310e06 100644 --- a/MyxCMake/MyxCMakeConfigVersion.cmake +++ b/MyxCMake/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.3.5") +set(MYX_CMAKE_PACKAGE_VERSION "2.3.7") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/MyxCMake/lib/AddInterfaceLibrary.cmake b/MyxCMake/lib/AddInterfaceLibrary.cmake index acc202f..106e5a5 100644 --- a/MyxCMake/lib/AddInterfaceLibrary.cmake +++ b/MyxCMake/lib/AddInterfaceLibrary.cmake @@ -8,14 +8,10 @@ myx_add_interface_library [ PACKAGES packages ] | [ LINK_LIBRARIES link_libraries ] | [ OUTPUT_NAME output_name ] | - [ EXPORT_FILE_NAME file_name ] | - [ EXPORT_BASE_NAME base_name ] | [ HEADERS headers ]) Обязательные параметры: `TARGET_NAME` - имя библиотеки. Параметр `OUTPUT_NAME` определяет базовое имя выходных файлов. -Параметр `EXPORT_FILE_NAME` задаёт имя заголовочного файла экспортируемых -переменных, а `EXPORT_BASE_NAME` - базовый суффикс для формирования имён переменных. Все остальные параметры передаются в стандартную функцию `add_library()` #]=======================================================================] @@ -23,7 +19,6 @@ myx_add_interface_library include_guard(GLOBAL) include(CMakePackageConfigHelpers) -include(GenerateExportHeader) if(${CMAKE_VERSION} VERSION_LESS "3.17.0") set(MYX_CMAKE_LIB_DIR_BACKPORT "${CMAKE_CURRENT_LIST_DIR}") diff --git a/MyxCMake/lib/AddObjectLibrary.cmake b/MyxCMake/lib/AddObjectLibrary.cmake index 27de4b7..58b16bf 100644 --- a/MyxCMake/lib/AddObjectLibrary.cmake +++ b/MyxCMake/lib/AddObjectLibrary.cmake @@ -6,11 +6,13 @@ myx_add_object_library myx_add_object_library(TARGET_NAME [ OUTPUT_NAME output_name ] | + [ NO_EXPORT ] | [ EXPORT_FILE_NAME file_name ] | [ EXPORT_BASE_NAME base_name ]) Обязательные параметры: `TARGET_NAME` - имя библиотеки. Параметр `OUTPUT_NAME` определяет базовое имя выходных файлов. +Если указана опция `NO_EXPORT`, то файл экспорта не генерируется. Параметр `EXPORT_FILE_NAME` задаёт имя заголовочного файла экспортируемых переменных, а `EXPORT_BASE_NAME` - базовый суффикс для формирования имён переменных. Все остальные параметры передаются в стандартную функцию `add_library()` @@ -29,9 +31,8 @@ function(myx_add_object_library TARGET_NAME) endif() include(CMakePackageConfigHelpers) - include(GenerateExportHeader) - set(options) + set(options NO_EXPORT) set(oneValueArgs OUTPUT_NAME EXPORT_FILE_NAME EXPORT_BASE_NAME) set(multiValueArgs) cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -64,25 +65,28 @@ function(myx_add_object_library TARGET_NAME) # для создания динамической библиотеки set_target_properties(${TARGET_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) - if(NOT EXPORT_BASE_NAME) - set(ARG_EXPORT_BASE_NAME ${__project_name_upper}) - endif() + if(NOT ARG_NO_EXPORT) + include(GenerateExportHeader) + if(NOT EXPORT_BASE_NAME) + set(ARG_EXPORT_BASE_NAME ${__project_name_upper}) + endif() - if(NOT ARG_EXPORT_FILE_NAME) - set(ARG_EXPORT_FILE_NAME "${PROJECT_SOURCE_DIR}/include/${TARGET_NAME}/${TARGET_NAME}_export.hpp") - endif() + if(NOT ARG_EXPORT_FILE_NAME) + set(ARG_EXPORT_FILE_NAME "${PROJECT_SOURCE_DIR}/include/${TARGET_NAME}/${TARGET_NAME}_export.hpp") + endif() - generate_export_header(${TARGET_NAME} - BASE_NAME ${ARG_EXPORT_BASE_NAME} - EXPORT_MACRO_NAME "EXPORT_${ARG_EXPORT_BASE_NAME}" - DEPRECATED_MACRO_NAME "DEPRECATED_${ARG_EXPORT_BASE_NAME}" - NO_DEPRECATED_MACRO_NAME "NO_DEPRECATED_${ARG_EXPORT_BASE_NAME}" - NO_EXPORT_MACRO_NAME "NO_EXPORT_${ARG_EXPORT_BASE_NAME}" - STATIC_DEFINE "STATIC_DEFINE_${ARG_EXPORT_BASE_NAME}" - EXPORT_FILE_NAME ${ARG_EXPORT_FILE_NAME} - DEFINE_NO_DEPRECATED - ) - set_property(TARGET ${TARGET_NAME} APPEND PROPERTY INTERFACE_HEADER_FILES "${ARG_EXPORT_FILE_NAME}") + generate_export_header(${TARGET_NAME} + BASE_NAME ${ARG_EXPORT_BASE_NAME} + EXPORT_MACRO_NAME "EXPORT_${ARG_EXPORT_BASE_NAME}" + DEPRECATED_MACRO_NAME "DEPRECATED_${ARG_EXPORT_BASE_NAME}" + NO_DEPRECATED_MACRO_NAME "NO_DEPRECATED_${ARG_EXPORT_BASE_NAME}" + NO_EXPORT_MACRO_NAME "NO_EXPORT_${ARG_EXPORT_BASE_NAME}" + STATIC_DEFINE "STATIC_DEFINE_${ARG_EXPORT_BASE_NAME}" + EXPORT_FILE_NAME ${ARG_EXPORT_FILE_NAME} + DEFINE_NO_DEPRECATED + ) + set_property(TARGET ${TARGET_NAME} APPEND PROPERTY INTERFACE_HEADER_FILES "${ARG_EXPORT_FILE_NAME}") + endif() # Цель для создания динамической библиотеки из объектных файлов if(${__project_name_upper}_BUILD_SHARED) diff --git a/README.md b/README.md index 291ad54..8a0b5f3 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Установка В корневом каталоге проекта создать каталог `cmake` и распаковать в него -[архив](../../../releases/download/2.3.5/myx-cmake-local-2.3.5.tar.xz ). +[архив](../../../releases/download/2.3.7/myx-cmake-local-2.3.7.tar.xz ). ## Использование diff --git a/VERSION b/VERSION index cc6c9a4..00355e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3.5 +2.3.7 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index 930b8c1..ba12b0d 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.6 FATAL_ERROR) -project(myx-cmake VERSION 2.3.5 LANGUAGES) +project(myx-cmake VERSION 2.3.7 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/debian/changelog b/debian/changelog index 43ba6b2..5ac2625 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myx-cmake (2.3.5) unstable; urgency=medium +myx-cmake (2.3.7) unstable; urgency=medium * New version. diff --git a/myx_setup.cmake b/myx_setup.cmake index d9536f5..75a8fc6 100644 --- a/myx_setup.cmake +++ b/myx_setup.cmake @@ -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.3.5 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.3.7 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.3.5 REQUIRED) + find_package(MyxCMake 2.3.7 REQUIRED) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)