Replace CMAKE_INSTALL_PREFIX from default config if it hasn't been swapped out by CMAKE

This commit is contained in:
Matt Hill
2016-03-25 09:12:24 -04:00
parent 747acb6d96
commit 677dc4667d
3 changed files with 16 additions and 0 deletions

View File

@@ -167,6 +167,11 @@ namespace alpr
runtimeBaseDir = getString(ini,defaultIni, "", "runtime_dir", DEFAULT_RUNTIME_DATA_DIR);
// Special hack to allow config files to work if the package hasn't been installed
// Cmake will do this replacement on deploy, but this is useful in development
if (runtimeBaseDir.find("${CMAKE_INSTALL_PREFIX}") >= 0)
runtimeBaseDir = replaceAll(runtimeBaseDir, "${CMAKE_INSTALL_PREFIX}", INSTALL_PREFIX);
std::string detectorString = getString(ini, defaultIni, "", "detector", "lbpcpu");
std::transform(detectorString.begin(), detectorString.end(), detectorString.begin(), ::tolower);