mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Use underscore plugin artifact names
Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -52,6 +52,7 @@ macro(SET_INSTALL_SELF_RPATH _target)
|
||||
endmacro()
|
||||
|
||||
function(ifcopenshell_plugin_target TARGET)
|
||||
# Plug-ins are loaded by exact filename and should not receive a platform library prefix.
|
||||
set_target_properties(${TARGET} PROPERTIES PREFIX "")
|
||||
if((NOT WIN32) AND BUILD_SHARED_LIBS AND NOT WASM_BUILD AND NOT CREATE_BUNDLE AND NOT CMAKE_INSTALL_RPATH AND COMMAND SET_INSTALL_SELF_RPATH)
|
||||
SET_INSTALL_SELF_RPATH(${TARGET})
|
||||
|
||||
@@ -168,7 +168,7 @@ ifcopenshell_deploy_qt_runtime(BonsaiViewer)
|
||||
# them explicitly. (In a static build these are absent from lib/
|
||||
# and the glob just no-ops, so this rule is safe in both modes.)
|
||||
#
|
||||
# 2. Plug-ins (ifcopenshell.*.dylib, no `lib` prefix) — dlopen-only
|
||||
# 2. Plug-ins (ifcopenshell_*.dylib, no `lib` prefix) — dlopen-only
|
||||
# deps the plug-in loader resolves at runtime. macdeployqt has
|
||||
# no way to know about these.
|
||||
#
|
||||
@@ -177,7 +177,7 @@ ifcopenshell_deploy_qt_runtime(BonsaiViewer)
|
||||
# inside the bundle), so plug-ins and core libs both find each other
|
||||
# on the first probe.
|
||||
#
|
||||
# The geometry-writer filter drops ifcopenshell.geometry.writer.*.dylib
|
||||
# The geometry-writer filter drops ifcopenshell_geometry_writer_*.dylib
|
||||
# (the per-schema OBJ / glTF / DAE / STP / IGS / SVG / TTL export
|
||||
# converters — heavy, viewer-irrelevant). Mirrors the Rocky workflow's
|
||||
# filter in `stage_runtime_payload` (see 27249770e).
|
||||
@@ -195,7 +195,7 @@ if(APPLE)
|
||||
install(CODE [[
|
||||
set(_fw "${CMAKE_INSTALL_PREFIX}/BonsaiViewer.app/Contents/Frameworks")
|
||||
file(GLOB _ifc_dylibs "${CMAKE_INSTALL_PREFIX}/lib/*.dylib")
|
||||
list(FILTER _ifc_dylibs EXCLUDE REGEX "ifcopenshell\\.geometry\\.writer\\.")
|
||||
list(FILTER _ifc_dylibs EXCLUDE REGEX "ifcopenshell_geometry_writer_")
|
||||
if(_ifc_dylibs)
|
||||
message(STATUS "Staging IfcOpenShell dylibs (linked core + plug-ins) into BonsaiViewer.app/Contents/Frameworks")
|
||||
file(COPY ${_ifc_dylibs} DESTINATION "${_fw}")
|
||||
|
||||
@@ -88,8 +88,8 @@ namespace geom {
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
mapping_fn fn_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
mapping_fn fn_;
|
||||
};
|
||||
|
||||
std::map<std::string, entry> entries_;
|
||||
|
||||
@@ -31,7 +31,7 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
}
|
||||
|
||||
namespace {
|
||||
constexpr const char* kernel_plugin_prefix = "geometry.kernel.";
|
||||
constexpr const char* kernel_plugin_prefix = "geometry_kernel_";
|
||||
|
||||
std::string kernel_plugin_name(const std::string& backend_id) {
|
||||
auto name = boost::to_lower_copy(backend_id);
|
||||
|
||||
@@ -37,7 +37,7 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
}
|
||||
|
||||
namespace {
|
||||
constexpr const char* kernel_plugin_prefix = "geometry.kernel.";
|
||||
constexpr const char* kernel_plugin_prefix = "geometry_kernel_";
|
||||
|
||||
std::string kernel_key(const std::string& backend_id) {
|
||||
return boost::to_lower_copy(backend_id);
|
||||
|
||||
@@ -51,9 +51,9 @@ namespace ifcopenshell {
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
ifcopenshell::plugin::module module_;
|
||||
kernel_info info_;
|
||||
create_fn create_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
};
|
||||
|
||||
std::map<std::string, entry> entries_;
|
||||
|
||||
@@ -34,7 +34,7 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
||||
|
||||
set_target_properties(${KERNEL_TARGET} PROPERTIES
|
||||
COMPILE_FLAGS "-DIFC_GEOMLIBRARY_EXPORTS"
|
||||
OUTPUT_NAME "ifcopenshell.geometry.kernel.${kernel}"
|
||||
OUTPUT_NAME "ifcopenshell_geometry_kernel_${kernel}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
)
|
||||
@@ -56,7 +56,7 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
||||
|
||||
set_target_properties(${KERNEL_TARGET_SIMPLE} PROPERTIES
|
||||
COMPILE_FLAGS "-DIFC_GEOMLIBRARY_EXPORTS -DIFOPSH_SIMPLE_KERNEL -DCGAL_HAS_THREADS"
|
||||
OUTPUT_NAME "ifcopenshell.geometry.kernel.cgalsimple"
|
||||
OUTPUT_NAME "ifcopenshell_geometry_kernel_cgalsimple"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
)
|
||||
@@ -85,7 +85,7 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
||||
endif()
|
||||
set_target_properties(${TREE_TARGET} PROPERTIES
|
||||
COMPILE_FLAGS "-DIFC_GEOMLIBRARY_EXPORTS"
|
||||
OUTPUT_NAME "ifcopenshell.geometry.tree.opencascade.${tree_backend}"
|
||||
OUTPUT_NAME "ifcopenshell_geometry_tree_opencascade_${tree_backend}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${kernel_plugin_runtime_dir}"
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ foreach(schema ${SCHEMA_VERSIONS})
|
||||
add_library(geometry_mapping_ifc${schema} SHARED ${IFCGEOM_FILES})
|
||||
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES
|
||||
COMPILE_FLAGS "-DIfcSchema=Ifc${schema}"
|
||||
OUTPUT_NAME "ifcopenshell.geometry.mapping.ifc${schema}"
|
||||
OUTPUT_NAME "ifcopenshell_geometry_mapping_ifc${schema}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
}
|
||||
|
||||
namespace {
|
||||
constexpr const char* mapping_plugin_prefix = "geometry.mapping.";
|
||||
constexpr const char* mapping_plugin_prefix = "geometry_mapping_";
|
||||
}
|
||||
|
||||
const char* ifcopenshell::geom::impl::mapping_plugin_registration_symbol() {
|
||||
|
||||
@@ -28,7 +28,7 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
}
|
||||
|
||||
namespace {
|
||||
constexpr const char* opencascade_geometry_ifc_writer_plugin_prefix = "geometry.writer.";
|
||||
constexpr const char* opencascade_geometry_ifc_writer_plugin_prefix = "geometry_writer_";
|
||||
}
|
||||
|
||||
const char* ifcopenshell::geom::opencascade_geometry_ifc_writer_plugin_registration_symbol() {
|
||||
|
||||
@@ -5,7 +5,7 @@ foreach(schema ${SCHEMA_VERSIONS})
|
||||
target_link_libraries(geometry_serializer_ifc${schema} PRIVATE plugin geometry_serializer IfcGeom IfcParse parse_schema_ifc${schema} ${OpenCASCADE_LIBRARIES})
|
||||
set_target_properties(geometry_serializer_ifc${schema} PROPERTIES
|
||||
COMPILE_FLAGS "-DIfcSchema=Ifc${schema}"
|
||||
OUTPUT_NAME "ifcopenshell.geometry.writer.ifc${schema}"
|
||||
OUTPUT_NAME "ifcopenshell_geometry_writer_ifc${schema}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${geometry_serialization_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${geometry_serialization_plugin_runtime_dir}"
|
||||
)
|
||||
|
||||
@@ -29,9 +29,9 @@ public:
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
ifcopenshell::plugin::module module_;
|
||||
serialise_fn serialise_;
|
||||
tesselate_fn tesselate_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
};
|
||||
|
||||
std::map<std::string, entry> entries_;
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace ifcopenshell {
|
||||
namespace plugin {
|
||||
PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, std::filesystem::path (*default_search_path)());
|
||||
@@ -28,7 +30,13 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
}
|
||||
|
||||
namespace {
|
||||
constexpr const char* tree_plugin_prefix = "geometry.tree.";
|
||||
constexpr const char* tree_plugin_prefix = "geometry_tree_";
|
||||
|
||||
std::string tree_plugin_name(const std::string& backend_id) {
|
||||
auto name = boost::to_lower_copy(backend_id);
|
||||
std::replace(name.begin(), name.end(), '.', '_');
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
const char* ifcopenshell::geom::trees::tree_plugin_registration_symbol() {
|
||||
@@ -38,7 +46,7 @@ const char* ifcopenshell::geom::trees::tree_plugin_registration_symbol() {
|
||||
ifcopenshell::plugin::metadata ifcopenshell::geom::trees::tree_plugin_metadata(const std::string& plugin_name) {
|
||||
plugin::metadata metadata;
|
||||
metadata.kind_ = plugin::kind::tree;
|
||||
metadata.id = std::string(tree_plugin_prefix) + plugin_name;
|
||||
metadata.id = std::string(tree_plugin_prefix) + tree_plugin_name(plugin_name);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@@ -65,7 +73,7 @@ bool ifcopenshell::geom::trees::load_tree_plugin(tree_registry& registry, const
|
||||
plugin::manager manager;
|
||||
plugin::add_search_paths_or_default(manager, &tree_plugin_directory);
|
||||
|
||||
const auto plugin_name = boost::to_lower_copy(backend_id);
|
||||
const auto plugin_name = tree_plugin_name(backend_id);
|
||||
const auto basename = std::string(tree_plugin_prefix) + plugin_name;
|
||||
|
||||
for (const auto& path : manager.discover_exact(basename)) {
|
||||
|
||||
@@ -81,9 +81,9 @@ namespace ifcopenshell {
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
ifcopenshell::plugin::module module_;
|
||||
tree_info info_;
|
||||
create_fn create_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
};
|
||||
|
||||
std::map<std::string, entry> entries_;
|
||||
|
||||
@@ -95,7 +95,7 @@ foreach(schema ${SCHEMA_VERSIONS})
|
||||
)
|
||||
target_link_libraries(${SCHEMA_PLUGIN_TARGET} PRIVATE ${plugin_when_not_wasm} IfcParse)
|
||||
set_target_properties(${SCHEMA_PLUGIN_TARGET} PROPERTIES
|
||||
OUTPUT_NAME "ifcopenshell.parse.schema.ifc${schema}"
|
||||
OUTPUT_NAME "ifcopenshell_parse_schema_ifc${schema}"
|
||||
)
|
||||
ifcopenshell_plugin_target(${SCHEMA_PLUGIN_TARGET})
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ ifcopenshell::entity::~entity() {
|
||||
}
|
||||
}
|
||||
namespace {
|
||||
constexpr const char* schema_plugin_prefix = "parse.schema.";
|
||||
constexpr const char* schema_plugin_prefix = "parse_schema_";
|
||||
|
||||
std::string schema_key(const std::string& schema_name) {
|
||||
return boost::to_upper_copy(schema_name);
|
||||
@@ -110,7 +110,7 @@ namespace {
|
||||
ifcopenshell::plugin::module builtin_schema_module(const std::string& schema_name) {
|
||||
ifcopenshell::plugin::metadata metadata;
|
||||
metadata.kind_ = ifcopenshell::plugin::kind::parse_schema;
|
||||
metadata.id = "parse.schema." + boost::to_lower_copy(schema_name);
|
||||
metadata.id = "parse_schema_" + boost::to_lower_copy(schema_name);
|
||||
metadata.schema = schema_name;
|
||||
return ifcopenshell::plugin::module::builtin(metadata);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ IF(Python_Interpreter_FOUND OR PYTHON_MODULE_INSTALL_DIR)
|
||||
# expand $ORIGIN; the equivalent placeholder is
|
||||
# @loader_path. Setting $ORIGIN on macOS bakes a literal
|
||||
# "$ORIGIN" into LC_RPATH which resolves to nothing at
|
||||
# runtime — the wrapper's `@rpath/ifcopenshell.document.rdb
|
||||
# runtime — the wrapper's `@rpath/ifcopenshell_document_rdb
|
||||
# .dylib` LC_LOAD_DYLIB then fails to find the plug-in even
|
||||
# though INSTALL(TARGETS … LIBRARY DESTINATION …/ifcopenshell)
|
||||
# above has dropped it right next to the wrapper.
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace {
|
||||
}
|
||||
|
||||
std::string decorated_basename(const std::string& basename) {
|
||||
return boost::algorithm::istarts_with(basename, "ifcopenshell.") ? basename : "ifcopenshell." + basename;
|
||||
return boost::algorithm::istarts_with(basename, "ifcopenshell_") ? basename : "ifcopenshell_" + basename;
|
||||
}
|
||||
|
||||
std::vector<std::string> platform_basenames(const std::string& basename) {
|
||||
|
||||
@@ -12,12 +12,13 @@ endif()
|
||||
|
||||
function(add_document_serializer_plugin target output_name)
|
||||
cmake_parse_arguments(PLUGIN "" "" "SOURCES;LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
string(REPLACE "." "_" plugin_output_name "${output_name}")
|
||||
|
||||
add_library(${target} SHARED ${PLUGIN_SOURCES})
|
||||
target_compile_definitions(${target} PRIVATE SERIALIZERS_EXPORTS BOOST_DLL_USE_STD_FS ${PLUGIN_DEFINITIONS})
|
||||
target_link_libraries(${target} PRIVATE ${plugin_when_not_wasm} IfcGeom IfcParse ${PLUGIN_LIBRARIES})
|
||||
set_target_properties(${target} PROPERTIES
|
||||
OUTPUT_NAME "ifcopenshell.${output_name}"
|
||||
OUTPUT_NAME "ifcopenshell_${plugin_output_name}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${document_serializer_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${document_serializer_plugin_runtime_dir}"
|
||||
)
|
||||
@@ -30,6 +31,7 @@ endfunction()
|
||||
|
||||
function(add_geometry_serializer_plugin target output_name)
|
||||
cmake_parse_arguments(PLUGIN "" "" "SOURCES;LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
string(REPLACE "." "_" plugin_output_name "${output_name}")
|
||||
|
||||
add_library(${target} SHARED ${PLUGIN_SOURCES})
|
||||
target_compile_definitions(${target} PRIVATE SERIALIZERS_EXPORTS BOOST_DLL_USE_STD_FS ${PLUGIN_DEFINITIONS})
|
||||
@@ -43,7 +45,7 @@ function(add_geometry_serializer_plugin target output_name)
|
||||
target_link_libraries(${target} PRIVATE proj::proj)
|
||||
endif()
|
||||
set_target_properties(${target} PROPERTIES
|
||||
OUTPUT_NAME "ifcopenshell.${output_name}"
|
||||
OUTPUT_NAME "ifcopenshell_${plugin_output_name}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${geometry_serializer_plugin_runtime_dir}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${geometry_serializer_plugin_runtime_dir}"
|
||||
)
|
||||
|
||||
@@ -52,7 +52,7 @@ std::string document_serializer_schema_key(const std::string& schema_name) {
|
||||
|
||||
std::string document_serializer_plugin_prefix(const std::string& format = std::string()) {
|
||||
const auto format_key = document_serializer_key(format);
|
||||
return format_key.empty() ? "document." : "document." + format_key;
|
||||
return format_key.empty() ? "document_" : "document_" + format_key;
|
||||
}
|
||||
|
||||
void add_document_serializer_search_paths(ifcopenshell::plugin::manager& manager) {
|
||||
@@ -194,7 +194,7 @@ ifcopenshell::plugin::metadata ifcopenshell::serializers::document_serializer_pl
|
||||
metadata.kind_ = plugin::kind::document_serializer;
|
||||
metadata.id = document_serializer_plugin_prefix(format);
|
||||
if (!schema_name.empty()) {
|
||||
metadata.id += "." + boost::to_lower_copy(schema_name);
|
||||
metadata.id += "_" + boost::to_lower_copy(schema_name);
|
||||
}
|
||||
metadata.schema = document_serializer_schema_key(schema_name);
|
||||
metadata.format = document_serializer_key(format);
|
||||
@@ -235,7 +235,7 @@ bool ifcopenshell::serializers::load_document_serializer_plugin(document_seriali
|
||||
const auto schema_key = document_serializer_schema_key(schema_name);
|
||||
auto basename = document_serializer_plugin_prefix(format_key);
|
||||
if (!schema_key.empty()) {
|
||||
basename += "." + boost::to_lower_copy(schema_key);
|
||||
basename += "_" + boost::to_lower_copy(schema_key);
|
||||
}
|
||||
|
||||
ifcopenshell::plugin::manager manager;
|
||||
|
||||
@@ -73,9 +73,9 @@ public:
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
ifcopenshell::plugin::module module_;
|
||||
document_serializer_info info_;
|
||||
create_fn create_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
};
|
||||
|
||||
const entry* find_entry_(const std::string& format, const std::string& schema_name) const;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace {
|
||||
|
||||
std::string geometry_serializer_plugin_prefix(const std::string& format = std::string()) {
|
||||
const auto format_lower = boost::to_lower_copy(format);
|
||||
return format_lower.empty() ? "geometry." : "geometry." + format_lower;
|
||||
return format_lower.empty() ? "geometry_" : "geometry_" + format_lower;
|
||||
}
|
||||
|
||||
std::string geometry_serializer_key(const std::string& extension) {
|
||||
|
||||
@@ -73,10 +73,10 @@ public:
|
||||
|
||||
private:
|
||||
struct entry {
|
||||
ifcopenshell::plugin::module module_;
|
||||
geometry_serializer_info info_;
|
||||
create_fn create_;
|
||||
configure_fn configure_;
|
||||
ifcopenshell::plugin::module module_;
|
||||
};
|
||||
|
||||
friend SERIALIZERS_API bool load_geometry_serializer_plugin(geometry_serializer_registry& registry, const std::string& extension);
|
||||
|
||||
@@ -56,7 +56,7 @@ endif()
|
||||
target_link_libraries(svgfill PRIVATE ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} LibXml2::LibXml2 IFCOPENSHELL_CGAL IfcParse)
|
||||
target_compile_definitions(svgfill PUBLIC IFC_SHARED_BUILD)
|
||||
set_target_properties(svgfill PROPERTIES PUBLIC_HEADER "${LIB_H_FILES}")
|
||||
set_target_properties(svgfill PROPERTIES OUTPUT_NAME "ifcopenshell.geometry.svgfill")
|
||||
set_target_properties(svgfill PROPERTIES OUTPUT_NAME "ifcopenshell_geometry_svgfill")
|
||||
ifcopenshell_wasm_plugin_link_options(svgfill ifcopenshell_register_linework_processing_plugin_v1)
|
||||
|
||||
add_executable(svgfill_exe src/main.cpp)
|
||||
|
||||
@@ -36,8 +36,8 @@ PLUGIN_API std::filesystem::path add_search_paths_or_default(manager& manager, s
|
||||
|
||||
namespace {
|
||||
struct provider_state {
|
||||
svgfill::linework_processing_plugin::api api;
|
||||
ifcopenshell::plugin::module module;
|
||||
svgfill::linework_processing_plugin::api api;
|
||||
};
|
||||
|
||||
std::filesystem::path plugin_directory() {
|
||||
|
||||
@@ -31,7 +31,7 @@ void destroy_arrangement(abstract_arrangement* arrangement);
|
||||
|
||||
namespace linework_processing_plugin {
|
||||
|
||||
constexpr const char* id = "geometry.svgfill";
|
||||
constexpr const char* id = "geometry_svgfill";
|
||||
constexpr const char* registration_symbol = "ifcopenshell_register_linework_processing_plugin_v1";
|
||||
|
||||
struct api {
|
||||
|
||||
Reference in New Issue
Block a user