From 7bb178b24da12b5e520e6ff7731eed93490461b6 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 8 Oct 2022 22:23:10 +0300 Subject: [PATCH] 2.0.10 --- MyxCMake/MyxCMakeConfigVersion.cmake | 2 +- MyxCMake/lib/CurrentDate.cmake | 4 +-- MyxCMake/lib/Qt5TargetSetup.cmake | 2 +- MyxCMake/lib/macro/SkipExternalTarget.cmake | 31 +++++++++++++++++---- README.md | 2 +- VERSION | 2 +- debian/CMakeLists.txt | 2 +- debian/changelog | 2 +- myx_setup.cmake | 4 +-- 9 files changed, 35 insertions(+), 16 deletions(-) diff --git a/MyxCMake/MyxCMakeConfigVersion.cmake b/MyxCMake/MyxCMakeConfigVersion.cmake index c804db4..05b6e4c 100644 --- a/MyxCMake/MyxCMakeConfigVersion.cmake +++ b/MyxCMake/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.0.9") +set(MYX_CMAKE_PACKAGE_VERSION "2.0.10") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/MyxCMake/lib/CurrentDate.cmake b/MyxCMake/lib/CurrentDate.cmake index b48038a..5ca3f84 100644 --- a/MyxCMake/lib/CurrentDate.cmake +++ b/MyxCMake/lib/CurrentDate.cmake @@ -1,7 +1,7 @@ include_guard(GLOBAL) if(NOT MYX_TODAY) - if(WIN32) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE MYX_TODAY) else() execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE MYX_TODAY) @@ -10,7 +10,7 @@ if(NOT MYX_TODAY) endif() if(NOT MYX_YEAR) - if(WIN32) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE MYX_YEAR) else() execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE MYX_YEAR) diff --git a/MyxCMake/lib/Qt5TargetSetup.cmake b/MyxCMake/lib/Qt5TargetSetup.cmake index 980d786..4a4cac6 100644 --- a/MyxCMake/lib/Qt5TargetSetup.cmake +++ b/MyxCMake/lib/Qt5TargetSetup.cmake @@ -73,7 +73,7 @@ function(myx_qt5_target_setup NAME) # и его компиляция в каталог ${PROJECT_BINARY_DIR} qt5_create_translation(qm ${tr} "${PROJECT_SOURCE_DIR}/l10n/${NAME}_${iter}.ts" - OPTIONS -I ${PROJECT_SOURCE_DIR}/include) + OPTIONS -I ${PROJECT_SOURCE_DIR}/include -I ${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}) # Добавление записи для скомпилированного файла переводов в ресурсный файл file(APPEND ${PROJECT_BINARY_DIR}/${NAME}_l10n.qrc "${NAME}_${iter}.qm\n") diff --git a/MyxCMake/lib/macro/SkipExternalTarget.cmake b/MyxCMake/lib/macro/SkipExternalTarget.cmake index 4996b92..aa286f0 100644 --- a/MyxCMake/lib/macro/SkipExternalTarget.cmake +++ b/MyxCMake/lib/macro/SkipExternalTarget.cmake @@ -2,13 +2,32 @@ include_guard(GLOBAL) # Пропуск целей, которые создаются автоматически в `CMAKE_BINARY_DIR` macro(myx_skip_external_target NAME) - get_target_property(__source_dir ${NAME} SOURCE_DIR) - string(FIND ${__source_dir} ${CMAKE_BINARY_DIR} __pos) - if(__pos EQUAL 0) + get_target_property(__type ${NAME} TYPE) + if(__type STREQUAL "INTERFACE_LIBRARY") + get_target_property(__sources ${NAME} INTERFACE_SOURCES) + foreach(iter ${_sources}) + string(FIND ${iter} ${CMAKE_BINARY_DIR} __pos) + if(__pos EQUAL 0) + unset(__type) + unset(__pos) + unset(__sources) + return() + endif() + endforeach() + unset(__type) + unset(__pos) + unset(__sources) + else() + get_target_property(__source_dir ${NAME} SOURCE_DIR) + string(FIND ${__source_dir} ${CMAKE_BINARY_DIR} __pos) + if(__pos EQUAL 0) + unset(__type) + unset(__pos) + unset(__source_dir) + return() + endif() unset(__pos) unset(__source_dir) - return() endif() - unset(__pos) - unset(__source_dir) + unset(__type) endmacro(myx_skip_external_target NAME) diff --git a/README.md b/README.md index 78dfd2c..3ff2f54 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Установка В корневом каталоге проекта создать каталог `cmake` и распаковать в него -[архив](../../../releases/download/2.0.9/myx-cmake-local-2.0.9.tar.xz ). +[архив](../../../releases/download/2.0.10/myx-cmake-local-2.0.10.tar.xz ). ## Использование diff --git a/VERSION b/VERSION index 09843e3..0a69206 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.9 +2.0.10 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index e9cd0bc..1ad0e0e 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.0.9 LANGUAGES) +project(myx-cmake VERSION 2.0.10 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/debian/changelog b/debian/changelog index 7c1972f..66f81ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myx-cmake (2.0.9) unstable; urgency=medium +myx-cmake (2.0.10) unstable; urgency=medium * New version. diff --git a/myx_setup.cmake b/myx_setup.cmake index 4b66806..110d461 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.0.9 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.0.10 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.9 REQUIRED) + find_package(MyxCMake 2.0.10 REQUIRED) myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)