examples - build IfcOpenHouse/IfcAdvancedHouse using cmake package

This commit is contained in:
Andrej730
2025-12-12 15:37:34 +05:00
parent 61269136cd
commit 43533706a4
4 changed files with 37 additions and 16 deletions
+2
View File
@@ -210,6 +210,8 @@ jobs:
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .
./IfcParseExamples "../IfcParseExamples_test.ifc"
./IfcOpenHouse
./IfcAdvancedHouse
- name: Test ifcopenshell-python
run: |
+25 -6
View File
@@ -27,6 +27,7 @@ if(STANDALONE_PROJECT)
cmake_minimum_required(VERSION 3.21)
project(IfcOpenShellExamples)
set(CMAKE_CXX_STANDARD 17)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_USE_MULTITHREADED ON)
@@ -56,15 +57,33 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3")
endif()
install(TARGETS IfcParseExamples)
if(NOT STANDALONE_PROJECT AND WITH_OPENCASCADE)
if(STANDALONE_PROJECT OR WITH_OPENCASCADE)
add_executable(IfcOpenHouse IfcOpenHouse.cpp)
target_link_libraries(IfcOpenHouse ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES})
set_target_properties(IfcOpenHouse PROPERTIES FOLDER Examples)
add_executable(IfcAdvancedHouse IfcAdvancedHouse.cpp)
target_link_libraries(IfcAdvancedHouse ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES})
set_target_properties(IfcAdvancedHouse PROPERTIES FOLDER Examples)
add_library(IfcHouseInterface INTERFACE)
if (STANDALONE_PROJECT)
find_package(Eigen3 CONFIG REQUIRED)
find_package(CGAL CONFIG REQUIRED)
find_package(OpenCASCADE CONFIG REQUIRED)
add_library(CGAL::CGAL_INTERFACE INTERFACE IMPORTED)
target_link_libraries(CGAL::CGAL_INTERFACE INTERFACE CGAL::CGAL)
target_include_directories(IfcHouseInterface INTERFACE "${IfcOpenShell_DIR}/../../../include")
target_include_directories(IfcHouseInterface INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(IfcHouseInterface
INTERFACE ${OpenCASCADE_LIBRARIES} RocksDB::rocksdb
IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer
)
target_compile_definitions(IfcHouseInterface INTERFACE "SCHEMA_SEQ=(2x3)" HAS_SCHEMA_2x3 IFOPSH_WITH_ROCKSDB)
else()
target_include_directories(IfcHouseInterface INTERFACE "${CMAKE_SOURCE_DIR}/../src")
target_link_libraries(IfcHouseInterface INTERFACE ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES})
set_target_properties(IfcOpenHouse PROPERTIES FOLDER Examples)
set_target_properties(IfcAdvancedHouse PROPERTIES FOLDER Examples)
endif()
target_link_libraries(IfcOpenHouse PRIVATE IfcHouseInterface)
target_link_libraries(IfcAdvancedHouse PRIVATE IfcHouseInterface)
install(TARGETS IfcOpenHouse IfcAdvancedHouse)
endif()
endif()
+5 -5
View File
@@ -39,12 +39,12 @@
#include <Standard_Version.hxx>
#define IfcSchema Ifc2x3
#include "../ifcparse/macros.h"
#include "../ifcparse/Ifc2x3.h"
#include "../ifcparse/IfcBaseClass.h"
#include "../ifcparse/IfcHierarchyHelper.h"
#include "ifcparse/macros.h"
#include "ifcparse/Ifc2x3.h"
#include "ifcparse/IfcBaseClass.h"
#include "ifcparse/IfcHierarchyHelper.h"
#include "../ifcgeom/Serialization/Serialization.h"
#include "ifcgeom/Serialization/Serialization.h"
#if USE_VLD
#include <vld.h>
+5 -5
View File
@@ -36,12 +36,12 @@
#include <Precision.hxx>
#define IfcSchema Ifc2x3
#include "../ifcparse/macros.h"
#include "../ifcparse/Ifc2x3.h"
#include "../ifcparse/IfcBaseClass.h"
#include "../ifcparse/IfcHierarchyHelper.h"
#include "ifcparse/macros.h"
#include "ifcparse/Ifc2x3.h"
#include "ifcparse/IfcBaseClass.h"
#include "ifcparse/IfcHierarchyHelper.h"
#include "../ifcgeom/Serialization/Serialization.h"
#include "ifcgeom/Serialization/Serialization.h"
#if USE_VLD
#include <vld.h>