From 7af85e2f3bb9d7036343954460bba9fb2bb7a44f Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 25 Apr 2022 14:25:29 +0200
Subject: [PATCH] [cmake] Install OpenGeoSys python module.

Add install dir to PYTHONPATH of the test ogs_python_module.

Fixes https://gitlab.opengeosys.org/ufz-bgr/hpc/docs/-/issues/18.
---
 Applications/CLI/CMakeLists.txt | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Applications/CLI/CMakeLists.txt b/Applications/CLI/CMakeLists.txt
index 7917577bc43..c8256c3c65f 100644
--- a/Applications/CLI/CMakeLists.txt
+++ b/Applications/CLI/CMakeLists.txt
@@ -67,6 +67,8 @@ if(OGS_USE_PYTHON)
             OpenGeoSys PRIVATE ApplicationsLib BaseLib GitInfoLib tclap
                                pybind11::pybind11
         )
+
+        install(TARGETS OpenGeoSys LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif()
 endif()
 
@@ -107,9 +109,13 @@ if(OGS_BUILD_PYTHON_MODULE AND NOT (WIN32 AND "${CMAKE_BUILD_TYPE}" STREQUAL
     )
     set_tests_properties(
         ogs_python_module
-        PROPERTIES LABELS "default" ENVIRONMENT_MODIFICATION
-                   PYTHONPATH=path_list_append:$<TARGET_FILE_DIR:OpenGeoSys>
-                   DISABLED $<NOT:$<TARGET_EXISTS:LiquidFlow>>
+        PROPERTIES
+            LABELS
+            "default"
+            ENVIRONMENT_MODIFICATION
+            PYTHONPATH=path_list_append:$<TARGET_FILE_DIR:OpenGeoSys>:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
+            DISABLED
+            $<NOT:$<TARGET_EXISTS:LiquidFlow>>
     )
 endif()
 # ---- Installation ----
-- 
GitLab