aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/sqlitecpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/sqlitecpp')
-rw-r--r--vcpkg/ports/sqlitecpp/add_runtime_destination.patch12
-rw-r--r--vcpkg/ports/sqlitecpp/fix_dependency.patch28
-rw-r--r--vcpkg/ports/sqlitecpp/portfile.cmake40
-rw-r--r--vcpkg/ports/sqlitecpp/vcpkg.json35
4 files changed, 115 insertions, 0 deletions
diff --git a/vcpkg/ports/sqlitecpp/add_runtime_destination.patch b/vcpkg/ports/sqlitecpp/add_runtime_destination.patch
new file mode 100644
index 0000000..71b2b85
--- /dev/null
+++ b/vcpkg/ports/sqlitecpp/add_runtime_destination.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e5723d0..ecc1ac2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -337,6 +337,7 @@ target_include_directories(SQLiteCpp
+ include(GNUInstallDirs)
+ install(TARGETS SQLiteCpp
+ EXPORT ${PROJECT_NAME}Targets
++ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ COMPONENT libraries)
diff --git a/vcpkg/ports/sqlitecpp/fix_dependency.patch b/vcpkg/ports/sqlitecpp/fix_dependency.patch
new file mode 100644
index 0000000..79fe8b8
--- /dev/null
+++ b/vcpkg/ports/sqlitecpp/fix_dependency.patch
@@ -0,0 +1,28 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 50362fb..5d7c22f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -325,9 +325,9 @@ else (SQLITECPP_INTERNAL_SQLITE)
+ target_link_libraries(SQLiteCpp PRIVATE ${sqlcipher_LIBRARY})
+ endif()
+ else()
+- find_package (SQLite3 REQUIRED)
++ find_package (unofficial-sqlite3 CONFIG)
+ message(STATUS "Link to sqlite3 system library ${SQLite3_VERSION}")
+- target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
++ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3)
+ if(SQLite3_VERSION VERSION_LESS "3.19")
+ set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
+ endif()
+diff --git a/cmake/SQLiteCppConfig.cmake.in b/cmake/SQLiteCppConfig.cmake.in
+index 7d0941c..d0feda9 100644
+--- a/cmake/SQLiteCppConfig.cmake.in
++++ b/cmake/SQLiteCppConfig.cmake.in
+@@ -1,6 +1,6 @@
+ include(CMakeFindDependencyMacro)
+ if(NOT @SQLITECPP_INTERNAL_SQLITE@)
+- find_dependency(SQLite3 REQUIRED)
++ find_dependency(unofficial-sqlite3 REQUIRED)
+ endif()
+ if(@UNIX@)
+ set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@)
diff --git a/vcpkg/ports/sqlitecpp/portfile.cmake b/vcpkg/ports/sqlitecpp/portfile.cmake
new file mode 100644
index 0000000..fb749fc
--- /dev/null
+++ b/vcpkg/ports/sqlitecpp/portfile.cmake
@@ -0,0 +1,40 @@
+vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
+ REPO "SRombauts/SQLiteCpp"
+ REF ${VERSION}
+ HEAD_REF master
+ SHA512 23193108faaca4c1c7b0a05178bfdbb772a4e14dc145af1b3a7b35efe05a94b07200bdd5551afde44ab5eb3c6aeabbd70cfb0d710dc2750a8280e06fba94c494
+ PATCHES
+ fix_dependency.patch
+ add_runtime_destination.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ sqlcipher SQLITE_HAS_CODEC
+)
+
+set(USE_STACK_PROTECTION "")
+if(VCPKG_TARGET_IS_MINGW)
+ set(USE_STACK_PROTECTION "-DSQLITECPP_USE_STACK_PROTECTION=OFF")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DSQLITECPP_RUN_CPPLINT=OFF
+ -DSQLITECPP_RUN_CPPCHECK=OFF
+ -DSQLITECPP_INTERNAL_SQLITE=OFF
+ -DSQLITE_ENABLE_COLUMN_METADATA=ON
+ -DSQLITECPP_USE_STATIC_RUNTIME=OFF # unconditionally off because vcpkg's toolchains already do the right thing
+ # See https://github.com/SRombauts/SQLiteCpp/blob/e74403264ec7093060f4ed0e84bc9208997c8344/CMakeLists.txt#L40-L46
+ ${USE_STACK_PROTECTION}
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SQLiteCpp)
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/sqlitecpp/vcpkg.json b/vcpkg/ports/sqlitecpp/vcpkg.json
new file mode 100644
index 0000000..7f3baf6
--- /dev/null
+++ b/vcpkg/ports/sqlitecpp/vcpkg.json
@@ -0,0 +1,35 @@
+{
+ "name": "sqlitecpp",
+ "version": "3.3.3",
+ "description": "SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.",
+ "homepage": "https://github.com/SRombauts/SQLiteCpp",
+ "license": "MIT",
+ "dependencies": [
+ "sqlite3",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ "sqlite"
+ ],
+ "features": {
+ "sqlcipher": {
+ "description": "Use the sqlcipher port",
+ "dependencies": [
+ {
+ "name": "sqlcipher",
+ "default-features": false
+ }
+ ]
+ },
+ "sqlite": {
+ "description": "Deprecated; no effects"
+ }
+ }
+}