diff --git a/native/cpp/CommonCpp/Tools/CMakeLists.txt b/native/cpp/CommonCpp/Tools/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/Tools/CMakeLists.txt @@ -0,0 +1,54 @@ +project(comm-tools) +cmake_minimum_required(VERSION 3.4) + +include(GNUInstallDirs) + +find_package(Folly REQUIRED) + +set(TOOLS_HDRS + "CommSecureStore.h" + "Logger.h" + "PlatformSpecificTools.h" + "WorkerThread.h" + ) + +set(TOOLS_SRCS + "WorkerThread.cpp" + ) + +add_library(comm-tools + ${TOOLS_HDRS} + ${TOOLS_SRCS} +) + +target_link_libraries(comm-tools + Folly::folly + ) + +# reference local directory when building, use installation path when installing +target_include_directories(comm-tools + PUBLIC + $ + $ +) + +install(TARGETS comm-tools EXPORT comm-tools-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-tools + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-tools +) + +install(FILES ${TOOLS_HDRS} DESTINATION include/Tools) + +# For development purposes, can point cmake to this directory if doing development +export(TARGETS comm-tools + NAMESPACE comm-tools:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-tools/comm-tools-targets.cmake +) + +# For installation +install(EXPORT comm-tools-export + FILE comm-tools-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-tool + NAMESPACE comm-tools:: +) diff --git a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h b/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h --- a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h +++ b/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h @@ -1,6 +1,6 @@ #pragma once -#include "../CryptoTools/Tools.h" +#include namespace comm { diff --git a/native/cpp/CommonCpp/Tools/WorkerThread.cpp b/native/cpp/CommonCpp/Tools/WorkerThread.cpp --- a/native/cpp/CommonCpp/Tools/WorkerThread.cpp +++ b/native/cpp/CommonCpp/Tools/WorkerThread.cpp @@ -1,5 +1,5 @@ -#include "WorkerThread.h" -#include "Logger.h" +#include +#include #include namespace comm {