diff --git a/native/cpp/lib/sqlite_orm/CMakeLists.txt b/native/cpp/lib/sqlite_orm/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/native/cpp/lib/sqlite_orm/CMakeLists.txt @@ -0,0 +1,43 @@ +project(comm-sqlite-orm) +cmake_minimum_required(VERSION 3.4) + +include(GNUInstallDirs) + +find_package(PkgConfig) +pkg_check_modules(sqlite REQUIRED sqlite3) + +set(SQLITE_HDRS + "sqlite_orm.h" +) + +add_library(comm-sqlite-orm + INTERFACE + ${SQLITE_HDRS} +) + +# reference local directory when building, use installation path when installing +target_include_directories(comm-sqlite-orm + PUBLIC INTERFACE + $ + $ +) + +install(TARGETS comm-sqlite-orm EXPORT comm-sqlite-orm-export + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT comm-sqlite-orm + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-sqlite-orm + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT comm-sqlite-orm +) + +install(FILES ${SQLITE_HDRS} DESTINATION include) + +# For development purposes, can point cmake to this directory if doing development +export(TARGETS comm-sqlite-orm + NAMESPACE comm-sqlite-orm:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/comm-sqlite-orm/comm-sqlite-orm-targets.cmake +) + +# For installation +install(EXPORT comm-sqlite-orm-export + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/comm-sqlite-orm + NAMESPACE comm-sqlite-orm:: +)