2025-11-09 08:26:33 +01:00
|
|
|
file(GLOB IFCPARSE_H_FILES_ALL *.h)
|
|
|
|
|
file(GLOB IFCPARSE_CPP_FILES_ALL *.cpp)
|
|
|
|
|
|
|
|
|
|
foreach(file ${IFCPARSE_H_FILES_ALL})
|
|
|
|
|
get_filename_component(filename "${file}" NAME)
|
2026-03-31 10:02:00 +02:00
|
|
|
list(APPEND IFCPARSE_H_FILES "${file}")
|
2025-11-09 08:26:33 +01:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
foreach(file ${IFCPARSE_CPP_FILES_ALL})
|
|
|
|
|
get_filename_component(filename "${file}" NAME)
|
2026-03-31 10:02:00 +02:00
|
|
|
list(APPEND IFCPARSE_CPP_FILES "${file}")
|
2025-11-09 08:26:33 +01:00
|
|
|
endforeach()
|
|
|
|
|
|
2026-05-06 21:17:25 +02:00
|
|
|
list(REMOVE_ITEM IFCPARSE_CPP_FILES
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/schema_plugin.cpp
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/alignment_helper.cpp
|
|
|
|
|
)
|
|
|
|
|
|
2025-11-09 08:26:33 +01:00
|
|
|
message(STATUS "SCHEMA_VERSIONS from ifcparse: ${SCHEMA_VERSIONS}")
|
|
|
|
|
foreach(schema ${SCHEMA_VERSIONS})
|
|
|
|
|
list(APPEND IFCPARSE_H_FILES
|
2026-03-31 10:02:00 +02:00
|
|
|
schemas/Ifc${schema}.h
|
|
|
|
|
schemas/Ifc${schema}-definitions.h
|
2025-11-09 08:26:33 +01:00
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2026-03-31 15:32:36 +02:00
|
|
|
list(APPEND IFCPARSE_H_FILES
|
|
|
|
|
schemas/Header_section_schema.h
|
|
|
|
|
)
|
|
|
|
|
list(APPEND IFCPARSE_CPP_FILES
|
|
|
|
|
schemas/Header_section_schema.cpp
|
|
|
|
|
schemas/Header_section_schema-schema.cpp
|
|
|
|
|
)
|
|
|
|
|
|
2025-11-09 08:26:33 +01:00
|
|
|
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
|
|
|
|
|
|
|
|
|
add_library(IfcParse ${IFCPARSE_FILES})
|
2026-05-06 21:17:25 +02:00
|
|
|
set_target_properties(IfcParse PROPERTIES
|
|
|
|
|
OUTPUT_NAME "ifcopenshell.parse"
|
|
|
|
|
)
|
2025-12-12 18:25:59 +05:00
|
|
|
target_compile_definitions(IfcParse PUBLIC ${SCHEMA_DEFINITIONS})
|
2026-04-19 12:32:18 +02:00
|
|
|
if(USE_MMAP)
|
|
|
|
|
target_compile_definitions(IfcParse PUBLIC USE_MMAP)
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_ROCKSDB)
|
|
|
|
|
target_compile_definitions(IfcParse PUBLIC IFOPSH_WITH_ROCKSDB)
|
|
|
|
|
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_ROCKSDB PARENT_SCOPE)
|
|
|
|
|
endif()
|
2026-04-21 16:18:59 +02:00
|
|
|
set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS)
|
|
|
|
|
if (NOT CREATE_BUNDLE)
|
|
|
|
|
set_target_properties(IfcParse PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
|
|
|
|
|
endif()
|
2025-11-09 08:26:33 +01:00
|
|
|
if(WASM_BUILD)
|
2026-04-14 13:50:23 +02:00
|
|
|
target_link_libraries(IfcParse plugin ${BCRYPT_LIBRARIES})
|
2025-11-09 08:26:33 +01:00
|
|
|
else()
|
2026-04-14 13:50:23 +02:00
|
|
|
target_link_libraries(IfcParse plugin ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES})
|
2025-11-09 08:26:33 +01:00
|
|
|
endif()
|
|
|
|
|
|
2026-04-19 12:32:18 +02:00
|
|
|
if(WITH_ROCKSDB)
|
2026-06-04 22:31:02 +01:00
|
|
|
target_link_libraries(IfcParse ${IFCOPENSHELL_ROCKSDB_TARGET})
|
2026-04-19 12:32:18 +02:00
|
|
|
if(WITH_ZSTD)
|
|
|
|
|
target_link_libraries(IfcParse zstd::libzstd_static)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2026-05-06 21:17:25 +02:00
|
|
|
if (NOT WASM_BUILD)
|
|
|
|
|
set(plugin_when_not_wasm plugin)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
foreach(schema ${SCHEMA_VERSIONS})
|
|
|
|
|
set(SCHEMA_PLUGIN_TARGET parse_schema_ifc${schema})
|
|
|
|
|
set(SCHEMA_PLUGIN_SOURCES
|
|
|
|
|
schema_plugin.cpp
|
|
|
|
|
hierarchy_helper.i
|
|
|
|
|
schemas/Ifc${schema}.cpp
|
|
|
|
|
schemas/Ifc${schema}-schema.cpp
|
|
|
|
|
)
|
|
|
|
|
if(schema STREQUAL "4x3_add2")
|
|
|
|
|
list(APPEND SCHEMA_PLUGIN_SOURCES alignment_helper.cpp)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(${SCHEMA_PLUGIN_TARGET} SHARED ${SCHEMA_PLUGIN_SOURCES})
|
|
|
|
|
target_compile_definitions(${SCHEMA_PLUGIN_TARGET} PRIVATE
|
|
|
|
|
IFC_SCHEMA_EXPORTS
|
|
|
|
|
BOOST_DLL_USE_STD_FS
|
|
|
|
|
IfcSchema=Ifc${schema}
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(${SCHEMA_PLUGIN_TARGET} PRIVATE ${plugin_when_not_wasm} IfcParse)
|
|
|
|
|
set_target_properties(${SCHEMA_PLUGIN_TARGET} PROPERTIES
|
|
|
|
|
OUTPUT_NAME "ifcopenshell.parse.schema.ifc${schema}"
|
|
|
|
|
)
|
2026-05-07 14:43:26 +02:00
|
|
|
ifcopenshell_plugin_target(${SCHEMA_PLUGIN_TARGET})
|
2026-05-06 21:17:25 +02:00
|
|
|
|
|
|
|
|
if(WASM_BUILD)
|
2026-05-06 21:38:08 +02:00
|
|
|
target_link_options(${SCHEMA_PLUGIN_TARGET} PRIVATE "SHELL:-s SIDE_MODULE=1" "-O1")
|
2026-05-06 21:17:25 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
list(APPEND schema_libraries ${SCHEMA_PLUGIN_TARGET})
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2025-11-09 08:26:33 +01:00
|
|
|
# CMake installation targets
|
|
|
|
|
install(FILES ${IFCPARSE_H_FILES}
|
|
|
|
|
DESTINATION ${INCLUDEDIR}/ifcparse
|
|
|
|
|
)
|
|
|
|
|
|
2026-05-06 21:17:25 +02:00
|
|
|
install(TARGETS IfcParse ${schema_libraries})
|
|
|
|
|
|
|
|
|
|
set(schema_libraries ${schema_libraries} PARENT_SCOPE)
|