diff --git a/native/cpp/lib/sqlite_orm/CMakeLists.txt b/native/cpp/lib/sqlite_orm/CMakeLists.txt new file mode 100644 index 000000000..1ee9cd5fa --- /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) + +set(_cmake_dir "cmake/comm-sqlite-orm") +export(TARGETS comm-sqlite-orm + NAMESPACE comm-sqlite-orm:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/${_cmake_dir}/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:: +)