vcpkg/ports/sqlite3/portfile.cmake

62 lines
2.2 KiB
CMake
Raw Normal View History

# Be sure to update both of these versions together.
set(SQLITE_VERSION 3360000)
set(PKGCONFIG_VERSION 3.36.0)
set(SQLITE_HASH 5c18f158a599b1e91d95c91de3aa5c5de52f986845ad0cb49dfd56b650587e55e24d469571b5b864229b870d0eaf85d78893f61ef950b95389cb41692be37f58)
2017-04-02 04:35:22 +08:00
2017-02-15 20:14:37 +08:00
vcpkg_download_distfile(ARCHIVE
URLS "https://sqlite.org/2021/sqlite-amalgamation-${SQLITE_VERSION}.zip"
2017-04-02 04:35:22 +08:00
FILENAME "sqlite-amalgamation-${SQLITE_VERSION}.zip"
SHA512 ${SQLITE_HASH}
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${SQLITE_VERSION}
PATCHES fix-arm-uwp.patch
)
2017-02-15 20:14:37 +08:00
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/sqlite3.pc.in" DESTINATION "${SOURCE_PATH}")
2017-02-15 20:14:37 +08:00
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
geopoly WITH_GEOPOLY
json1 WITH_JSON1
INVERTED_FEATURES
tool SQLITE3_SKIP_TOOLS
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DPKGCONFIG_VERSION=${PKGCONFIG_VERSION}
OPTIONS_DEBUG
-DSQLITE3_SKIP_TOOLS=ON
2017-02-15 20:14:37 +08:00
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH share/unofficial-${PORT})
2017-02-15 20:14:37 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
2017-02-15 20:14:37 +08:00
if(NOT SQLITE3_SKIP_TOOLS AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}")
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/sqlite3-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/sqlite3${VCPKG_HOST_EXECUTABLE_SUFFIX}")
endif()
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake"
"${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake"
@ONLY
)
vcpkg_fixup_pkgconfig()
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sqlite3.h" "# define SQLITE_API\n" "# define SQLITE_API __declspec(dllimport)\n")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")
2020-06-02 07:00:57 +08:00
vcpkg_copy_pdbs()