Skip to content

Commit

Permalink
[cmake] update to 3.19.2 (#14716)
Browse files Browse the repository at this point in the history
* [cmake] update to 3.19.0

* update vmss

* [cmake] update to 3.19.1

* [solid3] Fix configure error, fix static definition

* [flann] Add feature hdf5 and fix it

* [highfive] Fix dependency hdf5

* [simage] Fix configure error

* [aws-c-common] Fix configure error

* [cmake] Update to 3.19.2

* Revert changes about cmake bug

* [VMSS] Update cmake path on Windows

* [cmake] Update cmake hash

* [minc] Fix dependency hdf5

* [cmake] Update cmake package name and path on MacOS

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
  • Loading branch information
JackBoosY and BillyONeal committed Dec 29, 2020
1 parent 580da70 commit 8f8f716
Show file tree
Hide file tree
Showing 11 changed files with 141 additions and 23 deletions.
7 changes: 6 additions & 1 deletion ports/flann/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Source: flann
Version: 2019-04-07-1
Version: 2019-04-07
Port-Version: 1
Homepage: https://github.com/mariusmuja/flann
Build-Depends: lz4
Description: Fast Library for Approximate Nearest Neighbors

Feature: hdf5
Build-Depends: hdf5
Description: Build with hdf5
53 changes: 53 additions & 0 deletions ports/flann/fix-dependency-hdf5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ff331a..155cabe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,11 +75,17 @@ if (NOT PYTHON_EXECUTABLE)
endif()
endif()

+if (WITH_HDF5)
find_hdf5()
-if (NOT HDF5_FOUND)
- message(WARNING "hdf5 library not found, some tests will not be run")
+if (NOT hdf5_FOUND)
+ message(ERROR "hdf5 library not found")
else()
- include_directories(${HDF5_INCLUDE_DIR})
+ if (TARGET hdf5::hdf5-shared)
+ link_libraries(hdf5::hdf5-shared)
+ elseif (TARGET hdf5::hdf5-static)
+ link_libraries(hdf5::hdf5-static)
+ endif()
+endif()
endif()

if (USE_MPI OR HDF5_IS_PARALLEL)
diff --git a/cmake/flann_utils.cmake b/cmake/flann_utils.cmake
index 8aef8e0..747414f 100644
--- a/cmake/flann_utils.cmake
+++ b/cmake/flann_utils.cmake
@@ -21,21 +21,8 @@ endmacro(DISSECT_VERSION)

# workaround a FindHDF5 bug
macro(find_hdf5)
- find_package(HDF5)
-
- set( HDF5_IS_PARALLEL FALSE )
- foreach( _dir ${HDF5_INCLUDE_DIRS} )
- if( EXISTS "${_dir}/H5pubconf.h" )
- file( STRINGS "${_dir}/H5pubconf.h"
- HDF5_HAVE_PARALLEL_DEFINE
- REGEX "HAVE_PARALLEL 1" )
- if( HDF5_HAVE_PARALLEL_DEFINE )
- set( HDF5_IS_PARALLEL TRUE )
- endif()
- endif()
- endforeach()
- set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
- "HDF5 library compiled with parallel IO support" )
+ find_package(hdf5 CONFIG)
+ set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL})
mark_as_advanced( HDF5_IS_PARALLEL )
endmacro(find_hdf5)

