Skip to content

Commit

Permalink
Renamed COPY and RESOLVE h5gt deps
Browse files Browse the repository at this point in the history
  • Loading branch information
kerim371 committed Jun 17, 2022
1 parent b5c5f70 commit cc11a0b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ matrix:
- HDF5_PREFER_PARALLEL=True
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS=""
- COPY_H5GTPY_RUNTIME_DEPS=True
- H5GTPY_COPY_RUNTIME_DEPS=True
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Ninja"
- TESTS_TARGET="test"
Expand All @@ -41,7 +41,7 @@ matrix:
- HDF5_PREFER_PARALLEL=True
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS=""
- COPY_H5GTPY_RUNTIME_DEPS=True
- H5GTPY_COPY_RUNTIME_DEPS=True
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Ninja"
- TESTS_TARGET="test"
Expand All @@ -65,7 +65,7 @@ matrix:
- HDF5_PREFER_PARALLEL=True
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS=""
- COPY_H5GTPY_RUNTIME_DEPS=False
- H5GTPY_COPY_RUNTIME_DEPS=False
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Ninja"
- TESTS_TARGET="test"
Expand All @@ -86,7 +86,7 @@ matrix:
- HDF5_PREFER_PARALLEL=False
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS="C:/Tools/miniconda3/Library/bin"
- COPY_H5GTPY_RUNTIME_DEPS=True
- H5GTPY_COPY_RUNTIME_DEPS=True
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
- TESTS_TARGET="RUN_TESTS"
Expand All @@ -102,7 +102,7 @@ matrix:
- HDF5_PREFER_PARALLEL=False
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS="C:/Tools/miniconda3/Library/bin"
- COPY_H5GTPY_RUNTIME_DEPS=False
- H5GTPY_COPY_RUNTIME_DEPS=False
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
- TESTS_TARGET="RUN_TESTS"
Expand All @@ -120,7 +120,7 @@ matrix:
- HDF5_PREFER_PARALLEL=False
- H5GT_BUILD_h5gtpy=True
- HDF5_RUNTIME_DIRS="/Users/travis/miniconda/bin"
- COPY_H5GTPY_RUNTIME_DEPS=False
- H5GTPY_COPY_RUNTIME_DEPS=False
- HDF5_USE_STATIC_LIBRARIES=False
- CMAKE_GENERATOR="Ninja"
- TESTS_TARGET="test"
Expand Down Expand Up @@ -182,7 +182,7 @@ script:
-DHDF5_PREFER_PARALLEL:BOOL=${HDF5_PREFER_PARALLEL}
-DH5GT_BUILD_h5gtpy=${H5GT_BUILD_h5gtpy}
-DHDF5_RUNTIME_DIRS=${HDF5_RUNTIME_DIRS}
-DCOPY_H5GTPY_RUNTIME_DEPS=${COPY_H5GTPY_RUNTIME_DEPS}
-DH5GTPY_COPY_RUNTIME_DEPS=${H5GTPY_COPY_RUNTIME_DEPS}
-DHDF5_USE_STATIC_LIBRARIES=${HDF5_USE_STATIC_LIBRARIES}
-G "${CMAKE_GENERATOR}" ../
- cmake --build . --config Release -j
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cmake ..
-DEigen3_ROOT=/path/to/eigen3
-DHDF5_DIR=/path/to/hdf5-config.cmake
-DHDF5_RUNTIME_DIRS=/path/to/hdf5-runtime
-DZLIB_RUNTIME_DIRS=/path/to/zlib-runtime -DCOPY_H5GTPY_RUNTIME_DEPS=ON
-DZLIB_RUNTIME_DIRS=/path/to/zlib-runtime -DH5GTPY_COPY_RUNTIME_DEPS=ON
cmake --build .
```
If your HDF5 depends on ZLIB or MPI you may also need to add it.
Expand Down
10 changes: 5 additions & 5 deletions cmake/h5gtpy-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(COMMON_PROJECT_VERSION @COMMON_PROJECT_VERSION@)
#-----------------------------------------------------------------------------
# Finding RUNTIME DEPS (i.e. hdf5.dll)
#-----------------------------------------------------------------------------
if(@RESOLVE_H5GTPY_RUNTIME_DEPS@)
if(@H5GTPY_RESOLVE_RUNTIME_DEPS@)

message(STATUS "Resolving h5gtpy RUNTIME dependencies...")

Expand Down Expand Up @@ -74,7 +74,7 @@ if(@RESOLVE_H5GTPY_RUNTIME_DEPS@)
(you don't have to rebuild the project)")
endif()

endif(@RESOLVE_H5GTPY_RUNTIME_DEPS@)
endif(@H5GTPY_RESOLVE_RUNTIME_DEPS@)

#-----------------------------------------------------------------------------
# Setting variables needed to configure in-files
Expand Down Expand Up @@ -107,10 +107,10 @@ set(TEST_PY_OUT_DIR "${H5GTPY_DIR}/tests")
# Configuring in-files
#-----------------------------------------------------------------------------

if(@RESOLVE_H5GTPY_RUNTIME_DEPS@)
if(@H5GTPY_RESOLVE_RUNTIME_DEPS@)

# copy runtime deps or change __init__.py file to modify ENV PATH
if(@COPY_H5GTPY_RUNTIME_DEPS@)
if(@H5GTPY_COPY_RUNTIME_DEPS@)
foreach(_file ${res_deps})
message("Copying runtime dependency:\t${_file} \nto:\t${H5GTPY_DIR}")
configure_file("${_file}" "${H5GTPY_DIR}" COPYONLY)
Expand Down Expand Up @@ -138,7 +138,7 @@ if not os.environ['PATH'].__contains__('${_dir}'):
endif()
endif()

endif(@RESOLVE_H5GTPY_RUNTIME_DEPS@)
endif(@H5GTPY_RESOLVE_RUNTIME_DEPS@)

configure_file("${SETUP_PY_IN}" "${SETUP_PY_OUT}")
configure_file("${MANIFEST_IN}" "${MANIFEST_OUT}")
Expand Down
4 changes: 2 additions & 2 deletions src/h5gtpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ message("project: ${PROJECT_NAME} ${COMMON_PROJECT_VERSION}")

set(HDF5_RUNTIME_DIRS "" CACHE PATH "hdf5 runtime is a dependency of h5gtpy")
set(ZLIB_RUNTIME_DIRS "" CACHE PATH "zlib runtime is an optional dependency of hdf5")
option(COPY_H5GTPY_RUNTIME_DEPS "Copy hdf5 (and maybe zlib) runtime to python site-packages
option(H5GTPY_COPY_RUNTIME_DEPS "Copy hdf5 (and maybe zlib) runtime to python site-packages
(otherwise it will simply add to ENV PATH to hdf5 runtime dir in `__init__.py`)" OFF)
option(RESOLVE_H5GTPY_RUNTIME_DEPS "If OFF then nothing will be done to resolve deps" ON)
option(H5GTPY_RESOLVE_RUNTIME_DEPS "If OFF then nothing will be done to resolve deps" ON)

include(FetchContent)
FetchContent_Declare(
Expand Down

0 comments on commit cc11a0b

Please sign in to comment.