2020-10-14 07:13:13 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO sqlcipher/sqlcipher
|
2023-03-25 14:02:40 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 27dcc83c8088ea32a2bbc3d5493d070e29976dc54ccf91d849df67be19cb553761a32b3613e293a07f50128aeb808d54f363ad12a58a47f06a61a1cc4e1eb0cd
|
2020-10-14 07:13:13 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
# Don't use vcpkg_build_nmake, because it doesn't handle nmake targets correctly.
|
|
|
|
find_program(NMAKE nmake REQUIRED)
|
|
|
|
|
|
|
|
# Find tclsh Executable needed for Amalgamation of SQLite
|
|
|
|
file(GLOB TCLSH_CMD
|
|
|
|
${CURRENT_INSTALLED_DIR}/tools/tcl/bin/tclsh*${VCPKG_HOST_EXECUTABLE_SUFFIX}
|
|
|
|
)
|
|
|
|
file(TO_NATIVE_PATH "${TCLSH_CMD}" TCLSH_CMD)
|
|
|
|
file(TO_NATIVE_PATH "${SOURCE_PATH}" SOURCE_PATH_NAT)
|
|
|
|
|
|
|
|
# Determine TCL version (e.g. [path]tclsh90s.exe -> 90)
|
|
|
|
string(REGEX REPLACE ^.*tclsh "" TCLVERSION ${TCLSH_CMD})
|
|
|
|
string(REGEX REPLACE [A-Za-z]?${VCPKG_HOST_EXECUTABLE_SUFFIX}$ "" TCLVERSION ${TCLVERSION})
|
|
|
|
|
|
|
|
list(APPEND NMAKE_OPTIONS
|
|
|
|
TCLSH_CMD="${TCLSH_CMD}"
|
|
|
|
TCLVERSION=${TCLVERSION}
|
|
|
|
ORIGINAL_SRC="${SOURCE_PATH_NAT}"
|
|
|
|
EXT_FEATURE_FLAGS=-DSQLITE_TEMP_STORE=2\ -DSQLITE_HAS_CODEC
|
|
|
|
LTLIBS=libcrypto.lib
|
|
|
|
LTLIBPATHS=/LIBPATH:"${CURRENT_INSTALLED_DIR}/lib/"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
|
|
|
|
|
|
|
|
# Creating amalgamation files
|
|
|
|
message(STATUS "Pre-building ${TARGET_TRIPLET}")
|
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND ${NMAKE} -f Makefile.msc /A /NOLOGO clean tcl
|
2020-10-27 10:30:27 +08:00
|
|
|
${NMAKE_OPTIONS}
|
2022-08-11 02:34:50 +08:00
|
|
|
WORKING_DIRECTORY "${SOURCE_PATH}"
|
2020-10-14 07:13:13 +08:00
|
|
|
LOGNAME pre-build-${TARGET_TRIPLET}
|
|
|
|
)
|
|
|
|
message(STATUS "Pre-building ${TARGET_TRIPLET} done")
|
|
|
|
|
|
|
|
# The rest of the build process with the CMakeLists.txt is merely a copy of sqlite3
|
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION "${SOURCE_PATH}")
|
2020-10-14 07:13:13 +08:00
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2023-04-03 11:42:34 +08:00
|
|
|
geopoly WITH_GEOPOLY
|
|
|
|
json1 WITH_JSON1
|
|
|
|
fts5 WITH_FTS5
|
2020-10-14 07:13:13 +08:00
|
|
|
INVERTED_FEATURES
|
2023-04-03 11:42:34 +08:00
|
|
|
tool SQLITE3_SKIP_TOOLS
|
2020-10-14 07:13:13 +08:00
|
|
|
)
|
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-10-14 07:13:13 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSQLITE3_SKIP_TOOLS=ON
|
|
|
|
)
|
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME ${PORT} CONFIG_PATH share/${PORT})
|
2020-10-14 07:13:13 +08:00
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2020-10-14 07:13:13 +08:00
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
if(NOT SQLITE3_SKIP_TOOLS AND EXISTS "${CURRENT_PACKAGES_DIR}/tools/${PORT}/sqlcipher-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/${PORT}/sqlcipher-bin${VCPKG_HOST_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/sqlcipher${VCPKG_HOST_EXECUTABLE_SUFFIX}")
|
2020-10-14 07:13:13 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
2022-08-11 02:34:50 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/sqlcipher-config.in.cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/sqlcipher-config.cmake"
|
2020-10-14 07:13:13 +08:00
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
2022-08-11 02:34:50 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2020-10-14 07:13:13 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
2022-08-11 02:34:50 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
2023-07-19 03:27:38 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|