| 204 | } |
| 205 | |
| 206 | fs::path mitk::PythonHelper::GetHomePath() |
| 207 | { |
| 208 | auto appDir = fs::path(mitk::IOUtil::GetProgramPath()).remove_filename(); |
| 209 | |
| 210 | #if defined(_WIN32) |
| 211 | auto buildTreePython = Up(appDir, 2) / "python"; |
| 212 | #elif defined(__APPLE__) |
| 213 | auto buildTreePython = Up(appDir, 4) / "python"; |
| 214 | |
| 215 | if (!fs::exists(buildTreePython) || !fs::is_directory(buildTreePython)) |
| 216 | buildTreePython = Up(appDir, 1) / "python"; |
| 217 | #else |
| 218 | auto buildTreePython = Up(appDir, 1) / "python"; |
| 219 | #endif |
| 220 | |
| 221 | if (fs::exists(buildTreePython) && fs::is_directory(buildTreePython)) |
| 222 | return buildTreePython.lexically_normal(); |
| 223 | |
| 224 | #if defined(__APPLE__) |
| 225 | auto installedPython = Up(appDir, 1) / "Frameworks" / "Python.framework" / "Versions" / "A"; |
| 226 | #else |
| 227 | auto installedPython = Up(appDir, 1) / "python"; |
| 228 | #endif |
| 229 | |
| 230 | if (fs::exists(installedPython) && fs::is_directory(installedPython)) |
| 231 | return installedPython.lexically_normal(); |
| 232 | |
| 233 | return {}; |
| 234 | } |
| 235 | |
| 236 | fs::path mitk::PythonHelper::GetLibraryPath() |
| 237 | { |