Page MenuHomePhabricator

D4295.id13575.diff
No OneTemporary

D4295.id13575.diff

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
+ "include/comm/Tools/CommSecureStore.h"
+ "include/comm/Tools/Logger.h"
+ "include/comm/Tools/PlatformSpecificTools.h"
+ "include/comm/Tools/WorkerThread.h"
+ )
+
+set(TOOLS_SRCS
+ "src/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
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+
+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/comm/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/CommSecureStore.h b/native/cpp/CommonCpp/Tools/include/comm/Tools/CommSecureStore.h
rename from native/cpp/CommonCpp/Tools/CommSecureStore.h
rename to native/cpp/CommonCpp/Tools/include/comm/Tools/CommSecureStore.h
diff --git a/native/cpp/CommonCpp/Tools/Logger.h b/native/cpp/CommonCpp/Tools/include/comm/Tools/Logger.h
rename from native/cpp/CommonCpp/Tools/Logger.h
rename to native/cpp/CommonCpp/Tools/include/comm/Tools/Logger.h
diff --git a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h b/native/cpp/CommonCpp/Tools/include/comm/Tools/PlatformSpecificTools.h
rename from native/cpp/CommonCpp/Tools/PlatformSpecificTools.h
rename to native/cpp/CommonCpp/Tools/include/comm/Tools/PlatformSpecificTools.h
--- a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h
+++ b/native/cpp/CommonCpp/Tools/include/comm/Tools/PlatformSpecificTools.h
@@ -1,6 +1,6 @@
#pragma once
-#include "../CryptoTools/Tools.h"
+#include <comm/CryptoTools/Tools.h>
namespace comm {
diff --git a/native/cpp/CommonCpp/Tools/WorkerThread.h b/native/cpp/CommonCpp/Tools/include/comm/Tools/WorkerThread.h
rename from native/cpp/CommonCpp/Tools/WorkerThread.h
rename to native/cpp/CommonCpp/Tools/include/comm/Tools/WorkerThread.h
diff --git a/native/cpp/CommonCpp/Tools/WorkerThread.cpp b/native/cpp/CommonCpp/Tools/src/WorkerThread.cpp
rename from native/cpp/CommonCpp/Tools/WorkerThread.cpp
rename to native/cpp/CommonCpp/Tools/src/WorkerThread.cpp
--- a/native/cpp/CommonCpp/Tools/WorkerThread.cpp
+++ b/native/cpp/CommonCpp/Tools/src/WorkerThread.cpp
@@ -1,5 +1,5 @@
-#include "WorkerThread.h"
-#include "Logger.h"
+#include <comm/Tools/Logger.h>
+#include <comm/Tools/WorkerThread.h>
#include <sstream>
namespace comm {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 11:34 PM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2566577
Default Alt Text
D4295.id13575.diff (3 KB)

Event Timeline