Commit b0f4efe3 authored by Stephen's avatar Stephen
Browse files

Hdf5 find_package changes

parent 5fe2ff0b
......@@ -31,8 +31,7 @@
"generator": "Visual Studio 16 2019",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{CONDA_PREFIX}",
"CONDA_BUILD": true,
"HDF5_ROOT": "$env{CONDA_PREFIX}/Library"
"CONDA_BUILD": true
}
},
{
......
......@@ -688,8 +688,6 @@ target_link_libraries(DataHandling
Mantid::Kernel
Mantid::Indexing
Mantid::Parallel
${HDF5_LIBRARIES}
${HDF5_HL_LIBRARIES}
PRIVATE
Mantid::Json
Boost::filesystem
......
......@@ -506,6 +506,13 @@ endif()
set_property(TARGET Kernel PROPERTY FOLDER "MantidFramework")
target_compile_features(Kernel PUBLIC cxx_std_17)
# if we are not on conda build ${HDF5_LIBRARIES} are full paths
# to the libs and not cmake targets, therefore we need
# to include the headers
if(NOT CONDA_BUILD)
target_include_directories(Kernel SYSTEM PUBLIC ${HDF5_INCLUDE_DIRS})
endif()
target_link_libraries(Kernel
PUBLIC
Mantid::Types
......
......@@ -99,10 +99,6 @@ endif()
find_package(Doxygen) # optional
# This is far more complicated than it has to be.
# The issue is the library is found in different ways on all three OS platforms
# Once we move to conda build we can just use the cmake finder...
# At the moment this is necessary so we can link to targets rather than a library list..
if(CMAKE_HOST_WIN32 AND NOT CONDA_BUILD)
find_package(ZLIB REQUIRED CONFIGS zlib-config.cmake)
set(HDF5_DIR "${THIRD_PARTY_DIR}/cmake/hdf5")
......@@ -117,16 +113,17 @@ elseif(CONDA_BUILD)
find_package(ZLIB REQUIRED)
find_package(
HDF5
MODULE
COMPONENTS C CXX HL
REQUIRED
)
set(HDF5_LIBRARIES hdf5::hdf5_cpp hdf5::hdf5)
set(HDF5_HL_LIBRARIES hdf5::hdf5_hl)
else()
# We'll use the cmake finder
else()
find_package(ZLIB REQUIRED)
find_package(
HDF5
MODULE
COMPONENTS C CXX HL
REQUIRED
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment