Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
.\conanrunenv-release-x86_64.ps1
ctest --extra-verbose --no-tests=error --output-on-failure
shell: pwsh
macos-10:
macos-11:
strategy:
matrix:
shared: ["shared", "static"]
Expand All @@ -181,7 +181,7 @@ jobs:
# "mpi",
"serial"
]
runs-on: macos-10.15
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ find_package(h5cpp REQUIRED)
.
.
add_executable(some_target some_code.cpp)
target_link_libraries(some_target h5cpp)
target_link_libraries(some_target h5cpp::h5cpp)
```
and adding the following:
```cpp
Expand Down
2 changes: 1 addition & 1 deletion doc/source/users_guide/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ the following :file:`CMakeLists.txt` fiel is sufficient

find_package(h5cpp REQUIRED)
add_executable(h5cpp_test main.cpp)
target_link_libraries(h5cpp_test h5cpp)
target_link_libraries(h5cpp_test h5cpp::h5cpp)

Despite the C++ language standard all dependencies are provided by
the package file via the imported target.
Expand Down
20 changes: 19 additions & 1 deletion src/h5cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,26 @@ else()
endif()
endif()

#
# remove the absolute path from the library name
#
set(H5CPP_INTERFACE_LIBS)
set(H5CPP_PRIVATE_LIBS ${HDF5_LIBRARIES})
foreach(HDF5_LIBRARY ${HDF5_LIBRARIES})
get_filename_component(LIB_NAME ${HDF5_LIBRARY} NAME)
list(APPEND H5CPP_INTERFACE_LIBS ${LIB_NAME})
endforeach()

set(H5CPP_HL_PRIVATE_LIBS ${HDF5_HL_LIBRARIES})
foreach(HDF5_LIBRARY ${HDF5_HL_LIBRARIES})
get_filename_component(LIB_NAME ${HDF5_LIBRARY} NAME)
list(APPEND H5CPP_INTERFACE_LIBS ${LIB_NAME})
endforeach()

target_include_directories(h5cpp
PRIVATE ${PROJECT_SOURCE_DIR}/src
PUBLIC ${HDF5_INCLUDE_DIRS}
PUBLIC ${MPI_CXX_INCLUDE_PATH}
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
Expand Down Expand Up @@ -97,7 +115,7 @@ if (TARGET SZIP::SZIP)
endif()

target_link_libraries(h5cpp
PUBLIC
PUBLIC
${H5CPP_LINKS}
hdf5::hdf5
PRIVATE ${COVERAGE_LIBRARIES}
Expand Down