diff --git a/externals/nitro/modules/c++/nitf/source/UnitTests.cpp b/externals/nitro/modules/c++/nitf/source/UnitTests.cpp index 0a3a92d33..1616efd98 100644 --- a/externals/nitro/modules/c++/nitf/source/UnitTests.cpp +++ b/externals/nitro/modules/c++/nitf/source/UnitTests.cpp @@ -240,10 +240,15 @@ std::string nitf::Test::buildPluginsDir(const std::string& dir) if (!is_directory(plugins)) { // Developers might not set things up for "cmake --install ." - plugins = buildDir_.parent_path() / "modules" / "c" / dir; + static const auto modules_c_dir = std::filesystem::path("modules") / "c" / dir; + plugins = buildDir_.parent_path() / modules_c_dir; if (!is_directory(plugins)) { + plugins = buildDir_.parent_path() / "externals" / "nitro" / modules_c_dir; + if (!is_directory(plugins)) + { throw std::logic_error("Can't find 'plugins' directory: " + plugins.string()); + } } } return plugins.string(); @@ -259,4 +264,4 @@ fs::path nitf::Test::findInputFile(const fs::path& inputFile) { const auto root = find_NITRO_root(); return root / inputFile; -} \ No newline at end of file +}