cmake - install headers using PUBLIC_HEADER, deprecate INCLUDEDIR

This commit is contained in:
Andrej730
2025-12-12 14:28:07 +05:00
parent 99835fcab3
commit 5a0f8d30cf
7 changed files with 40 additions and 43 deletions
+7 -6
View File
@@ -1,18 +1,19 @@
add_subdirectory(schema)
add_library(geometry_serializer STATIC Serialization.cpp)
set_target_properties(geometry_serializer PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS")
file(GLOB IFCGEOM_SERIALIZATION_H_FILE *.h)
set_target_properties(geometry_serializer PROPERTIES
COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS"
PUBLIC_HEADER "${IFCGEOM_SERIALIZATION_H_FILE}"
)
target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse)
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} "geometry_serializer" ${geometry_serializer_libraries})
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} PARENT_SCOPE)
file(GLOB IFCGEOM_SERIALIZATION_H_FILE *.h)
install(FILES ${IFCGEOM_SERIALIZATION_H_FILE}
DESTINATION ${INCLUDEDIR}/ifcgeom/Serialization
)
install(TARGETS geometry_serializer ${geometry_serializer_libraries}
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom/Serialization"
)
set(geometry_serializer_libraries ${geometry_serializer_libraries} PARENT_SCOPE)