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`.