diff --git a/native/cpp/CommonCpp/CMakeLists.txt b/native/cpp/CommonCpp/CMakeLists.txt --- a/native/cpp/CommonCpp/CMakeLists.txt +++ b/native/cpp/CommonCpp/CMakeLists.txt @@ -31,4 +31,7 @@ comm-client ) +target_link_libraries(comm-cryptotools + comm-tools + ) diff --git a/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/CryptoTools/CMakeLists.txt @@ -0,0 +1,56 @@ +project(comm-cryptotools) +cmake_minimum_required(VERSION 3.4) + +include(GNUInstallDirs) + +set(CRYPTO_HDRS + "CryptoModule.h" + "Persist.h" + "Session.h" + "Tools.h" + ) + +set(CRYPTO_SRCS + "CryptoModule.cpp" + "Session.cpp" + "Tools.cpp" + ) + +add_library(comm-cryptotools + ${CRYPTO_HDRS} + ${CRYPTO_SRCS} +) + +find_package(Olm) + +target_link_libraries(comm-cryptotools + Olm + ) + +# reference local directory when building, use installation path when installing +target_include_directories(comm-cryptotools + PUBLIC + $ + $ +) + +install(TARGETS comm-cryptotools EXPORT comm-cryptotools-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-cryptotools + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-cryptotools +) + +install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) + +# For development purposes, can point cmake to this directory if doing development +export(TARGETS comm-cryptotools + NAMESPACE comm-cryptotools:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-cryptotools/comm-cryptotools-targets.cmake +) + +# For installation +install(EXPORT comm-cryptotools-export + FILE comm-cryptotools-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-cryptotools + NAMESPACE comm-cryptotools:: +) diff --git a/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp b/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp --- a/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp +++ b/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp @@ -1,6 +1,8 @@ -#include "CryptoModule.h" -#include "PlatformSpecificTools.h" -#include "olm/session.hh" +#include +#include +#include + +#include namespace comm { namespace crypto { diff --git a/native/cpp/CommonCpp/CryptoTools/Session.cpp b/native/cpp/CommonCpp/CryptoTools/Session.cpp --- a/native/cpp/CommonCpp/CryptoTools/Session.cpp +++ b/native/cpp/CommonCpp/CryptoTools/Session.cpp @@ -1,5 +1,7 @@ -#include "Session.h" -#include "PlatformSpecificTools.h" +#include +#include + +#include namespace comm { namespace crypto { diff --git a/native/cpp/CommonCpp/CryptoTools/Tools.h b/native/cpp/CommonCpp/CryptoTools/Tools.h --- a/native/cpp/CommonCpp/CryptoTools/Tools.h +++ b/native/cpp/CommonCpp/CryptoTools/Tools.h @@ -1,5 +1,7 @@ #pragma once +#include +#include #include #include "olm/olm.h" diff --git a/native/cpp/CommonCpp/CryptoTools/Tools.cpp b/native/cpp/CommonCpp/CryptoTools/Tools.cpp --- a/native/cpp/CommonCpp/CryptoTools/Tools.cpp +++ b/native/cpp/CommonCpp/CryptoTools/Tools.cpp @@ -1,5 +1,5 @@ -#include "Tools.h" -#include "PlatformSpecificTools.h" +#include +#include #include