Skip to content

Commit

Permalink
Merge pull request #209 from ess-dmsc/issue_198
Browse files Browse the repository at this point in the history
Issue 198
  • Loading branch information
Martin Shetty authored Jan 24, 2018
2 parents 15fe9a2 + e9a8bca commit ef8ca44
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ find_package(h5cpp REQUIRED)
.
.
add_executable(some_target some_code.cpp)
target_link_libraries(some_target h5cpp_shared)
target_link_libraries(some_target h5cpp)
```
and adding the following:
```cpp
Expand Down Expand Up @@ -125,7 +125,7 @@ cmake -DCMAKE_INSTALL_PREFIX=/home/user1/some/path ..
```
and accordingly, when building the client program:
```bash
cmake -Dh5cpp_DIR=/home/user1/some/path/lib/cmake/h5cpp-0.0.1 path/to/your/source
cmake -Dh5cpp_DIR=/home/user1/some/path/lib/cmake/h5cpp-0.0.4 path/to/your/source
```
where version number may vary.

Expand Down
6 changes: 3 additions & 3 deletions doc/design/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.0.1'
version = u'0.0.4'
# The full version, including alpha/beta/rc tags.
release = u'0.0.1'
release = u'0.0.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -137,7 +137,7 @@
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'h5++ library design v0.0.1'
# html_title = u'h5++ library design v0.0.4'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ html_theme = 'bizstyle'
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'h5++ v0.0.1'
# html_title = u'h5++ v0.0.4'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down
8 changes: 4 additions & 4 deletions doc/source/users_guide/using.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Using *h5cpp* with :program:`cmake`

*h5cpp* not only uses *CMake* as a build system but also provides
a *CMake* package which makes using the library with *CMake* quite simple.
The *CMake* package is installed below :file:`PREFIX/lib/cmake/h5cpp-0.0.1`
The *CMake* package is installed below :file:`PREFIX/lib/cmake/h5cpp-0.0.4`
where :envvar:`PREFIX` expands to the installation prefix used in the
inital cmake call of the installation procedure.

Expand Down Expand Up @@ -41,12 +41,12 @@ the following :file:`CMakeLists.txt` fiel is sufficient
cmake_minimum_required(VERSION 3.5.0)
project(h5cpp_test
LANGUAGES C CXX
VERSION 0.0.1)
VERSION 0.0.4)
set(CMAKE_CXX_STANDARD 11)
find_package(h5cpp REQUIRED)
add_executable(h5cpp_test main.cpp)
target_link_libraries(h5cpp_test h5cpp_shared)
target_link_libraries(h5cpp_test h5cpp)
Despite the C++ language standard all dependencies are provided by
the package file via the imported target.
Expand All @@ -56,7 +56,7 @@ You can build the code with
h5cpp_test:$ mkdir build
h5cpp_test:$ cd build
h5cpp_test:$ cmake -Dh5cpp_DIR=<INSTALLPREFIX>/lib/cmake/h5cpp-0.0.1 ../
h5cpp_test:$ cmake -Dh5cpp_DIR=<INSTALLPREFIX>/lib/cmake/h5cpp-0.0.4 ../
h5cpp_test:$ make
The cmake variable :envvar:`h5cpp_DIR` tells :program:`cmake` where to look
Expand Down
18 changes: 9 additions & 9 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ set(CMAKE_CXX_STANDARD 11)
find_package(h5cpp REQUIRED)

add_executable(basic_files basic_files.cpp)
target_link_libraries(basic_files h5cpp_shared)
target_link_libraries(basic_files h5cpp)

add_executable(selecting_datasets selecting_datasets.cpp)
target_link_libraries(selecting_datasets h5cpp_shared)
target_link_libraries(selecting_datasets h5cpp)

add_executable(writing_vector writing_vector.cpp)
target_link_libraries(writing_vector h5cpp_shared)
target_link_libraries(writing_vector h5cpp)

add_executable(writing_complex writing_complex.cpp)
target_link_libraries(writing_complex h5cpp_shared)
target_link_libraries(writing_complex h5cpp)

add_executable(writing_image writing_image.cpp
rgbpixel.cpp)
target_link_libraries(writing_image h5cpp_shared)
target_link_libraries(writing_image h5cpp)

#add_executable(write_single_vector write_single_vector.cpp)
#target_link_libraries(write_single_vector h5cpp_shared)
#target_link_libraries(write_single_vector h5cpp)

add_executable(append_scalar_data append_scalar_data.cpp)
target_link_libraries(append_scalar_data h5cpp_shared)
target_link_libraries(append_scalar_data h5cpp)

#add_executable(write_vector_list write_vector_list.cpp)
#target_link_libraries(write_vector_list h5cpp_shared)
#target_link_libraries(write_vector_list h5cpp)
add_executable(append_vector_data append_vector_data.cpp)
target_link_libraries(append_vector_data h5cpp_shared)
target_link_libraries(append_vector_data h5cpp)


add_custom_target(examples)
Expand Down
4 changes: 2 additions & 2 deletions examples/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

add_executable(writer_simple writer.cpp)
target_link_libraries(writer_simple h5cpp_shared)
target_link_libraries(writer_simple h5cpp)


add_executable(writer_extend writer_extend.cpp)
target_link_libraries(writer_extend h5cpp_shared)
target_link_libraries(writer_extend h5cpp)

add_dependencies(examples
writer_simple
Expand Down
4 changes: 2 additions & 2 deletions examples/swmr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
set(SWMR_SOURCES swmr_environment.cpp swmr_builder.cpp)
add_executable(swmr_write swmr_write.cpp ${SWMR_SOURCES})
target_link_libraries(swmr_write h5cpp_shared)
target_link_libraries(swmr_write h5cpp)

add_executable(swmr_read swmr_reader.cpp ${SWMR_SOURCES})
target_link_libraries(swmr_read h5cpp_shared)
target_link_libraries(swmr_read h5cpp)

add_dependencies(examples
swmr_write
Expand Down
2 changes: 1 addition & 1 deletion h5cpp-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ endif()
#
# load targets
#
include(${CMAKE_CURRENT_LIST_DIR}/h5cpp_shared_targets.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/h5cpp_targets.cmake)

#
# add the include directories for the HDF5 library
Expand Down
20 changes: 10 additions & 10 deletions src/h5cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ add_subdirectory(property)

add_doxygen_source_deps(${h5cpp_headers})

add_library(h5cpp_shared SHARED
add_library(h5cpp SHARED
${h5cpp_sources}
${h5cpp_headers}
)

target_compile_definitions(h5cpp_shared PRIVATE DLL_BUILD)
target_compile_definitions(h5cpp PRIVATE DLL_BUILD)
set(H5CPP_LINKS Boost::filesystem ${MPI_CXX_LIBRARIES})

#
Expand All @@ -37,7 +37,7 @@ foreach(HDF5_LIBRARY ${HDF5_LIBRARIES})
endforeach()


target_include_directories(h5cpp_shared
target_include_directories(h5cpp
PRIVATE ${PROJECT_SOURCE_DIR}/src
PRIVATE ${HDF5_INCLUDE_DIRS}
PUBLIC ${MPI_CXX_INCLUDE_PATH}
Expand All @@ -48,35 +48,35 @@ target_include_directories(h5cpp_shared
# THIS IS BAD
# NEED TO GET RID OF THIS
if (WITH_MPI)
target_compile_definitions(h5cpp_shared PUBLIC WITH_MPI)
target_compile_definitions(h5cpp PUBLIC WITH_MPI)
endif ()

set_target_properties(h5cpp_shared
set_target_properties(h5cpp
PROPERTIES
VERSION ${PROJECT_VERSION}
SO_VERSION 0
CXX_STANDARD_REQUIRED ON
OUTPUT_NAME h5cpp
)

enable_coverage(h5cpp_shared)
enable_coverage(h5cpp)

target_link_libraries(h5cpp_shared
target_link_libraries(h5cpp
PUBLIC ${H5CPP_LINKS}
PRIVATE ${COVERAGE_LIBRARIES} ${H5CPP_PRIVATE_LIBS}
INTERFACE ${H5CPP_INTERFACE_LIBS})

include(GNUInstallDirs) #Required for CMAKE_INSTALL_XXX

install(TARGETS h5cpp_shared
EXPORT h5cpp_shared_targets
install(TARGETS h5cpp
EXPORT h5cpp_targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT runtime
)

install(EXPORT h5cpp_shared_targets
install(EXPORT h5cpp_targets
DESTINATION ${CMAKE_INSTALL_PACKAGEDIR}
COMPONENT development)

Expand Down
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ add_executable(unit_tests
EXCLUDE_FROM_ALL
${test_sources}
${test_headers})
add_dependencies(unit_tests h5cpp_shared)
add_dependencies(unit_tests h5cpp)
target_include_directories(unit_tests
PRIVATE ${GTEST_INCLUDE_DIRS}
PRIVATE h5cpp_shared)
PRIVATE h5cpp)
target_link_libraries(unit_tests
h5cpp_shared
h5cpp
${GTEST_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${COVERAGE_LIBRARIES})
Expand Down

0 comments on commit ef8ca44

Please sign in to comment.