2025-11-15 21:13:05 +01:00
|
|
|
add_subdirectory(schema_dependent)
|
|
|
|
|
|
|
|
|
|
file(GLOB SERIALIZERS_H_FILES *.h)
|
|
|
|
|
file(GLOB SERIALIZERS_CPP_FILES *.cpp)
|
|
|
|
|
set(SERIALIZERS_FILES ${SERIALIZERS_H_FILES} ${SERIALIZERS_CPP_FILES})
|
|
|
|
|
|
|
|
|
|
add_library(Serializers ${SERIALIZERS_FILES})
|
2025-12-20 13:27:35 +05:00
|
|
|
set_target_properties(
|
|
|
|
|
Serializers
|
|
|
|
|
PROPERTIES
|
|
|
|
|
COMPILE_FLAGS "-DSERIALIZERS_EXPORTS"
|
|
|
|
|
VERSION "${PROJECT_VERSION}"
|
|
|
|
|
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
2025-12-12 14:28:07 +05:00
|
|
|
)
|
2025-11-15 21:13:05 +01:00
|
|
|
set(SERIALIZER_SCHEMA_LIBRARIES Serializers ${SERIALIZER_SCHEMA_LIBRARIES} PARENT_SCOPE)
|
|
|
|
|
|
|
|
|
|
if(WITH_PROJ)
|
2025-12-04 19:15:41 +01:00
|
|
|
find_package(PROJ REQUIRED)
|
2025-11-15 21:13:05 +01:00
|
|
|
target_compile_definitions(Serializers PRIVATE "WITH_PROJ")
|
|
|
|
|
if(PROJ_STATIC)
|
|
|
|
|
target_compile_definitions(Serializers PRIVATE "PROJ_DLL=")
|
|
|
|
|
endif()
|
2025-12-04 19:15:41 +01:00
|
|
|
target_link_libraries(Serializers PRIVATE PROJ::proj)
|
2025-11-15 21:13:05 +01:00
|
|
|
endif()
|
|
|
|
|
|
2025-12-20 13:27:35 +05:00
|
|
|
target_link_libraries(
|
|
|
|
|
Serializers
|
2025-12-02 17:58:35 +05:00
|
|
|
PRIVATE
|
2025-12-20 13:27:35 +05:00
|
|
|
${SERIALIZER_SCHEMA_LIBRARIES}
|
|
|
|
|
${OPENCOLLADA_LIBRARIES}
|
|
|
|
|
${USD_LIBRARIES}
|
|
|
|
|
${GLTF_LIBRARIES}
|
|
|
|
|
IfcGeom
|
|
|
|
|
${OpenCASCADE_LIBRARIES}
|
|
|
|
|
${kernel_libraries}
|
|
|
|
|
IfcParse
|
2025-12-02 17:58:35 +05:00
|
|
|
)
|
2025-11-15 21:13:05 +01:00
|
|
|
|
2026-06-17 14:28:23 +02:00
|
|
|
install(TARGETS Serializers EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
2025-11-15 21:13:05 +01:00
|
|
|
|
2025-12-12 14:28:07 +05:00
|
|
|
# Can't use `PUBLIC_HEADER` since we need two folders.
|
2025-12-20 13:27:35 +05:00
|
|
|
install(FILES ${SERIALIZERS_H_FILES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/")
|
|
|
|
|
install(FILES ${SERIALIZERS_S_H_FILES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/schema_dependent")
|