Add lokimq compatibility headers

This commit is contained in:
Jason Rhinelander 2021-01-14 14:38:14 -04:00
parent 2ae6b96016
commit 0738695eb9
15 changed files with 104 additions and 0 deletions

View File

@ -31,11 +31,16 @@ endif()
option(OXENMQ_BUILD_TESTS "Building and perform oxenmq tests" ${oxenmq_IS_TOPLEVEL_PROJECT})
option(OXENMQ_INSTALL "Add oxenmq libraries and headers to cmake install target; defaults to ON if BUILD_SHARED_LIBS is enabled or we are the top-level project; OFF for a static subdirectory build" ${oxenmq_INSTALL_DEFAULT})
option(OXENMQ_INSTALL_CPPZMQ "Install cppzmq header with oxenmq/ headers (requires OXENMQ_INSTALL)" ON)
option(OXENMQ_LOKIMQ_COMPAT "Install lokimq compatibility headers and pkg-config for rename migration" ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
configure_file(oxenmq/version.h.in oxenmq/version.h @ONLY)
configure_file(liboxenmq.pc.in liboxenmq.pc @ONLY)
if(OXENMQ_LOKIMQ_COMPAT)
configure_file(liblokimq.pc.in liblokimq.pc @ONLY)
endif()
add_library(oxenmq
oxenmq/address.cpp
@ -141,6 +146,9 @@ else()
endif()
add_library(oxenmq::oxenmq ALIAS oxenmq)
if(OXENMQ_LOKIMQ_COMPAT)
add_library(lokimq::lokimq ALIAS oxenmq)
endif()
export(
TARGETS oxenmq
@ -185,6 +193,33 @@ if(OXENMQ_INSTALL)
FILES ${CMAKE_CURRENT_BINARY_DIR}/liboxenmq.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
if(OXENMQ_LOKIMQ_COMPAT)
install(
FILES lokimq/address.h
lokimq/auth.h
lokimq/base32z.h
lokimq/base64.h
lokimq/batch.h
lokimq/bt_serialize.h
lokimq/bt_value.h
lokimq/connections.h
lokimq/hex.h
lokimq/lokimq.h
lokimq/message.h
lokimq/string_view.h
lokimq/variant.h
lokimq/version.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lokimq
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/liblokimq.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
endif()
endif()
if(OXENMQ_BUILD_TESTS)

13
liblokimq.pc.in Normal file
View File

@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: liblokimq
Description: ZeroMQ-based communication library (compatibility package for liboxenmq)
Version: @OXENMQ_VERSION@
Libs: -L${libdir} -loxenmq
Libs.private: @PRIVATE_LIBS@
Requires.private: libzmq libsodium
Cflags: -I${includedir}

4
lokimq/address.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/address.h"
namespace lokimq = oxenmq;

4
lokimq/auth.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/auth.h"
namespace lokimq = oxenmq;

4
lokimq/base32z.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/base32z.h"
namespace lokimq = oxenmq;

4
lokimq/base64.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/base64.h"
namespace lokimq = oxenmq;

4
lokimq/batch.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/batch.h"
namespace lokimq = oxenmq;

4
lokimq/bt_serialize.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/bt_serialize.h"
namespace lokimq = oxenmq;

4
lokimq/bt_value.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/bt_value.h"
namespace lokimq = oxenmq;

4
lokimq/connections.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/connections.h"
namespace lokimq = oxenmq;

4
lokimq/hex.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/hex.h"
namespace lokimq = oxenmq;

10
lokimq/lokimq.h Normal file
View File

@ -0,0 +1,10 @@
#pragma once
#include "../oxenmq/oxenmq.h"
namespace lokimq = oxenmq;
namespace oxenmq {
using LokiMQ = OxenMQ;
}

4
lokimq/message.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/message.h"
namespace lokimq = oxenmq;

2
lokimq/variant.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#include "../oxenmq/variant.h"

4
lokimq/version.h Normal file
View File

@ -0,0 +1,4 @@
#pragma once
#include "../oxenmq/version.h"
namespace lokimq = oxenmq;