This commit is contained in:
Andrei Astafev 2022-10-05 11:35:08 +03:00
parent 572b0be826
commit a061ebb7a9
36 changed files with 74 additions and 5 deletions

35
Makefile Normal file
View File

@ -0,0 +1,35 @@
V:=$(shell cat VERSION)
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)
all: update_version deb pack
update_version:
sed -i "s/CMake.*REQUIRED/CMake $V REQUIRED/" $(TOP_DIR)/README.md $(TOP_DIR)/myx_setup.cmake
sed -i "s/VERSION \".*\"/VERSION \"$V\"/" $(TOP_DIR)/MyxCMake/MyxCMakeConfigVersion.cmake
sed -i "s/VERSION .* LANG/VERSION $V LANG/" $(TOP_DIR)/debian/CMakeLists.txt
sed -i "s/(.*)/($(V))/" $(TOP_DIR)/debian/changelog
deb:
rm -rf $(DEB_DIR)
mkdir -p $(DEB_DIR)
cp -ap "$(TOP_DIR)/MyxCMake" "$(TOP_DIR)/debian" "$(DEB_DIR)"
cd $(DEB_DIR); debuild
mv $(BUILD_DIR)/deb/*deb $(BUILD_DIR)
mv $(BUILD_DIR)/deb/*dsc $(BUILD_DIR)
mv $(BUILD_DIR)/deb/*xz $(BUILD_DIR)
pack:
rm -rf $(PACK_DIR)
mkdir -p $(PACK_DIR)
cp -ap $(TOP_DIR)/MyxCMake $(PACK_DIR)/myx
cp -ap $(TOP_DIR)/myx_setup.cmake $(PACK_DIR)
cd $(PACK_DIR); tar acf $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz *
#cp -ap *.cmake lib backports "$D/myx-cmake-$V/MyxCMake"
#pushd "$D"
#tar Jcf "myx-cmake_${V}.orig.tar.xz" "myx-cmake-$V"
#popd

View File

@ -1 +1 @@
1.99.86 1.99.90

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.6) cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
project(myx-cmake VERSION 1.99.30 LANGUAGES) project(myx-cmake VERSION 1.99.88 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
View File

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

4
debian/rules vendored
View File

@ -3,6 +3,10 @@
%: %:
dh $@ --buildsystem=cmake dh $@ --buildsystem=cmake
override_dh_auto_configure:
cp -f debian/CMakeLists.txt CMakeLists.txt
dh_auto_configure
override_dh_fixperms: override_dh_fixperms:
dh_fixperms dh_fixperms
# find debian -name asan-wrapper -print0 | xargs -0 chmod +x # find debian -name asan-wrapper -print0 | xargs -0 chmod +x

View File

@ -1 +1 @@
3.0 (quilt) 3.0 (native)

30
myx_setup.cmake Normal file
View File

@ -0,0 +1,30 @@
#[=======================================================================[.rst:
Подключение дополнительных функций для CMake
По умолчанию предполагается использование версии MyxCMake,
файлы которой находятся в каталоге `cmake/myx` текущего проекта.
Для удобства разботки библиотеки MyxCMake можно указать путь
к её репозиторию с помощью переменной проекта CMake `MYX_CMAKE_DIR`
или переменной окружения `MYX_CMAKE_DIR`.
Если определена переменная `MYX_CMAKE_USE_SYSTEM`, то выполняется
поиск версии в каталогах перечисленных в переменной `CMAKE_MODULES_DIR`.
#]=======================================================================]
if(MYX_CMAKE_DIR)
set(ENV{MYX_CMAKE_DIR} ${MYX_CMAKE_DIR})
endif()
if(DEFINED ENV{MYX_CMAKE_DIR})
find_package(MyxCMake 1.99.88 REQUIRED CONFIG PATHS $ENV{MYX_CMAKE_DIR} NO_DEFAULT_PATH)
myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===")
else()
if(MYX_CMAKE_USE_SYSTEM)
find_package(MyxCMake 1.99.88 REQUIRED)
myx_message_notice("=== MyxCMake directory: ${MyxCMake_CONFIG} ===")
else()
include(${PROJECT_SOURCE_DIR}/cmake/myx/MyxCMakeConfig.cmake)
myx_message_notice("=== MyxCMake directory: ${PROJECT_SOURCE_DIR}/cmake/myx ===")
endif()
endif()