Вариант сборки, в котором функции объединены в один файл

This commit is contained in:
Andrei Astafev 2023-09-14 14:17:16 +03:00
parent 95ba4ba50a
commit acc54d4835
8 changed files with 58 additions and 8 deletions

View File

@ -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

View File

@ -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()

View File

@ -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 ).
## Использование

View File

@ -1 +1 @@
2.4.14
2.4.15

View File

@ -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

2
debian/changelog vendored
View File

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

38
myx-unity.py Normal file
View File

@ -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)

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.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)