2017-06-12 05:26:22 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-06-17 11:05:52 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO mariusmuja/flann
|
|
|
|
REF 1.9.1
|
|
|
|
SHA512 0da78bb14111013318160dd3dee1f93eb6ed077b18439fd6496017b62a8a6070cc859cfb3e08dad4c614e48d9dc1da5f7c4a21726ee45896d360506da074a6f7
|
2017-06-17 12:43:00 +08:00
|
|
|
HEAD_REF master
|
2017-06-12 05:26:22 +08:00
|
|
|
)
|
|
|
|
|
2017-06-16 22:23:37 +08:00
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-06-17 12:09:44 +08:00
|
|
|
PATCHES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/fix-install-flann.patch
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/Revert-fix-install-flann.patch
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/export-all-symbols-of-flann-cpp.patch
|
2017-06-16 22:23:37 +08:00
|
|
|
)
|
|
|
|
|
2017-06-12 05:26:22 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-06-17 12:43:00 +08:00
|
|
|
PREFER_NINJA
|
2017-06-16 22:23:37 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_DOC=OFF
|
|
|
|
-DBUILD_PYTHON_BINDINGS=OFF
|
|
|
|
-DBUILD_MATLAB_BINDINGS=OFF
|
2017-07-13 15:40:37 +08:00
|
|
|
-DCMAKE_DEBUG_POSTFIX=-gd
|
2017-08-12 06:25:45 +08:00
|
|
|
-DHDF5_NO_FIND_PACKAGE_CONFIG_FILE=ON
|
2017-06-12 05:26:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-06-16 15:52:59 +08:00
|
|
|
|
2018-05-15 17:47:16 +08:00
|
|
|
if(MSVC)
|
|
|
|
set(LIB_PREFIX "")
|
|
|
|
set(LIB_SUFFIX ".lib")
|
|
|
|
else()
|
|
|
|
set(LIB_PREFIX "lib")
|
|
|
|
set(LIB_SUFFIX ".a")
|
|
|
|
endif()
|
|
|
|
|
2017-06-16 17:16:10 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2018-05-15 17:47:16 +08:00
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann-gd${LIB_SUFFIX})
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_cpp${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_cpp-gd${LIB_SUFFIX})
|
2017-07-15 05:11:53 +08:00
|
|
|
|
2018-05-15 17:47:16 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_s${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann${LIB_SUFFIX})
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_s-gd${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann-gd${LIB_SUFFIX})
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_cpp_s${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_cpp${LIB_SUFFIX})
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_cpp_s-gd${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_cpp-gd${LIB_SUFFIX})
|
2017-06-17 12:14:29 +08:00
|
|
|
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2018-05-15 17:47:16 +08:00
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_s${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_s-gd${LIB_SUFFIX})
|
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/${LIB_PREFIX}flann_cpp_s${LIB_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/lib/${LIB_PREFIX}flann_cpp_s-gd${LIB_SUFFIX})
|
2017-06-16 17:16:10 +08:00
|
|
|
endif()
|
|
|
|
|
2017-06-12 05:26:22 +08:00
|
|
|
# Handle copyright
|
2017-06-17 11:05:52 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann)
|
2017-06-16 15:52:59 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/flann/COPYING ${CURRENT_PACKAGES_DIR}/share/flann/copyright)
|