From 1d7d0f6d05607d319ca9f605247ece96a3a7f213 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 12 Dec 2025 18:32:47 +0500 Subject: [PATCH] cmake export - export some variables to inspect installation --- cmake/IfcOpenShellConfig.cmake.in | 6 ++++++ src/examples/CMakeLists.txt | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/IfcOpenShellConfig.cmake.in b/cmake/IfcOpenShellConfig.cmake.in index 156aaa37da..afdfe838bc 100644 --- a/cmake/IfcOpenShellConfig.cmake.in +++ b/cmake/IfcOpenShellConfig.cmake.in @@ -1,5 +1,11 @@ @PACKAGE_INIT@ +# Variable to inspect installed schema versions. +set(IFCOPENSHELL_SCHEMA_VERSIONS @SCHEMA_VERSIONS@) + +set(IFCOPENSHELL_WITH_OPENCASCADE @WITH_OPENCASCADE@) + + include("${CMAKE_CURRENT_LIST_DIR}/@CONFIG_TARGETS_FILENAME@") check_required_components("@PROJECT_NAME@") diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt index c50c899ea9..37d595f94b 100644 --- a/src/examples/CMakeLists.txt +++ b/src/examples/CMakeLists.txt @@ -37,9 +37,11 @@ if(STANDALONE_PROJECT) find_package(RocksDB CONFIG REQUIRED) find_package(LibXml2 CONFIG REQUIRED) find_package(IfcOpenShell CONFIG REQUIRED) + set(SCHEMA_VERSIONS ${IFCOPENSHELL_SCHEMA_VERSIONS}) + set(WITH_OPENCASCADE ${IFCOPENSHELL_WITH_OPENCASCADE}) endif() -if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3") +if(SCHEMA_VERSIONS MATCHES "2x3") add_executable(IfcParseExamples IfcParseExamples.cpp) if(STANDALONE_PROJECT) @@ -55,7 +57,7 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3") endif() install(TARGETS IfcParseExamples) - if(STANDALONE_PROJECT OR WITH_OPENCASCADE) + if(WITH_OPENCASCADE) add_executable(IfcOpenHouse IfcOpenHouse.cpp) add_executable(IfcAdvancedHouse IfcAdvancedHouse.cpp) add_library(IfcHouseInterface INTERFACE) @@ -84,7 +86,7 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3") endif() endif() -if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "4x3_add2") +if(SCHEMA_VERSIONS MATCHES "4x3_add2") add_executable(IfcAlignment IfcAlignment.cpp) add_executable(IfcSimplifiedAlignment IfcSimplifiedAlignment.cpp) add_library(IfcAlignmentInterface INTERFACE)