cmake: Link Eigen3 only against targets needing it

This commit is contained in:
Esteban DUGUEPEROUX
2025-11-30 17:06:52 +01:00
committed by Andrej730
parent 9807c2bedf
commit 2e5d87b5d7
4 changed files with 10 additions and 8 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
find_package(Eigen3 REQUIRED)
foreach(schema ${SCHEMA_VERSIONS})
file(GLOB IFCGEOM_I_FILES *.i)
file(GLOB IFCGEOM_H_FILES *.h)
@@ -6,7 +8,7 @@ foreach(schema ${SCHEMA_VERSIONS})
add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES})
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
target_link_libraries(geometry_mapping_ifc${schema} IfcParse)
target_link_libraries(geometry_mapping_ifc${schema} IfcParse Eigen3::Eigen)
list(APPEND mapping_libraries geometry_mapping_ifc${schema})