From aa0ebe01b12c7a53f7d693fb5bae1ec98a96eba7 Mon Sep 17 00:00:00 2001 From: "Oleg V. Kozlyuk" Date: Wed, 1 Jan 2025 16:11:50 +0100 Subject: [PATCH] Source ORBITER_PLANET_TEXTURE_INSTALL_DIR from env (#531) --- CMakeLists.txt | 6 ++++++ README.md | 3 +++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1084c877..953a3da8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,6 +206,12 @@ set(ORBITER_PLANET_TEXTURE_INSTALL_DIR PATH "Planet texture installation directory (e.g. C:/Orbiter2016/Textures)" ) + +if(DEFINED ENV{ORBITER_PLANET_TEXTURE_INSTALL_DIR}) + set(ORBITER_PLANET_TEXTURE_INSTALL_DIR $ENV{ORBITER_PLANET_TEXTURE_INSTALL_DIR}) + message(STATUS "Using environment: ORBITER_PLANET_TEXTURE_INSTALL_DIR=${ORBITER_PLANET_TEXTURE_INSTALL_DIR}") +endif() + string(COMPARE NOTEQUAL ${ORBITER_PLANET_TEXTURE_INSTALL_DIR} "${ORBITER_BINARY_ROOT_DIR}/Textures" CUSTOM_PLANET_TEXTURE_DIR) if (${CUSTOM_PLANET_TEXTURE_DIR}) diff --git a/README.md b/README.md index f4bc5b8da..605fcdb32 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,9 @@ To configure Orbiter to use the texture installation, set the ORBITER_PLANET_TEXTURE_INSTALL_DIR entry in CMake. For example, if Orbiter was installed in `C:\Orbiter`, the CMake option should be set to `C:/Orbiter/Textures`. + +This path can also be set using ORBITER_PLANET_TEXTURE_INSTALL_DIR environment variable + Alternatively, you can configure the texture directory after building Orbiter by setting the `PlanetTexDir` entry in `Orbiter.cfg`.