mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Continue work on plug-in and tests
This commit is contained in:
@@ -11,16 +11,17 @@ foreach(file ${IFCPARSE_CPP_FILES_ALL})
|
||||
list(APPEND IFCPARSE_CPP_FILES "${file}")
|
||||
endforeach()
|
||||
|
||||
list(REMOVE_ITEM IFCPARSE_CPP_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/schema_plugin.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/alignment_helper.cpp
|
||||
)
|
||||
|
||||
message(STATUS "SCHEMA_VERSIONS from ifcparse: ${SCHEMA_VERSIONS}")
|
||||
foreach(schema ${SCHEMA_VERSIONS})
|
||||
list(APPEND IFCPARSE_H_FILES
|
||||
schemas/Ifc${schema}.h
|
||||
schemas/Ifc${schema}-definitions.h
|
||||
)
|
||||
list(APPEND IFCPARSE_CPP_FILES
|
||||
schemas/Ifc${schema}.cpp
|
||||
schemas/Ifc${schema}-schema.cpp
|
||||
)
|
||||
endforeach()
|
||||
|
||||
list(APPEND IFCPARSE_H_FILES
|
||||
@@ -34,7 +35,9 @@ list(APPEND IFCPARSE_CPP_FILES
|
||||
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
||||
|
||||
add_library(IfcParse ${IFCPARSE_FILES})
|
||||
add_library(parse ALIAS IfcParse)
|
||||
set_target_properties(IfcParse PROPERTIES
|
||||
OUTPUT_NAME "ifcopenshell.parse"
|
||||
)
|
||||
target_compile_definitions(IfcParse PUBLIC ${SCHEMA_DEFINITIONS})
|
||||
if(USE_MMAP)
|
||||
target_compile_definitions(IfcParse PUBLIC USE_MMAP)
|
||||
@@ -60,9 +63,45 @@ if(WITH_ROCKSDB)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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}"
|
||||
)
|
||||
|
||||
if(WASM_BUILD)
|
||||
target_link_options(${SCHEMA_PLUGIN_TARGET} PRIVATE "SHELL:-s SIDE_MODULE=1")
|
||||
endif()
|
||||
|
||||
list(APPEND schema_libraries ${SCHEMA_PLUGIN_TARGET})
|
||||
endforeach()
|
||||
|
||||
# CMake installation targets
|
||||
install(FILES ${IFCPARSE_H_FILES}
|
||||
DESTINATION ${INCLUDEDIR}/ifcparse
|
||||
)
|
||||
|
||||
install(TARGETS IfcParse)
|
||||
install(TARGETS IfcParse ${schema_libraries})
|
||||
|
||||
set(schema_libraries ${schema_libraries} PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user