mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
cmake export - propagate HAS_SCHEMA definitions to exported IfcParse target
This commit is contained in:
@@ -464,12 +464,13 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "IFC SCHEMA_VERSIONS that will be used for the build: ${SCHEMA_VERSIONS}.")
|
message(STATUS "IFC SCHEMA_VERSIONS that will be used for the build: ${SCHEMA_VERSIONS}.")
|
||||||
|
|
||||||
|
set(SCHEMA_DEFINITIONS "")
|
||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
add_definitions(-DHAS_SCHEMA_${schema})
|
list(APPEND SCHEMA_DEFINITIONS "-DHAS_SCHEMA_${schema}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
string(REPLACE ";" ")(" schema_version_seq "(${SCHEMA_VERSIONS})")
|
string(REPLACE ";" ")(" schema_version_seq "(${SCHEMA_VERSIONS})")
|
||||||
add_definitions(-DSCHEMA_SEQ=${schema_version_seq})
|
list(APPEND SCHEMA_DEFINITIONS "-DSCHEMA_SEQ=${schema_version_seq}")
|
||||||
|
|
||||||
if(COMPILE_SCHEMA)
|
if(COMPILE_SCHEMA)
|
||||||
# @todo, this appears to be untested at the moment
|
# @todo, this appears to be untested at the moment
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3")
|
|||||||
target_link_libraries(IfcParseExamples ${Boost_LIBRARIES})
|
target_link_libraries(IfcParseExamples ${Boost_LIBRARIES})
|
||||||
target_link_libraries(IfcParseExamples IfcOpenShell::IfcParse)
|
target_link_libraries(IfcParseExamples IfcOpenShell::IfcParse)
|
||||||
target_compile_features(IfcParseExamples PRIVATE cxx_std_17)
|
target_compile_features(IfcParseExamples PRIVATE cxx_std_17)
|
||||||
target_compile_definitions(IfcParseExamples PRIVATE "SCHEMA_SEQ=(2x3)" HAS_SCHEMA_2x3)
|
|
||||||
else()
|
else()
|
||||||
target_include_directories(IfcParseExamples PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
target_include_directories(IfcParseExamples PRIVATE "${CMAKE_SOURCE_DIR}/../src")
|
||||||
target_link_libraries(IfcParseExamples IfcParse)
|
target_link_libraries(IfcParseExamples IfcParse)
|
||||||
@@ -73,7 +72,6 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "2x3")
|
|||||||
INTERFACE ${OpenCASCADE_LIBRARIES} RocksDB::rocksdb
|
INTERFACE ${OpenCASCADE_LIBRARIES} RocksDB::rocksdb
|
||||||
IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer
|
IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer
|
||||||
)
|
)
|
||||||
target_compile_definitions(IfcHouseInterface INTERFACE "SCHEMA_SEQ=(2x3)" HAS_SCHEMA_2x3)
|
|
||||||
else()
|
else()
|
||||||
target_include_directories(IfcHouseInterface INTERFACE "${CMAKE_SOURCE_DIR}/../src")
|
target_include_directories(IfcHouseInterface INTERFACE "${CMAKE_SOURCE_DIR}/../src")
|
||||||
target_link_libraries(IfcHouseInterface INTERFACE ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(IfcHouseInterface INTERFACE ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES})
|
||||||
@@ -93,7 +91,6 @@ if(STANDALONE_PROJECT OR SCHEMA_VERSIONS MATCHES "4x3_add2")
|
|||||||
|
|
||||||
if(STANDALONE_PROJECT)
|
if(STANDALONE_PROJECT)
|
||||||
target_include_directories(IfcAlignmentInterface INTERFACE ${Boost_INCLUDE_DIRS})
|
target_include_directories(IfcAlignmentInterface INTERFACE ${Boost_INCLUDE_DIRS})
|
||||||
target_compile_definitions(IfcAlignmentInterface INTERFACE HAS_SCHEMA_4x3_add2)
|
|
||||||
target_link_libraries(IfcAlignment PRIVATE IfcOpenShell::IfcParse)
|
target_link_libraries(IfcAlignment PRIVATE IfcOpenShell::IfcParse)
|
||||||
target_link_libraries(IfcSimplifiedAlignment PRIVATE IfcOpenShell::IfcParse)
|
target_link_libraries(IfcSimplifiedAlignment PRIVATE IfcOpenShell::IfcParse)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ endforeach()
|
|||||||
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
||||||
|
|
||||||
add_library(IfcParse ${IFCPARSE_FILES})
|
add_library(IfcParse ${IFCPARSE_FILES})
|
||||||
|
target_compile_definitions(IfcParse PUBLIC ${SCHEMA_DEFINITIONS})
|
||||||
target_include_directories(IfcParse PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
target_include_directories(IfcParse PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||||
set_target_properties(IfcParse
|
set_target_properties(IfcParse
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
|
|||||||
Reference in New Issue
Block a user