]> git.proxmox.com Git - ceph.git/blob - 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
1 cmake_minimum_required(VERSION 3.10)
2 project(sqlcipher C)
3
4 find_package(OpenSSL REQUIRED)
5
6 include_directories(. ${OPENSSL_INCLUDE_DIR})
7 if(BUILD_SHARED_LIBS)
8 if(UNIX)
9 set(API "-DSQLITE_API=__attribute__((visibility(\"default\")))")
10 elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
11 set(API "-DSQLITE_API=__declspec(dllexport)")
12 else()
13 message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
14 endif()
15 else()
16 set(API "-DSQLITE_API=extern")
17 endif()
18 add_library(sqlcipher sqlite3.c)
19
20 target_compile_definitions(
21 sqlcipher
22 PRIVATE
23 $<$<CONFIG:Debug>:SQLITE_DEBUG>
24 ${API}
25 -DSQLITE_ENABLE_RTREE
26 -DSQLITE_ENABLE_UNLOCK_NOTIFY
27 -DSQLITE_ENABLE_COLUMN_METADATA
28 -DSQLITE_HAS_CODEC
29 -DSQLITE_TEMP_STORE=2
30 )
31
32 if(WITH_GEOPOLY)
33 add_compile_definitions(SQLITE_ENABLE_GEOPOLY)
34 endif()
35
36 if(WITH_JSON1)
37 add_compile_definitions(SQLITE_ENABLE_JSON1)
38 endif()
39
40 target_include_directories(sqlcipher INTERFACE $<INSTALL_INTERFACE:include>)
41 if(NOT WIN32)
42 find_package(Threads REQUIRED)
43 target_link_libraries(sqlcipher PRIVATE Threads::Threads ${CMAKE_DL_LIBS})
44 endif()
45
46 target_link_libraries(sqlcipher PRIVATE ${OPENSSL_CRYPTO_LIBRARY})
47
48 if(CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
49 target_compile_definitions(sqlcipher PRIVATE -DSQLITE_OS_WINRT=1)
50 endif()
51
52 if(NOT SQLITE3_SKIP_TOOLS)
53 add_executable(sqlcipher-bin shell.c)
54 target_link_libraries(sqlcipher-bin PRIVATE sqlcipher)
55 install(TARGETS sqlcipher-bin sqlcipher
56 RUNTIME DESTINATION tools/sqlcipher
57 LIBRARY DESTINATION lib
58 ARCHIVE DESTINATION lib
59 )
60 endif()
61
62 install(
63 TARGETS sqlcipher
64 EXPORT sqlcipher-targets
65 RUNTIME DESTINATION bin
66 LIBRARY DESTINATION lib
67 ARCHIVE DESTINATION lib
68 )
69
70 install(FILES sqlite3.h sqlite3ext.h DESTINATION include/sqlcipher CONFIGURATIONS Release)
71 install(EXPORT sqlcipher-targets NAMESPACE sqlcipher:: FILE sqlcipher-targets.cmake DESTINATION share/sqlcipher)