Skip to content

Commit

Permalink
fix highfive in static builds.
Browse files Browse the repository at this point in the history
HDF5_USE_STATIC_LIBRARIES must be set in static builds so that find_package(HDF5) finds the static hdf5 libraries
  • Loading branch information
Neumann-A committed Mar 14, 2019
1 parent 7419fc9 commit 9ac08b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ports/highfive/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: highfive
Version: 1.5
Version: 1.5-1
Description: HighFive is a modern C++/C++11 friendly interface for libhdf5
Build-Depends: hdf5
8 changes: 8 additions & 0 deletions ports/highfive/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ vcpkg_from_github(
HEAD_REF master
)

if(${VCPKG_LIBRARY_LINKAGE} MATCHES "static")
set(HDF5_USE_STATIC_LIBRARIES ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -16,13 +20,17 @@ vcpkg_configure_cmake(
-DHIGHFIVE_EXAMPLES=OFF
-DUSE_BOOST=OFF
-DHIGH_FIVE_DOCUMENTATION=OFF
-DHDF5_USE_STATIC_LIBRARIES=${HDF5_USE_STATIC_LIBRARIES}
)

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/HighFive/CMake)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
if(NOT WIN32)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/HighFive)
endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/highfive RENAME copyright)

0 comments on commit 9ac08b3

Please sign in to comment.