Skip to content

Commit 9c3aa8e

Browse files
authored
Remove HDF5 hack (#64)
1 parent 43439c3 commit 9c3aa8e

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ else(HYDROCHRONO_ENABLE_IRRLICHT)
6363
find_package(Chrono CONFIG REQUIRED)
6464
endif(HYDROCHRONO_ENABLE_IRRLICHT)
6565

66-
find_package(HDF5 NAMES hdf5 COMPONENTS CXX ${SEARCH_TYPE})
66+
set(HDF5_USE_STATIC_LIBRARIES ON)
67+
find_package(HDF5 REQUIRED COMPONENTS CXX)
6768

6869

6970
#-----------------------------------------------------------------------------
@@ -113,11 +114,12 @@ target_include_directories(
113114
PUBLIC
114115
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
115116
$<INSTALL_INTERFACE:include>
116-
${CHRONO_INCLUDE_DIRS}
117+
${CHRONO_INCLUDE_DIRS}
117118

118119
PRIVATE
119120
${CMAKE_CURRENT_SOURCE_DIR}/
120121
${CMAKE_CURRENT_SOURCE_DIR}/include
122+
${HDF5_INCLUDE_DIRS}
121123
)
122124

123125
target_compile_definitions(HydroChrono
@@ -143,18 +145,11 @@ set_target_properties(HydroChrono
143145
POSITION_INDEPENDENT_CODE ON
144146
)
145147
146-
# temporary hack
147-
# seems there is no namespace target hdf5:: on linux
148-
# for HDF5 version 1.10 to 1.14 ?
149-
if(NOT TARGET hdf5::hdf5_cpp-static)
150-
add_library(hdf5::hdf5_cpp-static ALIAS hdf5_cpp-static)
151-
endif()
152-
153148
target_link_libraries(HydroChrono
154149
PUBLIC
155150
${CHRONO_LIBRARIES}
156151
PRIVATE
157-
hdf5::hdf5_cpp-static
152+
${HDF5_LIBRARIES}
158153
159154
)
160155
@@ -183,9 +178,6 @@ target_include_directories(
183178
${CHRONO_INCLUDE_DIRS}
184179
)
185180
186-
if(HYDROCHRONO_ENABLE_IRRLICHT)
187-
endif(HYDROCHRONO_ENABLE_IRRLICHT)
188-
189181
target_compile_options(HydroChronoGUI BEFORE
190182
PUBLIC
191183
${CHRONO_CXX_FLAGS}

0 commit comments

Comments
 (0)