mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Cmake install config fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user