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