Skip to content

Commit e561476

Browse files
authored
look for data at install location (#154)
When the package is installed at a non-standard location, i.e. with prefix different from /usr or /usr/local, the data directory cannot be found. This change ensures that the install location is always tried when looking for the data directory.
1 parent 675f87c commit e561476

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/iridescence CACHE PATH "Loca
8282

8383
# imgui
8484
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W)
85+
add_definitions(-DDATA_INSTALL_PATH="${CMAKE_INSTALL_FULL_DATADIR}/iridescence/data")
8586
add_definitions(-DDATA_PATH_GUESS="${CMAKE_SOURCE_DIR}/data")
8687

8788
if(MSVC)

src/glk/path_std.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ std::string get_data_path() {
5151
std::vector<std::string> hints;
5252
hints.push_back("./data");
5353
hints.push_back("../data");
54+
#ifdef DATA_INSTALL_PATH
55+
hints.push_back(DATA_INSTALL_PATH);
56+
#endif
5457
hints.push_back("/usr/share/iridescence");
5558
hints.push_back("/usr/local/share/iridescence");
5659
#ifdef DATA_PATH_GUESS

0 commit comments

Comments
 (0)