Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F140144
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd8fada..18dd8c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,131 +1,125 @@
# 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 7)
set(libkazv_VERSION_PATCH 0)
set(libkazv_VERSION_STRING ${libkazv_VERSION_MAJOR}.${libkazv_VERSION_MINOR}.${libkazv_VERSION_PATCH})
set(libkazv_SOVERSION 6)
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)
option(libkazv_ENABLE_COVERAGE "Enable code coverage information" OFF)
if(libkazv_ENABLE_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0")
endif()
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()
if(libkazv_BUILD_TESTS)
set(BUILD_TESTING ON)
include(CTest)
set(CMAKE_CTEST_ARGUMENTS --output-on-failure)
endif()
# Build shared libraries by default
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(LIBKAZV_BUILT_WITH_DEBUG 1)
else()
set(LIBKAZV_BUILT_WITH_DEBUG 0)
endif()
find_package(Boost REQUIRED COMPONENTS serialization regex)
if(libkazv_BUILD_KAZVJOB)
find_package(cpr REQUIRED)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
endif()
if(libkazv_BUILD_TESTS)
find_package(Catch2 REQUIRED)
endif()
find_package(nlohmann_json REQUIRED)
find_package(Immer REQUIRED)
find_package(Zug REQUIRED)
find_package(Lager REQUIRED)
if(MINGW)
# On MinGW, disregard the Findcryptopp.cmake
find_package(cryptopp REQUIRED CONFIG)
else()
find_package(cryptopp REQUIRED)
endif()
# On MinGW we use the CMake build, and the target name is different
# for the shared and the static libraries.
if(MINGW)
set(CRYPTOPP_TARGET_NAME cryptopp-shared)
else()
set(CRYPTOPP_TARGET_NAME cryptopp)
endif()
find_package(vodozemac 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()
include(GNUInstallDirs)
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/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})
-
-if(NOT MINGW)
- install(
- FILES cmake/Findcryptopp.cmake
- DESTINATION ${ConfigPackageLocation})
-endif()
diff --git a/cmake/libkazvConfig.cmake b/cmake/libkazvConfig.cmake
index 89a79b9..1667b6f 100644
--- a/cmake/libkazvConfig.cmake
+++ b/cmake/libkazvConfig.cmake
@@ -1,36 +1,35 @@
include(CMakeFindDependencyMacro)
find_dependency(Boost REQUIRED COMPONENTS serialization regex)
find_dependency(nlohmann_json)
find_dependency(Immer)
find_dependency(Zug)
find_dependency(Lager)
set(_oldCmakeModulePath ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}" ${CMAKE_MODULE_PATH})
-find_dependency(cryptopp)
include("${CMAKE_CURRENT_LIST_DIR}/libkazvTargets.cmake")
set(libkazvSupportedComponents job)
foreach(_comp ${libkazv_FIND_COMPONENTS})
if (NOT ";${libkazvSupportedComponents};" MATCHES "${_comp}")
set(libkazv_FOUND False)
set(libkazv_NOT_FOUND_MESSAGE "Unsupported component by libkazv: ${_comp}. Supported components: ${libkazvSupportedComponents}")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/libkazv-${_comp}Config.cmake"
OPTIONAL RESULT_VARIABLE _compFound)
if ("${_compFound}" STREQUAL "NOTFOUND")
set(libkazv_${_comp}_FOUND False)
else()
set(libkazv_${_comp}_FOUND True)
endif()
if (libkazv_FIND_REQUIRED_${_comp})
if ("${_compFound}" STREQUAL "NOTFOUND")
set(libkazv_FOUND False)
set(libkazv_NOT_FOUND_MESSAGE "Missing component: ${_comp}")
endif()
endif()
endforeach()
set(CMAKE_MODULE_PATH ${_oldCmakeModulePath})
diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt
index 65df996..b356936 100644
--- a/src/crypto/CMakeLists.txt
+++ b/src/crypto/CMakeLists.txt
@@ -1,27 +1,27 @@
set(kazvcrypto_SRCS
crypto.cpp
session.cpp
inbound-group-session.cpp
outbound-group-session.cpp
aes-256-ctr.cpp
base64.cpp
sha256.cpp
)
add_library(kazvcrypto ${kazvcrypto_SRCS})
add_library(libkazv::kazvcrypto ALIAS kazvcrypto)
set_target_properties(kazvcrypto PROPERTIES VERSION ${libkazv_VERSION_STRING} SOVERSION ${libkazv_SOVERSION})
-target_link_libraries(kazvcrypto PUBLIC kazvbase ${CRYPTOPP_TARGET_NAME})
-target_link_libraries(kazvcrypto PRIVATE vodozemac::vodozemac)
+target_link_libraries(kazvcrypto PUBLIC kazvbase)
+target_link_libraries(kazvcrypto PRIVATE vodozemac::vodozemac ${CRYPTOPP_TARGET_NAME})
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)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 1:40 PM (21 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55208
Default Alt Text
(6 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment