diff --git a/python/setup.py.in b/python/setup.py.in index 516a19dca..c78991db6 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -214,10 +214,11 @@ for d in os.scandir('data/aircraft'): data_files.append(('share/${PROJECT_NAME}/'+dir_name, list(XML_files(dir_name)))) - # Some aircraft folders include a `Systems` and/or an `Engines` - # sub-directory so make sure it is copied in the wheel archive - # (see GH issue #687) - for sub_dir in ('Systems', 'Engines'): + # Some aircraft folders include a "Systems" and/or an "Engines" + # sub-directory (with several alternative spelling) so make sure they + # are copied in the wheel archive (see GH issue #687) + for sub_dir in ('Systems', 'systems', 'Engines', 'engines', 'Engine', + 'engine'): sub_dir_name = dir_name + '/' + sub_dir subdir_dir_fullname = os.path.join('data', sub_dir_name) if os.path.exists(subdir_dir_fullname) and os.path.isdir(subdir_dir_fullname): diff --git a/src/models/FGFCS.cpp b/src/models/FGFCS.cpp index 9409af82c..a5ffadfaa 100644 --- a/src/models/FGFCS.cpp +++ b/src/models/FGFCS.cpp @@ -38,6 +38,7 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include +#include #include "FGFCS.h" #include "input_output/FGModelLoader.h" @@ -613,8 +614,17 @@ SGPath FGFCS::FindFullPathName(const SGPath& path) const SGPath name = FGModel::FindFullPathName(path); if (systype != stSystem || !name.isNull()) return name; - name = CheckPathName(FDMExec->GetFullAircraftPath()/string("Systems"), path); - if (!name.isNull()) return name; +#ifdef _WIN32 + const array dir_names = {"Systems"}; +#else + // Check alternative capitalization for case sensitive OSes. + const array dir_names = {"Systems", "systems"}; +#endif + + for(const string& dir_name: dir_names) { + name = CheckPathName(FDMExec->GetFullAircraftPath()/dir_name, path); + if (!name.isNull()) return name; + } return CheckPathName(FDMExec->GetSystemsPath(), path); } diff --git a/src/models/FGPropulsion.cpp b/src/models/FGPropulsion.cpp index 685498b0a..319203546 100644 --- a/src/models/FGPropulsion.cpp +++ b/src/models/FGPropulsion.cpp @@ -45,6 +45,7 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include +#include #include "FGFDMExec.h" #include "FGPropulsion.h" @@ -457,11 +458,23 @@ bool FGPropulsion::Load(Element* el) SGPath FGPropulsion::FindFullPathName(const SGPath& path) const { - if (!ReadingEngine) return FGModel::FindFullPathName(path); - - SGPath name = CheckPathName(FDMExec->GetFullAircraftPath()/string("Engines"), - path); - if (!name.isNull()) return name; + SGPath name = FGModel::FindFullPathName(path); + if (!ReadingEngine && !name.isNull()) return name; + +#ifdef _WIN32 + // Singular and plural are allowed for the folder names for consistency with + // the default engine folder name "engine" and for backward compatibility + // regarding the folder name "Engines". + const array dir_names = {"Engines", "engine"}; +#else + // Allow alternative capitalization for case sensitive OSes. + const array dir_names = {"Engines", "engines", "Engine", "engine"}; +#endif + + for(const string& dir_name: dir_names) { + name = CheckPathName(FDMExec->GetFullAircraftPath()/dir_name, path); + if (!name.isNull()) return name; + } return CheckPathName(FDMExec->GetEnginePath(), path); }