Even more plug-in workarounds

This commit is contained in:
Thomas Krijnen
2026-07-31 07:17:36 +02:00
parent 8d5cedd152
commit 3d1e157ff1
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ endif()
target_compile_definitions(plugin PRIVATE
BOOST_DLL_USE_STD_FS
PLUGIN_IFCOPENSHELL_VERSION="${PROJECT_VERSION}"
IFCOPENSHELL_INSTALL_PLUGIN_DIRECTORY="${CMAKE_INSTALL_FULL_LIBDIR}"
)
target_link_libraries(plugin PRIVATE ${Boost_LIBRARIES})
+11
View File
@@ -357,6 +357,17 @@ PLUGIN_API std::filesystem::path ifcopenshell::plugin::add_search_paths_or_defau
manager.add_search_path(lib);
}
}
// A static IfcParse/IfcGeom embedded in a Python extension resolves to the
// extension's site-packages directory, while plug-ins retain CMake's normal
// install location. This also covers Python installations outside the CMake
// prefix, such as GitHub Actions' hosted Python.
#ifdef IFCOPENSHELL_INSTALL_PLUGIN_DIRECTORY
const auto install_plugin_directory = std::filesystem::path(IFCOPENSHELL_INSTALL_PLUGIN_DIRECTORY);
if (install_plugin_directory != path && std::filesystem::exists(install_plugin_directory)) {
manager.add_search_path(install_plugin_directory);
}
#endif
#endif
// Bundle-aware fallback search paths. The primary search path is