use FIND_LIBRARY, bypass FindHDF5.cmake

This commit is contained in:
ousttrue 2017-07-30 09:19:13 +09:00
parent cdf5e78806
commit ec3858c6b1
2 changed files with 36 additions and 7 deletions

View File

@ -0,0 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce0a8e0..229fc77 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,7 +226,24 @@ INCLUDE_DIRECTORIES(${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY})
IF (USE_HDF5)
FIND_PACKAGE(ZLIB REQUIRED)
SET(ALEMBIC_WITH_HDF5 "1")
- INCLUDE("./cmake/AlembicHDF5.cmake")
+ #INCLUDE("./cmake/AlembicHDF5.cmake")
+ FIND_LIBRARY(HDF5_LIBRARIES_RELEASE
+ NAMES hdf5
+ PATHS ${HDF5_ROOT}/lib
+ )
+ MESSAGE(STATUS ${HDF5_LIBRARIES_RELEASE})
+ FIND_LIBRARY(HDF5_LIBRARIES_DEBUG
+ NAMES hdf5_D
+ PATHS ${HDF5_ROOT}/debug/lib
+ )
+ MESSAGE(STATUS ${HDF5_LIBRARIES_DEBUG})
+ SET(HDF5_LIBRARIES
+ optimized ${HDF5_LIBRARIES_RELEASE}
+ debug ${HDF5_LIBRARIES_DEBUG}
+ )
+ SET(HDF5_INCLUDE_DIRS
+ ${HDF5_ROOT}/include
+ )
INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DH5_USE_18_API")
ENDIF()

View File

@ -15,17 +15,16 @@ vcpkg_from_github(
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-hdf5link.patch
PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-hdf5link.patch
${CMAKE_CURRENT_LIST_DIR}/bypass-findhdf5.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DUSE_HDF5=ON
# work around for cmake-3.9 FindHDF5.cmake issue
# https://gitlab.kitware.com/cmake/cmake/issues/17039
-DHDF5_FOUND=1
-DHDF5_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include
-DHDF5_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/hdf5.lib
OPTIONS
-DUSE_HDF5=ON
-DHDF5_ROOT=${CURRENT_INSTALLED_DIR}
)
vcpkg_install_cmake()