13 changes: 9 additions & 4 deletions ports/flann/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ vcpkg_from_github(
REF 1d04523268c388dabf1c0865d69e1b638c8c7d9d
SHA512 61e322222c2daa0b9677095e5ca231cba7c305ce754ad8e659eee350111c1e04351181c3af04e45ab6e5c9edea49c7b9ec6499bb0dbc080b87af36eb11c6ef7c
HEAD_REF master
PATCHES fix-build-error.patch
PATCHES
fix-build-error.patch
fix-dependency-hdf5.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
hdf5 WITH_HDF5
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS
OPTIONS ${FEATURE_OPTIONS}
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTS=OFF
-DBUILD_DOC=OFF
Expand All @@ -31,5 +37,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/flann/COPYING ${CURRENT_PACKAGES_DIR}/share/flann/copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/flann RENAME copyright)
1 change: 1 addition & 0 deletions ports/highfive/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: highfive
Version: 2.2.2
Port-Version: 1
Homepage: https://github.com/BlueBrain/HighFive
Description: HighFive is a modern C++/C++11 friendly interface for libhdf5
Build-Depends: hdf5
Expand Down
19 changes: 19 additions & 0 deletions ports/highfive/fix-dependency-hdf5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/CMake/HighFiveTargetDeps.cmake b/CMake/HighFiveTargetDeps.cmake
index f76e1d3..06ac647 100644
--- a/CMake/HighFiveTargetDeps.cmake
+++ b/CMake/HighFiveTargetDeps.cmake
@@ -8,7 +8,13 @@ add_library(libdeps INTERFACE)
if(NOT DEFINED HDF5_C_LIBRARIES)
set(HDF5_NO_FIND_PACKAGE_CONFIG_FILE TRUE) # Consistency
set(HDF5_PREFER_PARALLEL ${HIGHFIVE_PARALLEL_HDF5})
- find_package(HDF5 REQUIRED)
+ find_package(hdf5 CONFIG REQUIRED)
+ set(HIGHFIVE_PARALLEL_HDF5 ${HDF5_ENABLE_PARALLEL})
+ if (TARGET hdf5::hdf5-shared)
+ set(HDF5_C_LIBRARIES hdf5::hdf5-shared)
+ elseif (TARGET hdf5::hdf5-static)
+ set(HDF5_C_LIBRARIES hdf5::hdf5-static)
+ endif()
endif()

