Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F140099
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d58bbf..fe1717c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,145 +1,146 @@
# Do not let the option()s override variables here
cmake_minimum_required(VERSION 3.13)
if(NOT DEFINED PROJECT_NAME)
if(NOT DEFINED libkazv_INSTALL_HEADERS)
set(libkazv_INSTALL_HEADERS ON)
endif()
endif()
project(libkazv)
set(libkazvSourceRoot ${CMAKE_CURRENT_SOURCE_DIR})
set(libkazv_VERSION_MAJOR 0)
-set(libkazv_VERSION_MINOR 0)
+set(libkazv_VERSION_MINOR 1)
set(libkazv_VERSION_PATCH 0)
set(libkazv_VERSION_STRING ${libkazv_VERSION_MAJOR}.${libkazv_VERSION_MINOR}.${libkazv_VERSION_PATCH})
+set(libkazv_SOVERSION 1)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
option(libkazv_BUILD_TESTS "Build tests" ON)
option(libkazv_BUILD_EXAMPLES "Build examples" ON)
option(libkazv_BUILD_KAZVJOB "Build libkazvjob the async and networking library" ON)
option(libkazv_OUTPUT_LEVEL "Output level: Debug>=90, Info>=70, Quiet>=20, no output=1" 0)
if((libkazv_BUILD_TESTS OR libkazv_BUILD_EXAMPLES) AND NOT libkazv_BUILD_KAZVJOB)
message(FATAL_ERROR
"You asked kazvjob not to be built, but asked to build tests or examples. Tests and examples both depend on kazvjob. This is not possible.")
endif()
# Build shared libraries by default
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
find_package(Boost REQUIRED)
include(FetchContent)
if(libkazv_BUILD_KAZVJOB)
find_package(cpr)
if (NOT cpr_FOUND)
message( STATUS "Using cpr from FetchContent")
set(USE_SYSTEM_CURL ON)
set(BUILD_CPR_TESTS OFF)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/whoshuu/cpr.git GIT_TAG c8d33915dbd88ad6c92b258869b03aba06587ff9) # the commit hash for 1.5.0
FetchContent_MakeAvailable(cpr)
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
if(libkazv_BUILD_TESTS)
find_package(Catch2)
if (NOT Catch2_FOUND)
message(STATUS "Using Catch2 from FetchContent")
FetchContent_Declare(Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2 GIT_TAG v2.13.0)
FetchContent_MakeAvailable(Catch2)
endif()
endif()
find_package(nlohmann_json)
if (NOT nlohmann_json_FOUND)
message(STATUS "Using nlohmann_json from FetchContent")
set(JSON_BuildTests OFF)
FetchContent_Declare(nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json GIT_TAG v3.9.1)
FetchContent_MakeAvailable(nlohmann_json)
endif()
find_package(Immer)
if(NOT Immer_FOUND)
message(STATUS "Using Immer from FetchContent")
set(immer_BUILD_TESTS OFF)
set(immer_BUILD_EXAMPLES OFF)
set(immer_BUILD_DOCS OFF)
set(immer_BUILD_EXTRAS OFF)
FetchContent_Declare(immer GIT_REPOSITORY https://github.com/arximboldi/immer GIT_TAG
800ddb04e528a3e83e69e8021d7e872e7c34cbcd)
FetchContent_MakeAvailable(immer)
endif()
find_package(Zug)
if(NOT Zug_FOUND)
message(STATUS "Using zug from FetchContent")
set(zug_BUILD_TESTS OFF)
set(zug_BUILD_EXAMPLES OFF)
set(zug_BUILD_DOCS OFF)
FetchContent_Declare(zug GIT_REPOSITORY https://github.com/arximboldi/zug GIT_TAG
266cc7fcc01f546c4fd0dabf3a26c71ddc7f3e7d)
FetchContent_MakeAvailable(zug)
endif()
find_package(Lager)
if(NOT Lager_FOUND)
message(STATUS "Using lager from FetchContent")
set(lager_BUILD_TESTS OFF)
set(lager_BUILD_EXAMPLES OFF)
set(lager_BUILD_DOCS OFF)
set(lager_EMBED_RESOURCES_PATH OFF)
FetchContent_Declare(lager GIT_REPOSITORY https://github.com/arximboldi/lager GIT_TAG
71eca6b0ebbccf3e0e54324b6967f047e49ba92d)
FetchContent_MakeAvailable(lager)
endif()
find_package(cereal)
if(NOT cereal_FOUND)
set(JUST_INSTALL_CEREAL ON)
FetchContent_Declare(cereal GIT_REPOSITORY https://github.com/USCiLab/cereal GIT_TAG v1.3.0)
FetchContent_MakeAvailable(cereal)
endif()
find_package(Olm REQUIRED)
if(libkazv_BUILD_EXAMPLES)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBHTTPSERVER REQUIRED libhttpserver)
endif()
if(libkazv_OUTPUT_LEVEL)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLIBKAZV_OUTPUT_LEVEL=${libkazv_OUTPUT_LEVEL}")
endif()
set(ConfigPackageLocation lib/cmake/libkazv)
add_subdirectory(src)
install(EXPORT libkazvTargets
NAMESPACE
libkazv::
DESTINATION
${ConfigPackageLocation}
)
install(
FILES cmake/libkazvConfig.cmake
DESTINATION ${ConfigPackageLocation})
# cpr does not install a good config file.
# We use the find module instead.
install(
FILES cmake/Findcpr.cmake
DESTINATION ${ConfigPackageLocation})
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 3a64630..f877f9c 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -1,21 +1,21 @@
include(linklibsys)
set(FULL_CSAPI_DIR csapi)
file(GLOB_RECURSE kazvapi_SRCS ${FULL_CSAPI_DIR}/*.cpp)
add_library(kazvapi ${kazvapi_SRCS})
add_library(libkazv::kazvapi ALIAS kazvapi)
-set_target_properties(kazvapi PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION 0)
+set_target_properties(kazvapi PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
target_link_libraries(kazvapi PUBLIC kazvbase)
target_include_directories(kazvapi PRIVATE .)
target_include_directories(kazvapi
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/kazv/api>
)
install(TARGETS kazvapi EXPORT libkazvTargets LIBRARY)
diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt
index c634793..8cf72ce 100644
--- a/src/base/CMakeLists.txt
+++ b/src/base/CMakeLists.txt
@@ -1,26 +1,26 @@
include(linklibsys)
set(kazvbase_SRCS
debug.cpp
event.cpp
basejob.cpp
)
add_library(kazvbase ${kazvbase_SRCS})
add_library(libkazv::kazvbase ALIAS kazvbase)
-set_target_properties(kazvbase PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION 0)
+set_target_properties(kazvbase PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
target_link_libraries_system(kazvbase
PUBLIC nlohmann_json::nlohmann_json
immer
zug
lager
cereal)
target_include_directories(kazvbase
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/kazv/base>
)
install(TARGETS kazvbase EXPORT libkazvTargets LIBRARY)
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index ee680ef..a1a7ecc 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -1,34 +1,34 @@
set(kazvclient_SRCS
sdk-model.cpp
client-model.cpp
client.cpp
actions/auth.cpp
actions/sync.cpp
actions/paginate.cpp
actions/membership.cpp
actions/states.cpp
actions/send.cpp
actions/ephemeral.cpp
actions/content.cpp
actions/encryption.cpp
device-list-tracker.cpp
room/room-model.cpp
room/room.cpp
)
add_library(kazvclient ${kazvclient_SRCS})
add_library(libkazv::kazvclient ALIAS kazvclient)
-set_target_properties(kazvclient PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION 0)
+set_target_properties(kazvclient PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
target_link_libraries(kazvclient PUBLIC kazvbase kazvapi kazvcrypto kazvstore)
target_include_directories(kazvclient PRIVATE .)
target_include_directories(kazvclient
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/kazv/client>
)
install(TARGETS kazvclient EXPORT libkazvTargets LIBRARY)
diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt
index 17ea422..c8cb502 100644
--- a/src/crypto/CMakeLists.txt
+++ b/src/crypto/CMakeLists.txt
@@ -1,22 +1,22 @@
set(kazvcrypto_SRCS
crypto.cpp
session.cpp
inbound-group-session.cpp
outbound-group-session.cpp
)
add_library(kazvcrypto ${kazvcrypto_SRCS})
add_library(libkazv::kazvcrypto ALIAS kazvcrypto)
-set_target_properties(kazvcrypto PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION 0)
+set_target_properties(kazvcrypto PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
target_link_libraries(kazvcrypto PUBLIC kazvbase Olm::Olm)
target_include_directories(kazvcrypto PRIVATE .)
target_include_directories(kazvcrypto
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/kazv/crypto>
)
install(TARGETS kazvcrypto EXPORT libkazvTargets LIBRARY)
diff --git a/src/job/CMakeLists.txt b/src/job/CMakeLists.txt
index 1ae62fe..53c52b7 100644
--- a/src/job/CMakeLists.txt
+++ b/src/job/CMakeLists.txt
@@ -1,31 +1,31 @@
include(linklibsys)
set(libkazvjob_SRCS
cprjobhandler.cpp
)
add_library(kazvjob ${libkazvjob_SRCS})
add_library(libkazv::kazvjob ALIAS kazvjob)
-set_target_properties(kazvjob PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION 0)
+set_target_properties(kazvjob PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
target_link_libraries(kazvjob PUBLIC Threads::Threads kazvbase)
target_link_libraries_system(kazvjob PUBLIC
cpr::cpr
)
target_include_directories(kazvjob
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/kazv/job>
)
install( TARGETS kazvjob EXPORT libkazv-jobTargets LIBRARY)
install(EXPORT libkazv-jobTargets
NAMESPACE
libkazv::
DESTINATION
${ConfigPackageLocation}
)
install(
FILES ${libkazvSourceRoot}/cmake/libkazv-jobConfig.cmake
DESTINATION ${ConfigPackageLocation})
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 12:39 PM (8 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55168
Default Alt Text
(9 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment