Page MenuHomePhabricator

D4431.id15692.diff
No OneTemporary

D4431.id15692.diff

diff --git a/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt b/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/native/cpp/CommonCpp/DatabaseManagers/CMakeLists.txt
@@ -0,0 +1,64 @@
+project(comm-databasemanagers)
+cmake_minimum_required(VERSION 3.4)
+
+include(GNUInstallDirs)
+
+find_package(folly REQUIRED)
+
+set(DBM_HDRS
+ "DatabaseManager.h"
+ "DatabaseQueryExecutor.h"
+ "SQLiteQueryExecutor.h"
+ "entities/Draft.h"
+ "entities/Media.h"
+ "entities/Message.h"
+ "entities/Metadata.h"
+ "entities/OlmPersistAccount.h"
+ "entities/OlmPersistSession.h"
+ "entities/Thread.h"
+)
+
+set(DBM_SRCS
+ "SQLiteQueryExecutor.cpp"
+)
+
+add_library(comm-databasemanagers
+ ${DBM_HDRS}
+ ${DBM_SRCS}
+)
+
+target_include_directories(comm-databasemanagers
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ # TODO: Remove once native/cpp has a CMakeLists.txt
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../lib/sqlite_orm>
+ PRIVATE
+ # HACK
+ "../../../node_modules/react-native/ReactCommon/jsi"
+ "../../../node_modules/olm/include"
+)
+
+target_link_libraries(comm-databasemanagers
+ folly
+)
+
+install(TARGETS comm-databasemanagers EXPORT comm-databasemanagers-export
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-databasemanagers
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-databasemanagers
+)
+
+install(FILES ${TOOLS_HDRS} DESTINATION include/comm/DatabaseManagers)
+
+set(_builddir_export_path cmake/comm-tools/comm-databasemanagers-targets.cmake)
+export(TARGETS comm-databasemanagers
+ NAMESPACE comm-databasemanagers::
+ FILE ${CMAKE_CURRENT_BINARY_DIR}/${_builddir_export_path}
+)
+
+# For installation
+install(EXPORT comm-databasemanagers-export
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-databasemanagers
+ NAMESPACE comm-tools::
+)

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 5:50 AM (10 m, 24 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578580
Default Alt Text
D4431.id15692.diff (1 KB)

Event Timeline