Commit fa6d1912 authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

add installation instructions with CMake

1 merge request!2refactor structure and proper cmake instructions
Pipeline #42448 passed with stage
in 2 minutes and 56 seconds
Showing with 60 additions and 1 deletion
+60 -1
......@@ -76,4 +76,47 @@ endif()
# installation
# ------------------------------------------------------------------------------
# TODO
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
# install library file (.a/.so)
install(
TARGETS evalhyd
EXPORT evalhyd-targets
)
# install headers
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/evalhyd"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING PATTERN "*.hpp"
)
# generate target file
export(
EXPORT evalhyd-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/EvalHydTargets.cmake"
)
# install target file
install(
EXPORT evalhyd-targets
FILE "EvalHydTargets.cmake"
NAMESPACE EvalHyd::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/EvalHyd
)
# generate config file
configure_package_config_file(
EvalHydConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/EvalHydConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/EvalHyd
)
# install files
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/EvalHydConfig.cmake"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/EvalHyd"
)
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# find public dependencies
find_dependency(xtensor @xtensor_VERSION@)
if(NOT TARGET EvalHyd::evalhyd)
include("${CMAKE_CURRENT_LIST_DIR}/EvalHydTargets.cmake")
endif()
......@@ -20,3 +20,9 @@ Run tests with:
```shell
./build/tests/evalhyd_tests
```
## How to install
```shell
cmake --install build/ --prefix <path>
```
Supports Markdown
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