2015-11-09 17:42:46 +02:00
|
|
|
################################################################################
|
|
|
|
|
# #
|
|
|
|
|
# This file is part of IfcOpenShell. #
|
|
|
|
|
# #
|
|
|
|
|
# IfcOpenShell is free software: you can redistribute it and/or modify #
|
|
|
|
|
# it under the terms of the Lesser GNU General Public License as published by #
|
|
|
|
|
# the Free Software Foundation, either version 3.0 of the License, or #
|
|
|
|
|
# (at your option) any later version. #
|
|
|
|
|
# #
|
|
|
|
|
# IfcOpenShell is distributed in the hope that it will be useful, #
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
|
|
|
|
# Lesser GNU General Public License for more details. #
|
|
|
|
|
# #
|
|
|
|
|
# You should have received a copy of the Lesser GNU General Public License #
|
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
|
|
|
|
# #
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2025-12-12 12:19:40 +05:00
|
|
|
# Thils file can also be build standalone, outside of the IfcOpenShell build tree,
|
|
|
|
|
# to demonstrate the usage IfcOpenShell as a cmake package.
|
|
|
|
|
if(NOT BUILD_EXAMPLES)
|
|
|
|
|
set(STANDALONE_PROJECT ON)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
|
project(IfcOpenShellExamples)
|
|
|
|
|
|
2025-12-12 15:37:34 +05:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2025-12-12 12:19:40 +05:00
|
|
|
find_package(IfcOpenShell CONFIG REQUIRED)
|
2025-12-12 18:32:47 +05:00
|
|
|
set(SCHEMA_VERSIONS ${IFCOPENSHELL_SCHEMA_VERSIONS})
|
|
|
|
|
set(WITH_OPENCASCADE ${IFCOPENSHELL_WITH_OPENCASCADE})
|
2025-12-12 18:58:04 +05:00
|
|
|
else()
|
|
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/../src")
|
2025-12-12 12:19:40 +05:00
|
|
|
endif()
|
2012-11-04 16:26:33 +00:00
|
|
|
|
2025-12-12 22:44:40 +01:00
|
|
|
if(SCHEMA_VERSIONS MATCHES "4")
|
|
|
|
|
# arbitrary_open_profile_def
|
|
|
|
|
add_executable(arbitrary_open_profile_def arbitrary_open_profile_def.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(arbitrary_open_profile_def IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(arbitrary_open_profile_def PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(arbitrary_open_profile_def IfcParse)
|
|
|
|
|
set_target_properties(arbitrary_open_profile_def PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS arbitrary_open_profile_def)
|
|
|
|
|
|
|
|
|
|
# triangulated_faceset
|
|
|
|
|
add_executable(triangulated_faceset triangulated_faceset.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(triangulated_faceset IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(triangulated_faceset PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(triangulated_faceset IfcParse)
|
|
|
|
|
set_target_properties(triangulated_faceset PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS triangulated_faceset)
|
|
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-12-12 18:32:47 +05:00
|
|
|
if(SCHEMA_VERSIONS MATCHES "2x3")
|
2025-12-12 22:44:40 +01:00
|
|
|
# composite_profile_def.cpp
|
|
|
|
|
add_executable(composite_profile_def composite_profile_def.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(composite_profile_def IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(composite_profile_def PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(composite_profile_def IfcParse)
|
|
|
|
|
set_target_properties(composite_profile_def PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS composite_profile_def)
|
|
|
|
|
|
|
|
|
|
# csg_primitive
|
|
|
|
|
add_executable(csg_primitive csg_primitive.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(csg_primitive IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(csg_primitive PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(csg_primitive IfcParse)
|
|
|
|
|
set_target_properties(csg_primitive PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS csg_primitive)
|
|
|
|
|
|
|
|
|
|
# ellipse_pies
|
|
|
|
|
add_executable(ellipse_pies ellipse_pies.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(ellipse_pies IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(ellipse_pies PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(ellipse_pies IfcParse)
|
|
|
|
|
set_target_properties(ellipse_pies PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS ellipse_pies)
|
|
|
|
|
|
|
|
|
|
# faces
|
|
|
|
|
add_executable(faces faces.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(faces IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(faces PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(faces IfcParse)
|
|
|
|
|
set_target_properties(faces PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS faces)
|
|
|
|
|
|
|
|
|
|
# ifc_curve_rebar
|
|
|
|
|
add_executable(ifc_curve_rebar ifc_curve_rebar.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(ifc_curve_rebar IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(ifc_curve_rebar PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(ifc_curve_rebar IfcParse)
|
|
|
|
|
set_target_properties(ifc_curve_rebar PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS ifc_curve_rebar)
|
|
|
|
|
|
|
|
|
|
# profiles
|
|
|
|
|
add_executable(profiles profiles.cpp)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(profiles IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
|
|
|
|
target_include_directories(profiles PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
|
|
|
|
target_link_libraries(profiles IfcParse)
|
|
|
|
|
set_target_properties(profiles PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
install(TARGETS profiles)
|
|
|
|
|
|
|
|
|
|
# IfcParseExamples
|
2025-12-12 12:19:40 +05:00
|
|
|
add_executable(IfcParseExamples IfcParseExamples.cpp)
|
2023-03-22 11:17:14 +01:00
|
|
|
|
2025-12-12 12:19:40 +05:00
|
|
|
if(STANDALONE_PROJECT)
|
|
|
|
|
target_link_libraries(IfcParseExamples IfcOpenShell::IfcParse)
|
|
|
|
|
else()
|
2025-12-12 13:55:44 +05:00
|
|
|
target_include_directories(IfcParseExamples PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
2025-12-12 12:19:40 +05:00
|
|
|
target_link_libraries(IfcParseExamples IfcParse)
|
|
|
|
|
set_target_properties(IfcParseExamples PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
2025-12-12 12:20:35 +05:00
|
|
|
install(TARGETS IfcParseExamples)
|
2025-12-12 12:19:40 +05:00
|
|
|
|
2025-12-15 15:25:22 +05:00
|
|
|
if(WITH_OPENCASCADE)
|
2025-12-12 22:44:40 +01:00
|
|
|
# IfcOpenHouse and IfcAdvancedHouse
|
2025-12-12 12:19:40 +05:00
|
|
|
add_executable(IfcOpenHouse IfcOpenHouse.cpp)
|
|
|
|
|
add_executable(IfcAdvancedHouse IfcAdvancedHouse.cpp)
|
2025-12-12 15:37:34 +05:00
|
|
|
add_library(IfcHouseInterface INTERFACE)
|
|
|
|
|
|
2025-12-20 13:27:35 +05:00
|
|
|
if(STANDALONE_PROJECT)
|
2025-12-12 18:58:04 +05:00
|
|
|
target_link_libraries(IfcHouseInterface INTERFACE IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer)
|
2025-12-12 15:37:34 +05:00
|
|
|
else()
|
2025-12-12 18:58:04 +05:00
|
|
|
target_link_libraries(IfcHouseInterface INTERFACE IfcParse geometry_serializer)
|
2025-12-12 15:37:34 +05:00
|
|
|
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)
|
2025-12-12 12:20:35 +05:00
|
|
|
install(TARGETS IfcOpenHouse IfcAdvancedHouse)
|
2025-11-15 20:31:13 +01:00
|
|
|
endif()
|
2025-12-12 12:19:40 +05:00
|
|
|
endif()
|
2023-03-22 11:17:14 +01:00
|
|
|
|
2025-12-12 18:32:47 +05:00
|
|
|
if(SCHEMA_VERSIONS MATCHES "4x3_add2")
|
2025-12-12 22:44:40 +01:00
|
|
|
# IfcAlignment and IfcSimplifiedAlignment
|
2025-12-12 12:19:40 +05:00
|
|
|
add_executable(IfcAlignment IfcAlignment.cpp)
|
|
|
|
|
add_executable(IfcSimplifiedAlignment IfcSimplifiedAlignment.cpp)
|
2025-12-12 16:08:43 +05:00
|
|
|
add_library(IfcAlignmentInterface INTERFACE)
|
|
|
|
|
|
|
|
|
|
if(STANDALONE_PROJECT)
|
2025-12-12 18:58:04 +05:00
|
|
|
target_link_libraries(IfcAlignmentInterface INTERFACE IfcOpenShell::IfcParse)
|
2025-12-12 16:08:43 +05:00
|
|
|
else()
|
2025-12-12 18:58:04 +05:00
|
|
|
target_link_libraries(IfcAlignmentInterface INTERFACE IfcParse)
|
2025-12-12 16:08:43 +05:00
|
|
|
set_target_properties(IfcAlignment PROPERTIES FOLDER Examples)
|
|
|
|
|
set_target_properties(IfcSimplifiedAlignment PROPERTIES FOLDER Examples)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
target_link_libraries(IfcAlignment PRIVATE IfcAlignmentInterface)
|
|
|
|
|
target_link_libraries(IfcSimplifiedAlignment PRIVATE IfcAlignmentInterface)
|
2025-12-12 12:20:35 +05:00
|
|
|
|
|
|
|
|
install(TARGETS IfcAlignment IfcSimplifiedAlignment)
|
2024-06-10 15:42:11 +05:00
|
|
|
endif()
|