2025-11-30 17:06:52 +01:00
|
|
|
find_package(Eigen3 REQUIRED)
|
|
|
|
|
|
2026-04-20 12:26:11 +10:00
|
|
|
set(mapping_plugin_runtime_dir "$<TARGET_FILE_DIR:IfcGeom>")
|
2026-04-17 11:24:09 +02:00
|
|
|
|
2026-04-24 13:36:06 +02:00
|
|
|
if (NOT WASM_BUILD)
|
|
|
|
|
# wasm-ld (?) trips up on multiple defined symbols. IfcParse already brings
|
|
|
|
|
# in plugin so we skip it here.
|
|
|
|
|
set(plugin_when_not_wasm plugin)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-11-30 13:33:56 +01:00
|
|
|
foreach(schema ${SCHEMA_VERSIONS})
|
|
|
|
|
file(GLOB IFCGEOM_I_FILES *.i)
|
|
|
|
|
file(GLOB IFCGEOM_H_FILES *.h)
|
|
|
|
|
file(GLOB IFCGEOM_CPP_FILES *.cpp)
|
|
|
|
|
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
|
|
|
|
|
|
2026-04-17 11:24:09 +02:00
|
|
|
add_library(geometry_mapping_ifc${schema} SHARED ${IFCGEOM_FILES})
|
|
|
|
|
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES
|
|
|
|
|
COMPILE_FLAGS "-DIfcSchema=Ifc${schema}"
|
2026-08-09 09:52:17 +02:00
|
|
|
OUTPUT_NAME "ifcopenshell_geometry_mapping_ifc${schema}"
|
2026-04-17 11:24:09 +02:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
|
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
|
|
|
|
|
)
|
2026-04-24 13:36:06 +02:00
|
|
|
|
2026-05-05 21:42:39 +02:00
|
|
|
ifcopenshell_wasm_plugin_link_options(geometry_mapping_ifc${schema} ifcopenshell_register_mapping_plugin_v1)
|
2026-05-06 21:17:25 +02:00
|
|
|
if(WASM_BUILD)
|
|
|
|
|
target_link_options(geometry_mapping_ifc${schema} PRIVATE "SHELL:-s ERROR_ON_UNDEFINED_SYMBOLS=0")
|
|
|
|
|
endif()
|
2026-04-24 13:36:06 +02:00
|
|
|
|
2026-05-06 21:17:25 +02:00
|
|
|
if(NOT WASM_BUILD)
|
|
|
|
|
set(schema_plugin_library parse_schema_ifc${schema})
|
|
|
|
|
else()
|
|
|
|
|
set(schema_plugin_library)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
target_link_libraries(geometry_mapping_ifc${schema} PRIVATE ${plugin_when_not_wasm} IfcGeom IfcParse ${schema_plugin_library} Eigen3::Eigen)
|
2025-11-30 13:33:56 +01:00
|
|
|
|
|
|
|
|
list(APPEND mapping_libraries geometry_mapping_ifc${schema})
|
|
|
|
|
|
2026-07-30 08:54:08 +02:00
|
|
|
install(TARGETS geometry_mapping_ifc${schema} EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
2025-11-30 13:33:56 +01:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
set(mapping_libraries ${mapping_libraries} PARENT_SCOPE)
|