if(HIGHFIVE_PARALLEL_HDF5 AND NOT HDF5_IS_PARALLEL)
1 change: 1 addition & 0 deletions ports/highfive/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ vcpkg_from_github(
REF v2.2.2
SHA512 7e562951b18425f1bfc96c30d0e47b6d218830417a732856a27943cd7ee6feab54d833b94aa303c40ca5038ac1aaf0eadd8c61800ffe82b6da46a465b21b1fc4
HEAD_REF master
PATCHES fix-dependency-hdf5.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
1 change: 1 addition & 0 deletions ports/minc/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: minc
Version: 2.4.03
Port-Version: 1
Description: MINC - Medical Image NetCDF or MINC isn't netCDF
Homepage: https://github.com/BIC-MNI/libminc
Build-Depends: nifticlib, hdf5[core], zlib
Expand Down
31 changes: 31 additions & 0 deletions ports/minc/fix-dependency-hdf5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a6830b4..da3d635 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,12 @@ IF(NOT LIBMINC_EXTERNALLY_CONFIGURED)
# external packages
FIND_PACKAGE(ZLIB REQUIRED)
SET(HDF5_NO_FIND_PACKAGE_CONFIG_FILE ON)
- FIND_PACKAGE(HDF5 REQUIRED COMPONENTS C )
+ FIND_PACKAGE(hdf5 CONFIG REQUIRED)
+ if (TARGET hdf5::hdf5-shared)
+ SET(HDF5_LIBRARIES hdf5::hdf5-shared)
+ elseif (TARGET hdf5::hdf5-static)
+ SET(HDF5_LIBRARIES hdf5::hdf5-static)
+ endif()

IF (LIBMINC_USE_SYSTEM_NIFTI)
FIND_PACKAGE(NIFTI)
@@ -515,12 +520,8 @@ IF(SUPERBUILD_STAGING_PREFIX)
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" LIBMINC_LIBRARIES_CONFIG "${LIBMINC_LIBRARIES_CONFIG}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" EZMINC_LIBRARIES "${EZMINC_LIBRARIES}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" NETCDF_INCLUDE_DIR "${NETCDF_INCLUDE_DIR}")
- STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIR}")
- STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" HDF5_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" NIFTI_INCLUDE_DIR "${NIFTI_INCLUDE_DIR}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" NETCDF_LIBRARY "${NETCDF_LIBRARY}")
- STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" HDF5_LIBRARY "${HDF5_LIBRARY}")
- STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" HDF5_LIBRARIES "${HDF5_LIBRARIES}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" NIFTI_LIBRARY "${NIFTI_LIBRARY}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" ZNZ_LIBRARY "${ZNZ_LIBRARY}")
STRING(REPLACE "${SUPERBUILD_STAGING_PREFIX}/" "" ZLIB_LIBRARY "${ZLIB_LIBRARY}")
6 changes: 4 additions & 2 deletions ports/minc/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ vcpkg_from_github(
REF e75a936c12a305b596d743c26a5437196ebce2a4
SHA512 744f879ac8f0594c310d1c1b7fe67543c5feeb3e5a0979035918dbb2bf1d0973fbd389e5357a75631e618cc614b648c21179f7467576bd68e3522e63f21451b0
HEAD_REF master
PATCHES build.patch
config.patch
PATCHES
build.patch
config.patch
fix-dependency-hdf5.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion scripts/azure-pipelines/windows/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
:: TRANSITION, get these tools on the VMs next time we roll them
.\vcpkg.exe fetch cmake
.\vcpkg.exe fetch ninja
set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.18.4-windows\cmake-3.18.4-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.1-windows;%PATH%
set PATH=${{ variables.VCPKG_DOWNLOADS }}\tools\cmake-3.19.2-windows\cmake-3.19.2-win32-x86\bin;${{ variables.VCPKG_DOWNLOADS }}\tools\ninja-1.10.1-windows;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86
rmdir /s /q build.x86.debug > nul 2> nul
cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.x86.debug -S toolsrc
Expand Down
30 changes: 15 additions & 15 deletions scripts/vcpkgTools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
<archiveName>python-3.8.3-embed-win32.zip</archiveName>
</tool>
<tool name="cmake" os="windows">
<version>3.18.4</version>
<exeRelativePath>cmake-3.18.4-win32-x86\bin\cmake.exe</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-win32-x86.zip</url>
<sha512>77ab5b4720c5212cf477100588a20002f7f99a609ad5d5ffef4c163345d366ce9be98280c4f02ecb583d070668a8eb8a2b0baabd266f10c53589aac250f67f28</sha512>
<archiveName>cmake-3.18.4-win32-x86.zip</archiveName>
<version>3.19.2</version>
<exeRelativePath>cmake-3.19.2-win32-x86\bin\cmake.exe</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-win32-x86.zip</url>
<sha512>1ed3706d8dd5c5244ceb4c22443f006fcb9ffa76cb6d9ebdbbb8f11a50deb3f92a9a4080ff3fd125f79c0143f553ea0c02a6a2d27521438705c2fea4dd97d239</sha512>
<archiveName>cmake-3.19.2-win32-x86.zip</archiveName>
</tool>
<tool name="cmake" os="osx">
<version>3.18.4</version>
<exeRelativePath>cmake-3.18.4-Darwin-x86_64/CMake.app/Contents/bin/cmake</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Darwin-x86_64.tar.gz</url>
<sha512>76efc2fc3562ae4087cb9f169dff5b18253402ec4afdfcf8b818f724efaab2c4aacb1baa5fe77db268413964b4272c91eed789991951ea11eeb67332be5a4c5b</sha512>
<archiveName>cmake-3.18.4-Darwin-x86_64.tar.gz</archiveName>
<version>3.19.2</version>
<exeRelativePath>cmake-3.19.2-macos-universal/CMake.app/Contents/bin/cmake</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-macos-universal.tar.gz</url>
<sha512>031196439a26d6ff2a1f42830ca26b5159752dc2c2c889a4e304327c858157b68088905b10727090918c3605fe7fe429aa19d46e68ed30c17d4d89b3d209aae8</sha512>
<archiveName>cmake-3.19.2-macos-universal.tar.gz</archiveName>
</tool>
<tool name="cmake" os="linux">
<version>3.18.4</version>
<exeRelativePath>cmake-3.18.4-Linux-x86_64/bin/cmake</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4-Linux-x86_64.tar.gz</url>
<sha512>8be5c00dfb00597daae448060fcc612c5e5f0ff9483eb6786cd1c4123cadf15bf2bec1c7892c59792947188889d5a07a9df34190366636c9b8cea4bb1bc7454f</sha512>
<archiveName>cmake-3.18.4-Linux-x86_64.tar.gz</archiveName>
<version>3.19.2</version>
<exeRelativePath>cmake-3.19.2-Linux-x86_64/bin/cmake</exeRelativePath>
<url>https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-Linux-x86_64.tar.gz</url>
<sha512>67ea7ee428e6c93039646d6d0cbe84c0be337a2b878487635fee71ec2c8992a9078a660e6b793ef11ce13530def44a16b716af96e10a97675d014a26caa0aed4</sha512>
<archiveName>cmake-3.19.2-Linux-x86_64.tar.gz</archiveName>
</tool>
<tool name="cmake" os="freebsd">
<version>3.12.4</version>
Expand Down

0 comments on commit 8f8f716

Please sign in to comment.