builds with different names to coexist
All checks were successful
Main LMDBAL workfow / Test LMDBAL with qt5 (push) Successful in 1m8s
Main LMDBAL workfow / Test LMDBAL with qt6 (push) Successful in 1m22s
Main LMDBAL workfow / Release documentation (push) Successful in 26s
LMDBAL Release workflow / Release qt5 build to AUR (release) Successful in 24s
LMDBAL Release workflow / Release qt6 build to AUR (release) Successful in 24s

This commit is contained in:
Blue 2024-12-03 19:36:07 +02:00
parent 649d967963
commit 7aaab5e807
Signed by: blue
GPG Key ID: 9B203B252A63EE38
6 changed files with 45 additions and 42 deletions

View File

@ -12,7 +12,7 @@ jobs:
package-name: lmdbal-qt5
description: LMDB Abstraction Layer, qt5 version
depends: 'qt5-base'
flags: -D QT_VERSION_MAJOR=5
flags: -D QT_VERSION_MAJOR=5 -D LMDBAL_NAME=LMDBAL-QT5
secrets:
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
@ -25,7 +25,7 @@ jobs:
package-name: lmdbal-qt6
description: LMDB Abstraction Layer, qt6 version
depends: 'qt6-base'
flags: -D QT_VERSION_MAJOR=6
flags: -D QT_VERSION_MAJOR=6 -D LMDBAL_NAME=LMDBAL-QT5
secrets:
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}

View File

@ -5,11 +5,12 @@ project(LMDBAL
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
LANGUAGES CXX
)
string(TOLOWER ${PROJECT_NAME} PROJECT_LOW)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0079 NEW)
set(LMDBAL_NAME ${PROJECT_NAME} CACHE STRING "Override for library name and install path")
option(BUILD_STATIC "Builds library as static library" OFF)
option(BUILD_TESTS "Builds tests" OFF)
option(BUILD_DOC_MAN "Builds man page documentation" OFF)
@ -25,6 +26,8 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
string(TOLOWER ${LMDBAL_NAME} LMDBAL_NAME_LOW)
if (NOT DEFINED QT_VERSION_MAJOR)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
endif()
@ -38,9 +41,9 @@ if (NOT CMAKE_BUILD_TYPE)
endif ()
if (BUILD_STATIC)
add_library(${PROJECT_NAME} STATIC)
add_library(${LMDBAL_NAME} STATIC)
else ()
add_library(${PROJECT_NAME} SHARED)
add_library(${LMDBAL_NAME} SHARED)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
@ -52,21 +55,21 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
endif()
message("Compilation options: " ${COMPILE_OPTIONS})
target_compile_options(${PROJECT_NAME} PRIVATE ${COMPILE_OPTIONS})
target_compile_options(${LMDBAL_NAME} PRIVATE ${COMPILE_OPTIONS})
set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION ${version})
set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION 1)
set_property(TARGET ${PROJECT_NAME} PROPERTY EXPORT_NAME ${PROJECT_NAME})
set_property(TARGET ${PROJECT_NAME} PROPERTY INTERFACE_${PROJECT_NAME}_MAJOR_VERSION 1)
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION
set_property(TARGET ${LMDBAL_NAME} PROPERTY VERSION ${version})
set_property(TARGET ${LMDBAL_NAME} PROPERTY SOVERSION 1)
set_property(TARGET ${LMDBAL_NAME} PROPERTY EXPORT_NAME ${LMDBAL_NAME})
set_property(TARGET ${LMDBAL_NAME} PROPERTY INTERFACE_${LMDBAL_NAME}_MAJOR_VERSION 1)
set_property(TARGET ${LMDBAL_NAME} APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING ${LMDBAL_NAME}_MAJOR_VERSION
)
if (UNIX)
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${PROJECT_LOW}")
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET ${PROJECT_NAME} PROPERTY SKIP_BUILD_RPATH FALSE)
set_property(TARGET ${PROJECT_NAME} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE)
set_property(TARGET ${LMDBAL_NAME} PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${LMDBAL_NAME_LOW}")
set_property(TARGET ${LMDBAL_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
set_property(TARGET ${LMDBAL_NAME} PROPERTY SKIP_BUILD_RPATH FALSE)
set_property(TARGET ${LMDBAL_NAME} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE)
endif()
add_subdirectory(src)
@ -84,47 +87,47 @@ if (BUILD_TESTS)
endif ()
target_include_directories(
${PROJECT_NAME}
${LMDBAL_NAME}
PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/serializer>
)
target_include_directories(${PROJECT_NAME} PRIVATE ${Qt${QT_VERSION_MAJOR}_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS})
target_include_directories(${LMDBAL_NAME} PRIVATE ${Qt${QT_VERSION_MAJOR}_INCLUDE_DIRS})
target_include_directories(${LMDBAL_NAME} PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS})
target_link_libraries(
${PROJECT_NAME}
${LMDBAL_NAME}
Qt${QT_VERSION_MAJOR}::Core
lmdb
)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}ConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}ConfigVersion.cmake"
VERSION "${version}"
COMPATIBILITY AnyNewerVersion
)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_LOW}Targets
install(TARGETS ${LMDBAL_NAME}
EXPORT ${LMDBAL_NAME_LOW}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW}
)
install(EXPORT ${PROJECT_LOW}Targets
FILE ${PROJECT_LOW}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
install(EXPORT ${LMDBAL_NAME_LOW}Targets
FILE ${LMDBAL_NAME_LOW}Targets.cmake
NAMESPACE ${LMDBAL_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}ConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
)

View File

@ -1,7 +1,7 @@
# Maintainer: Yury Gubich <blue@macaw.me>
pkgname=lmdbal
pkgver=1.0.0
pkgrel=1
pkgrel=2
pkgdesc="LMDB Abstraction Layer"
arch=('i686' 'x86_64')
url="https://git.macaw.me/blue/lmdbal"
@ -10,14 +10,14 @@ depends=( 'lmdb' )
makedepends=('cmake>=3.16' 'gcc')
optdepends=()
source=("$pkgname-$pkgver.tar.gz::https://git.macaw.me/blue/$pkgname/archive/$pkgver.tar.gz")
source=("lmdbal-$pkgver.tar.gz::https://git.macaw.me/blue/lmdbal/archive/$pkgver.tar.gz")
sha256sums=('SKIP')
build() {
cd "$srcdir/$pkgname"
cd "$srcdir/lmdbal"
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release
cmake --build .
}
package() {
cd "$srcdir/$pkgname"
cd "$srcdir/lmdbal"
DESTDIR="$pkgdir/" cmake --install .
}

View File

@ -18,8 +18,8 @@ set(HEADERS
transaction.h
)
target_sources(${PROJECT_NAME} PRIVATE ${SOURCES})
target_sources(${LMDBAL_NAME} PRIVATE ${SOURCES})
add_subdirectory(serializer)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW})
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW})

View File

@ -16,4 +16,4 @@ set(HEADERS
serializer_qbytearray.hpp
)
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW})
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW})

View File

@ -20,7 +20,7 @@ target_include_directories(runUnitTests PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCL
target_link_libraries(
runUnitTests
GTest::gtest_main
${PROJECT_NAME}
${LMDBAL_NAME}
Qt${QT_VERSION_MAJOR}::Core
)
include(GoogleTest)