From 47afdd55f16d022dfa9331a4be30a696261e0741 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 23 Sep 2024 11:51:19 +0200
Subject: [PATCH] [cmake,web] Don't overwrite --preset wheel in usage
 instructions.

---
 Applications/Python/CMakeLists.txt                       | 8 ++++++++
 Applications/Python/ogs/CMakeLists.txt                   | 6 +-----
 web/content/docs/devguide/advanced/python-wheel/index.md | 4 +---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Applications/Python/CMakeLists.txt b/Applications/Python/CMakeLists.txt
index b15a9c06c75..c2289b3f7f2 100644
--- a/Applications/Python/CMakeLists.txt
+++ b/Applications/Python/CMakeLists.txt
@@ -8,6 +8,14 @@ if(NOT OGS_BUILD_WHEEL)
     set(_py_build_location "${PROJECT_BINARY_DIR}/site-packages/ogs")
 endif()
 
+if(SKBUILD AND NOT OGS_BUILD_WHEEL)
+    message(
+        FATAL_ERROR
+            "Invalid configuration! Don't use --config-settings=cmake.args!"
+            "Use --config-settings=cmake.define instead or supply '--preset wheel` to cmake.args"
+    )
+endif()
+
 add_subdirectory(ogs)
 add_subdirectory(ogs.simulator)
 add_subdirectory(ogs.mesh)
diff --git a/Applications/Python/ogs/CMakeLists.txt b/Applications/Python/ogs/CMakeLists.txt
index 4bc85db8bab..3ad6f8f73ef 100644
--- a/Applications/Python/ogs/CMakeLists.txt
+++ b/Applications/Python/ogs/CMakeLists.txt
@@ -7,11 +7,7 @@ string(REPLACE ";" "\n" _config_content "${_config_content}")
 set(_config_file ${PROJECT_BINARY_DIR}/site-packages/ogs/config.py)
 file(CONFIGURE OUTPUT ${_config_file} CONTENT "${_config_content}")
 
-if(OGS_BUILD_WHEEL)
-    install(FILES ${_config_file} DESTINATION ${SKBUILD_PLATLIB_DIR}/ogs)
-else()
-    install(FILES ${_config_file} DESTINATION ${_py_install_location})
-endif()
+install(FILES ${_config_file} DESTINATION ${_py_install_location})
 
 if(OGS_BUILD_WHEEL)
     return()
diff --git a/web/content/docs/devguide/advanced/python-wheel/index.md b/web/content/docs/devguide/advanced/python-wheel/index.md
index ca6f351dd68..0771bab58bb 100644
--- a/web/content/docs/devguide/advanced/python-wheel/index.md
+++ b/web/content/docs/devguide/advanced/python-wheel/index.md
@@ -53,9 +53,7 @@ pip install -v .[test]
 Successfully installed ogs-6.4.2.dev1207
 
 # To build with additional CMake arguments, e.g.:
-CMAKE_ARGS="-DOGS_BUILD_PROCESSES=SteadyStateDiffusion" pip install -v .[test]
-# OR
-pip install -v .[test] --config-settings=cmake.args="-DOGS_BUILD_PROCESSES=SteadyStateDiffusion"
+pip install -v .[test] --config-settings=cmake.define.OGS_BUILD_PROCESSES=SteadyStateDiffusion"
 ```
 
 The `pip install`-step starts a new CMake-based ogs build in `_skbuild`-subdirectory (inside the source code) using the `wheel`-preset. When the CMake build is done it installs the wheel into the activated virtual environment and you can interact with it.
-- 
GitLab