]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/sqlcipher/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / sqlcipher / CMakeLists.txt
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/sqlcipher/CMakeLists.txt b/ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/sqlcipher/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0a50513
--- /dev/null
@@ -0,0 +1,71 @@
+cmake_minimum_required(VERSION 3.10)
+project(sqlcipher C)
+
+find_package(OpenSSL REQUIRED)
+
+include_directories(. ${OPENSSL_INCLUDE_DIR})
+if(BUILD_SHARED_LIBS)
+    if(UNIX)
+        set(API "-DSQLITE_API=__attribute__((visibility(\"default\")))")
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
+        set(API "-DSQLITE_API=__declspec(dllexport)")
+    else()
+        message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
+    endif()
+else()
+    set(API "-DSQLITE_API=extern")
+endif()
+add_library(sqlcipher sqlite3.c)
+
+target_compile_definitions(
+    sqlcipher
+    PRIVATE
+        $<$<CONFIG:Debug>:SQLITE_DEBUG>
+        ${API}
+        -DSQLITE_ENABLE_RTREE
+        -DSQLITE_ENABLE_UNLOCK_NOTIFY
+        -DSQLITE_ENABLE_COLUMN_METADATA
+               -DSQLITE_HAS_CODEC
+               -DSQLITE_TEMP_STORE=2
+)
+
+if(WITH_GEOPOLY)
+    add_compile_definitions(SQLITE_ENABLE_GEOPOLY)
+endif()
+
+if(WITH_JSON1)
+    add_compile_definitions(SQLITE_ENABLE_JSON1)
+endif()
+
+target_include_directories(sqlcipher INTERFACE $<INSTALL_INTERFACE:include>)
+if(NOT WIN32)
+    find_package(Threads REQUIRED)
+    target_link_libraries(sqlcipher PRIVATE Threads::Threads ${CMAKE_DL_LIBS})
+endif()
+
+target_link_libraries(sqlcipher PRIVATE ${OPENSSL_CRYPTO_LIBRARY})
+
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
+    target_compile_definitions(sqlcipher PRIVATE -DSQLITE_OS_WINRT=1)
+endif()
+
+if(NOT SQLITE3_SKIP_TOOLS)
+    add_executable(sqlcipher-bin shell.c)
+    target_link_libraries(sqlcipher-bin PRIVATE sqlcipher)
+    install(TARGETS sqlcipher-bin sqlcipher
+      RUNTIME DESTINATION tools/sqlcipher
+      LIBRARY DESTINATION lib
+      ARCHIVE DESTINATION lib
+    )
+endif()
+
+install(
+    TARGETS sqlcipher
+    EXPORT sqlcipher-targets
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib
+)
+
+install(FILES sqlite3.h sqlite3ext.h DESTINATION include/sqlcipher CONFIGURATIONS Release)
+install(EXPORT sqlcipher-targets NAMESPACE sqlcipher:: FILE sqlcipher-targets.cmake DESTINATION share/sqlcipher)