aboutsummaryrefslogtreecommitdiff
path: root/ports/sqlite3
diff options
context:
space:
mode:
authorJan HrubĂ˝ <jhruby.web@gmail.com>2017-03-13 08:56:05 +0100
committerGitHub <noreply@github.com>2017-03-13 08:56:05 +0100
commit665f4118f603c5858217ed7a2f2f824b18ff4fc5 (patch)
treef0167041edf71e90f2331b5025f603392a8de67a /ports/sqlite3
parent1bec0fcb73073b5b1719f454c368a63f1bff625e (diff)
parent1c9873a0daf625f67474aaf3e163c592c27ecb65 (diff)
downloadvcpkg-665f4118f603c5858217ed7a2f2f824b18ff4fc5.tar.gz
vcpkg-665f4118f603c5858217ed7a2f2f824b18ff4fc5.zip
Merge pull request #1 from Microsoft/master
pull
Diffstat (limited to 'ports/sqlite3')
-rw-r--r--ports/sqlite3/CMakeLists.txt23
-rw-r--r--ports/sqlite3/CONTROL4
-rw-r--r--ports/sqlite3/portfile.cmake46
3 files changed, 48 insertions, 25 deletions
diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt
index 3d5f73a4a..dbe636b79 100644
--- a/ports/sqlite3/CMakeLists.txt
+++ b/ports/sqlite3/CMakeLists.txt
@@ -2,15 +2,30 @@ cmake_minimum_required(VERSION 3.0)
project(sqlite3 C)
include_directories(${SOURCE})
-add_library(sqlite3 SHARED ${SOURCE}/sqlite3.c)
-target_compile_definitions(sqlite3 PRIVATE $<$<CONFIG:Debug>:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)")
-if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore")
+if(BUILD_SHARED_LIBS)
+ set(API "-DSQLITE_API=__declspec(dllexport)")
+else()
+ set(API "-DSQLITE_API=extern")
+endif()
+add_library(sqlite3 ${SOURCE}/sqlite3.c)
+
+
+target_compile_definitions(sqlite3 PRIVATE
+ $<$<CONFIG:Debug>:-DSQLITE_DEBUG>
+ ${API}
+ -DSQLITE_ENABLE_RTREE
+ -DSQLITE_ENABLE_UNLOCK_NOTIFY
+ )
+target_include_directories(sqlite3 INTERFACE $<INSTALL_INTERFACE:include>)
+
+if(VCPKG_CMAKE_SYSTEM_NAME MATCHES "WindowsStore")
target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1)
endif()
-install(TARGETS sqlite3
+install(TARGETS sqlite3 EXPORT sqlite3Config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES ${SOURCE}/sqlite3.h ${SOURCE}/sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
+install(EXPORT sqlite3Config DESTINATION share/sqlite3) \ No newline at end of file
diff --git a/ports/sqlite3/CONTROL b/ports/sqlite3/CONTROL
index 886051482..bc5b4af98 100644
--- a/ports/sqlite3/CONTROL
+++ b/ports/sqlite3/CONTROL
@@ -1,3 +1,3 @@
-Source: sqlite3
-Version: 3120200
+Source: sqlite3
+Version: 3.17.0
Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. \ No newline at end of file
diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake
index 9cdb67bb6..fdf4ec159 100644
--- a/ports/sqlite3/portfile.cmake
+++ b/ports/sqlite3/portfile.cmake
@@ -1,19 +1,27 @@
-include(vcpkg_common_functions)
-vcpkg_download_distfile(ARCHIVE
- URL "http://www.sqlite.org/2016/sqlite-amalgamation-3120200.zip"
- FILENAME "sqlite-amalgamation-3120200.zip"
- SHA512 92e1cc09dc4d4e9dd4c189e4a5061664f11971eb3e14c4c59e1f489f201411b08a31dae9e6fc50fffd49bb72f88ac3d99b7c7cd5e334b3079c165ee1c4f5a16e
-)
-vcpkg_extract_source_archive(${ARCHIVE})
-
-vcpkg_configure_cmake(
- SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR}
- OPTIONS
- -DSOURCE=${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3120200
-)
-
-vcpkg_build_cmake()
-vcpkg_install_cmake()
-
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
-vcpkg_copy_pdbs()
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3170000)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://sqlite.org/2017/sqlite-amalgamation-3170000.zip"
+ FILENAME "sqlite-amalgamation-3170000.zip"
+ SHA512 36dc05dbb21428237332e813181d4dd0c2ffaedb92a53934630c25421617afd9c1a65784665d222501f1b4b5c6445f425f8c512572a97e42603510dcc0796344
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DSOURCE=${SOURCE_PATH}
+)
+vcpkg_build_cmake()
+vcpkg_install_cmake()
+
+file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG)
+string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}")
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
+vcpkg_copy_pdbs()