Skip to content

Commit

Permalink
Source ORBITER_PLANET_TEXTURE_INSTALL_DIR from env (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer authored Jan 1, 2025
1 parent 41aa450 commit aa0ebe0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down

0 comments on commit aa0ebe0

Please sign in to comment.