forked from blue/lmdbal
builds with different names to coexist
This commit is contained in:
parent
649d967963
commit
7aaab5e807
@ -12,7 +12,7 @@ jobs:
|
|||||||
package-name: lmdbal-qt5
|
package-name: lmdbal-qt5
|
||||||
description: LMDB Abstraction Layer, qt5 version
|
description: LMDB Abstraction Layer, qt5 version
|
||||||
depends: 'qt5-base'
|
depends: 'qt5-base'
|
||||||
flags: -D QT_VERSION_MAJOR=5
|
flags: -D QT_VERSION_MAJOR=5 -D LMDBAL_NAME=LMDBAL-QT5
|
||||||
secrets:
|
secrets:
|
||||||
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
|
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
|
||||||
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
|
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
|
||||||
@ -25,7 +25,7 @@ jobs:
|
|||||||
package-name: lmdbal-qt6
|
package-name: lmdbal-qt6
|
||||||
description: LMDB Abstraction Layer, qt6 version
|
description: LMDB Abstraction Layer, qt6 version
|
||||||
depends: 'qt6-base'
|
depends: 'qt6-base'
|
||||||
flags: -D QT_VERSION_MAJOR=6
|
flags: -D QT_VERSION_MAJOR=6 -D LMDBAL_NAME=LMDBAL-QT5
|
||||||
secrets:
|
secrets:
|
||||||
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
|
DEPLOY_TO_AUR_PRIVATE_KEY: ${{ secrets.DEPLOY_TO_AUR_PRIVATE_KEY }}
|
||||||
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
|
DEPLOY_TO_AUR_USER_NAME: ${{ secrets.DEPLOY_TO_AUR_USER_NAME }}
|
||||||
|
@ -5,11 +5,12 @@ project(LMDBAL
|
|||||||
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
|
DESCRIPTION "LMDB (Lightning Memory-Mapped Database Manager) Abstraction Layer"
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
string(TOLOWER ${PROJECT_NAME} PROJECT_LOW)
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0076 NEW)
|
cmake_policy(SET CMP0076 NEW)
|
||||||
cmake_policy(SET CMP0079 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_STATIC "Builds library as static library" OFF)
|
||||||
option(BUILD_TESTS "Builds tests" OFF)
|
option(BUILD_TESTS "Builds tests" OFF)
|
||||||
option(BUILD_DOC_MAN "Builds man page documentation" 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_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
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)
|
if (NOT DEFINED QT_VERSION_MAJOR)
|
||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||||
endif()
|
endif()
|
||||||
@ -38,9 +41,9 @@ if (NOT CMAKE_BUILD_TYPE)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (BUILD_STATIC)
|
if (BUILD_STATIC)
|
||||||
add_library(${PROJECT_NAME} STATIC)
|
add_library(${LMDBAL_NAME} STATIC)
|
||||||
else ()
|
else ()
|
||||||
add_library(${PROJECT_NAME} SHARED)
|
add_library(${LMDBAL_NAME} SHARED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
@ -52,21 +55,21 @@ elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("Compilation options: " ${COMPILE_OPTIONS})
|
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 ${LMDBAL_NAME} PROPERTY VERSION ${version})
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION 1)
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY SOVERSION 1)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY EXPORT_NAME ${PROJECT_NAME})
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY EXPORT_NAME ${LMDBAL_NAME})
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY INTERFACE_${PROJECT_NAME}_MAJOR_VERSION 1)
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY INTERFACE_${LMDBAL_NAME}_MAJOR_VERSION 1)
|
||||||
set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY
|
set_property(TARGET ${LMDBAL_NAME} APPEND PROPERTY
|
||||||
COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION
|
COMPATIBLE_INTERFACE_STRING ${LMDBAL_NAME}_MAJOR_VERSION
|
||||||
)
|
)
|
||||||
|
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${PROJECT_LOW}")
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${LMDBAL_NAME_LOW}")
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY SKIP_BUILD_RPATH FALSE)
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY SKIP_BUILD_RPATH FALSE)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE)
|
set_property(TARGET ${LMDBAL_NAME} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
@ -84,47 +87,47 @@ if (BUILD_TESTS)
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${PROJECT_NAME}
|
${LMDBAL_NAME}
|
||||||
PUBLIC
|
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>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/serializer>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/serializer>
|
||||||
)
|
)
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE ${Qt${QT_VERSION_MAJOR}_INCLUDE_DIRS})
|
target_include_directories(${LMDBAL_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}Core_INCLUDE_DIRS})
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${PROJECT_NAME}
|
${LMDBAL_NAME}
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
Qt${QT_VERSION_MAJOR}::Core
|
||||||
lmdb
|
lmdb
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_package_config_file(
|
configure_package_config_file(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}Config.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}Config.cmake"
|
||||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
|
||||||
)
|
)
|
||||||
|
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}ConfigVersion.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}ConfigVersion.cmake"
|
||||||
VERSION "${version}"
|
VERSION "${version}"
|
||||||
COMPATIBILITY AnyNewerVersion
|
COMPATIBILITY AnyNewerVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${LMDBAL_NAME}
|
||||||
EXPORT ${PROJECT_LOW}Targets
|
EXPORT ${LMDBAL_NAME_LOW}Targets
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
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
|
install(EXPORT ${LMDBAL_NAME_LOW}Targets
|
||||||
FILE ${PROJECT_LOW}Targets.cmake
|
FILE ${LMDBAL_NAME_LOW}Targets.cmake
|
||||||
NAMESPACE ${PROJECT_NAME}::
|
NAMESPACE ${LMDBAL_NAME}::
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}Config.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}Config.cmake"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOW}ConfigVersion.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/${LMDBAL_NAME_LOW}ConfigVersion.cmake"
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_LOW}
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LMDBAL_NAME_LOW}
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Yury Gubich <blue@macaw.me>
|
# Maintainer: Yury Gubich <blue@macaw.me>
|
||||||
pkgname=lmdbal
|
pkgname=lmdbal
|
||||||
pkgver=1.0.0
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="LMDB Abstraction Layer"
|
pkgdesc="LMDB Abstraction Layer"
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
url="https://git.macaw.me/blue/lmdbal"
|
url="https://git.macaw.me/blue/lmdbal"
|
||||||
@ -10,14 +10,14 @@ depends=( 'lmdb' )
|
|||||||
makedepends=('cmake>=3.16' 'gcc')
|
makedepends=('cmake>=3.16' 'gcc')
|
||||||
optdepends=()
|
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')
|
sha256sums=('SKIP')
|
||||||
build() {
|
build() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/lmdbal"
|
||||||
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release
|
cmake . -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_BUILD_TYPE=Release
|
||||||
cmake --build .
|
cmake --build .
|
||||||
}
|
}
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/$pkgname"
|
cd "$srcdir/lmdbal"
|
||||||
DESTDIR="$pkgdir/" cmake --install .
|
DESTDIR="$pkgdir/" cmake --install .
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ set(HEADERS
|
|||||||
transaction.h
|
transaction.h
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(${PROJECT_NAME} PRIVATE ${SOURCES})
|
target_sources(${LMDBAL_NAME} PRIVATE ${SOURCES})
|
||||||
|
|
||||||
add_subdirectory(serializer)
|
add_subdirectory(serializer)
|
||||||
|
|
||||||
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW})
|
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW})
|
||||||
|
@ -16,4 +16,4 @@ set(HEADERS
|
|||||||
serializer_qbytearray.hpp
|
serializer_qbytearray.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_LOW})
|
install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${LMDBAL_NAME_LOW})
|
||||||
|
@ -20,7 +20,7 @@ target_include_directories(runUnitTests PRIVATE ${Qt${QT_VERSION_MAJOR}Core_INCL
|
|||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
runUnitTests
|
runUnitTests
|
||||||
GTest::gtest_main
|
GTest::gtest_main
|
||||||
${PROJECT_NAME}
|
${LMDBAL_NAME}
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
Qt${QT_VERSION_MAJOR}::Core
|
||||||
)
|
)
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
|
Loading…
Reference in New Issue
Block a user