diff --git a/Makefile b/Makefile index 4478635..30bab50 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,10 @@ TOP_DIR:=$(shell pwd) BUILD_DIR:=$(TOP_DIR)/build DEB_DIR:=$(BUILD_DIR)/deb/myx-cmake-$(V) PACK_DIR:=$(BUILD_DIR)/pack/myx-cmake-$(V) +UNITY_DIR:=$(BUILD_DIR)/unity +UNITY_V_DIR:=$(BUILD_DIR)/myx-cmake-unity-$(V) -all: v deb pack +all: v deb pack unity v: sed -i "s/\/[0-9][0-9.]\+/\/$V/g" $(TOP_DIR)/README.md @@ -30,6 +32,15 @@ pack: cp -ap $(TOP_DIR)/myx_setup.cmake $(PACK_DIR) cd $(PACK_DIR); tar acf $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz * +unity: + rm -rf $(UNITY_DIR) + rm -rf $(UNITY_V_DIR) + mkdir -p $(UNITY_DIR) + python3 myx-unity.py > $(UNITY_DIR)/m.cmake + mv $(UNITY_DIR)/m.cmake $(UNITY_DIR)/myx/MyxCMakeConfig.cmake + mv $(UNITY_DIR) $(UNITY_V_DIR) + cd $(UNITY_V_DIR); tar acf $(BUILD_DIR)/myx-cmake-unity-$(V).tar.xz * + upload: git tag $(V) gitea-tea r c --repo cmake/myx -t $(V) --tag $(V) \ @@ -37,5 +48,6 @@ upload: -a $(BUILD_DIR)/myx-cmake_$(V).tar.xz \ -a $(BUILD_DIR)/myx-cmake_$(V)_all.deb \ -a $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz + -a $(BUILD_DIR)/myx-cmake-unity-$(V).tar.xz git tag -d $(V) git push diff --git a/MyxCMake/MyxCMakeConfigVersion.cmake b/MyxCMake/MyxCMakeConfigVersion.cmake index c432434..e6e5d65 100644 --- a/MyxCMake/MyxCMakeConfigVersion.cmake +++ b/MyxCMake/MyxCMakeConfigVersion.cmake @@ -1,4 +1,4 @@ -set(MYX_CMAKE_PACKAGE_VERSION "2.4.14") +set(MYX_CMAKE_PACKAGE_VERSION "2.4.15") if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() diff --git a/README.md b/README.md index 6022fbc..20f9ae9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Установка В корневом каталоге проекта создать каталог `cmake` и распаковать в него -[архив](../../../releases/download/2.4.14/myx-cmake-local-2.4.14.tar.xz ). +[архив](../../../releases/download/2.4.15/myx-cmake-local-2.4.15.tar.xz ). ## Использование diff --git a/VERSION b/VERSION index e5f3129..84cc65e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.4.14 +2.4.15 diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index ba7c116..6edc910 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.4.14 LANGUAGES) +project(myx-cmake VERSION 2.4.15 LANGUAGES) include(GNUInstallDirs) file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake diff --git a/debian/changelog b/debian/changelog index 440724e..82d19ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -myx-cmake (2.4.14) unstable; urgency=medium +myx-cmake (2.4.15) unstable; urgency=medium * New version. diff --git a/myx-unity.py b/myx-unity.py new file mode 100644 index 0000000..e2643d8 --- /dev/null +++ b/myx-unity.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +"""MyxCMake unity.""" + +import re +import os +from distutils.dir_util import copy_tree +from shutil import copyfile + +D1 = 'MyxCMake' +D2 = 'build/unity/myx' +copy_tree(D1, D2) +copyfile('myx_setup.cmake', 'build/unity/myx_setup.cmake') + +with open(D2 + '/MyxCMakeConfig.cmake', encoding='utf-8') as f: + lines = list(f) + for line in lines: + line = line.rstrip() + b1 = re.match('.*include.*_BACKPORTS_DIR}/(.*cmake)', line) + l1 = re.match('.*include.*_LIB_DIR}/(.*cmake)', line) + if b1: + fname = D2 + "/backports/" + b1.group(1) + with open(fname, encoding='utf-8') as g: + print(g.read()) + os.remove(fname) + elif l1: + if l1.group(1) in ['DownloadContent.cmake', + 'ProjectIsTopLevel.cmake', + 'generators/PrivateConfigHeader.cmake', + 'generators/GitInfoHeader.cmake']: + print(line) + continue + fname = D2 + "/lib/" + l1.group(1) + with open(fname, encoding='utf-8') as g: + print(g.read()) + os.remove(fname) + else: + print(line) diff --git a/myx_setup.cmake b/myx_setup.cmake index eb75f4b..a2b0831 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.4.14 REQUIRED CONFIG PATHS ${MYX_CMAKE_DIR} NO_DEFAULT_PATH) + find_package(MyxCMake 2.4.15 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.4.14 REQUIRED) + find_package(MyxCMake 2.4.15 REQUIRED) myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==") else() include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)