vcpkg/ports/rocksdb/portfile.cmake

52 lines
1.2 KiB
CMake
Raw Normal View History

2017-06-21 03:35:21 +08:00
include(vcpkg_common_functions)
find_program(GIT git)
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
message(FATAL_ERROR "Rocksdb only supports x64")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/rocksdb
2017-06-29 12:46:53 +08:00
REF 18c63af6ef2b9f014c404b88488ae52e6fead03c
SHA512 8dd4d27768feba6d9ddb61debe6cae21fa6d25c27dc347cba3b28cc39d2c1fa860dba7c8adedba4b40883eccccca190b60941cf958855c6b70ec5a3b96c20ac5
2017-06-21 03:35:21 +08:00
HEAD_REF master
)
2017-06-29 12:46:53 +08:00
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/fix-building-both-static-and-shared.patch"
"${CMAKE_CURRENT_LIST_DIR}/fix-third-party-deps.patch"
2017-06-21 03:35:21 +08:00
)
2017-06-29 13:10:09 +08:00
if(VCPKG_CRT_LINKAGE STREQUAL static)
set(WITH_MD_LIBRARY OFF)
else()
set(WITH_MD_LIBRARY ON)
endif()
2017-06-21 05:00:27 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
2017-06-29 12:46:53 +08:00
PREFER_NINJA
2017-06-21 05:00:27 +08:00
OPTIONS
-DGIT_EXECUTABLE=${GIT}
-DGFLAGS=1
-DSNAPPY=1
-DLZ4=1
-DZLIB=1
-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}
2017-06-29 12:46:53 +08:00
-DFAIL_ON_WARNINGS=OFF
2017-06-29 13:10:09 +08:00
-DWITH_MD_LIBRARY=${WITH_MD_LIBRARY}
2017-06-29 12:46:53 +08:00
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
2017-06-21 05:00:27 +08:00
)
2017-06-21 03:35:21 +08:00
2017-06-29 12:46:53 +08:00
vcpkg_install_cmake(DISABLE_PARALLEL)
2017-06-21 03:35:21 +08:00
2017-06-29 12:46:53 +08:00
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/rocksdb RENAME copyright)
2017-06-29 12:53:09 +08:00
vcpkg_copy_pdbs()