File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -286,12 +286,25 @@ find_package(GBL)
286286set_package_properties (GBL PROPERTIES TYPE REQUIRED )
287287if (GBL_FOUND AND NOT TARGET GBL::GBL)
288288 # As of now, GBL does not provide a cmake target so create a compatibility wrapper
289+ # also GBL_LIBRARIES contains raw linker flags to ROOT we need to filter out
290+ set (GBL_LIBRARIES_FILTERED "" )
291+ set (GBL_LINK_OPTIONS "" )
292+ foreach (_lib IN LISTS GBL_LIBRARIES)
293+ if (_lib MATCHES "^-[lL]" )
294+ continue ()
295+ elseif (_lib MATCHES "^-" )
296+ list (APPEND GBL_LINK_OPTIONS "${_lib} " )
297+ else ()
298+ list (APPEND GBL_LIBRARIES_FILTERED "${_lib} " )
299+ endif ()
300+ endforeach ()
289301 add_library (GBL::GBL INTERFACE IMPORTED )
290302 target_include_directories (GBL::GBL INTERFACE ${GBL_INCLUDE_DIR} )
291303 target_link_libraries (GBL::GBL INTERFACE
292- ${GBL_LIBRARIES }
304+ ${GBL_LIBRARIES_FILTERED }
293305 Eigen3::Eigen
294306 )
307+ target_link_options (GBL::GBL INTERFACE ${GBL_LINK_OPTIONS} )
295308endif ()
296309
297310feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES )
You can’t perform that action at this time.
0 commit comments