Вариант сборки, в котором функции объединены в один файл
This commit is contained in:
parent
95ba4ba50a
commit
acc54d4835
14
Makefile
14
Makefile
@ -3,8 +3,10 @@ TOP_DIR:=$(shell pwd)
|
|||||||
BUILD_DIR:=$(TOP_DIR)/build
|
BUILD_DIR:=$(TOP_DIR)/build
|
||||||
DEB_DIR:=$(BUILD_DIR)/deb/myx-cmake-$(V)
|
DEB_DIR:=$(BUILD_DIR)/deb/myx-cmake-$(V)
|
||||||
PACK_DIR:=$(BUILD_DIR)/pack/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:
|
v:
|
||||||
sed -i "s/\/[0-9][0-9.]\+/\/$V/g" $(TOP_DIR)/README.md
|
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)
|
cp -ap $(TOP_DIR)/myx_setup.cmake $(PACK_DIR)
|
||||||
cd $(PACK_DIR); tar acf $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz *
|
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:
|
upload:
|
||||||
git tag $(V)
|
git tag $(V)
|
||||||
gitea-tea r c --repo cmake/myx -t $(V) --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).tar.xz \
|
||||||
-a $(BUILD_DIR)/myx-cmake_$(V)_all.deb \
|
-a $(BUILD_DIR)/myx-cmake_$(V)_all.deb \
|
||||||
-a $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz
|
-a $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz
|
||||||
|
-a $(BUILD_DIR)/myx-cmake-unity-$(V).tar.xz
|
||||||
git tag -d $(V)
|
git tag -d $(V)
|
||||||
git push
|
git push
|
||||||
|
@ -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)
|
if(MYX_CMAKE_PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||||
else()
|
else()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Установка
|
## Установка
|
||||||
|
|
||||||
В корневом каталоге проекта создать каталог `cmake` и распаковать в него
|
В корневом каталоге проекта создать каталог `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 ).
|
||||||
|
|
||||||
## Использование
|
## Использование
|
||||||
|
|
||||||
|
2
debian/CMakeLists.txt
vendored
2
debian/CMakeLists.txt
vendored
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
|
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)
|
include(GNUInstallDirs)
|
||||||
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake
|
||||||
|
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
myx-cmake (2.4.14) unstable; urgency=medium
|
myx-cmake (2.4.15) unstable; urgency=medium
|
||||||
|
|
||||||
* New version.
|
* New version.
|
||||||
|
|
||||||
|
38
myx-unity.py
Normal file
38
myx-unity.py
Normal 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)
|
@ -20,11 +20,11 @@ if(ENV{MYX_CMAKE_DIR})
|
|||||||
set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR})
|
set(MYX_CMAKE_DIR $ENV{MYX_CMAKE_DIR})
|
||||||
endif()
|
endif()
|
||||||
if(MYX_CMAKE_DIR)
|
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} ==")
|
myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==")
|
||||||
else()
|
else()
|
||||||
if(MYX_CMAKE_USE_SYSTEM)
|
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} ==")
|
myx_message_notice("== MyxCMake directory: ${MyxCMake_CONFIG} ==")
|
||||||
else()
|
else()
|
||||||
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)
|
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)
|
||||||
|
Loading…
Reference in New Issue
Block a user