Cmake install config fixes

This commit is contained in:
Thomas Krijnen
2026-07-30 08:54:08 +02:00
parent 6d7aa3c48c
commit 41308cf122
13 changed files with 75 additions and 17 deletions
+8 -2
View File
@@ -75,8 +75,14 @@ macro(build_example exe_name)
endmacro()
macro(build_schema_example exe_name schema)
build_example(${exe_name} ${ARGN})
if(NOT STANDALONE_PROJECT)
build_example(${exe_name} ${schema} ${ARGN})
if(STANDALONE_PROJECT)
target_link_libraries(${exe_name} IfcOpenShell::parse_schema_ifc${schema})
target_compile_definitions(
${exe_name}
PRIVATE IFCOPENSHELL_EXAMPLE_PLUGIN_PATH="$<TARGET_FILE_DIR:IfcOpenShell::parse_schema_ifc${schema}>"
)
else()
target_link_libraries(${exe_name} parse_schema_ifc${schema})
endif()
endmacro()
+7 -2
View File
@@ -48,6 +48,7 @@
#include INCLUDE_SCHEMA_DEFINITIONS(ifcparse/schemas, IfcSchema)
#include "ifcparse/hierarchy_helper.h"
#include "plugin/plugin.h"
#include "../ifcgeom/Serialization/Serialization.h"
@@ -62,6 +63,10 @@ void createGroundShape(TopoDS_Shape& shape);
int main() {
#ifdef IFCOPENSHELL_EXAMPLE_PLUGIN_PATH
ifcopenshell::plugin::set_search_paths({IFCOPENSHELL_EXAMPLE_PLUGIN_PATH});
#endif
// The hierarchy_helper is a subclass of the regular file that provides several
// convenience functions for working with geometry in IFC files.
hierarchy_helper<IfcSchema> file;
@@ -99,8 +104,8 @@ int main() {
auto building_shape = IfcGeom::serialise(file, building_shell, false).as<IfcSchema::IfcProductDefinitionShape>();
file.add_entity(building_shape);
auto rep = building_shape.Representations().begin();
rep->setContextOfItems(file.getRepresentationContext("model"));
auto building_representations = building_shape.Representations();
building_representations.front().setContextOfItems(file.getRepresentationContext("model"));
building.setRepresentation(building_shape);