Skip to content

Commit 0ff9b59

Browse files
committed
Change access to Chrono data in HydroChrono programs:
- prefer using Chrono data subdirectory from under the HydroChrono data directory. - fall back on the data directory of the Chrono installation used during HydroChrono configuration.
1 parent 6be211e commit 0ff9b59

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/helper.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ int hydroc::SetInitialEnvironment(int argc, char* argv[]) noexcept {
4343
DATADIR = absolute(path(env_p));
4444
}
4545

46-
chrono::SetChronoDataPath(CHRONO_DATA_DIR);
46+
// Set Chrono data directory
47+
if (std::filesystem::exists(path(std::string(HC_DATA_DIR) + "/chrono"))) {
48+
chrono::SetChronoDataPath(std::string(HC_DATA_DIR) + "/chrono/");
49+
} else {
50+
chrono::SetChronoDataPath(CHRONO_DATA_DIR);
51+
}
4752

4853
return 0;
4954
}

0 commit comments

Comments
 (0)