CGAL test does not honor linker flags

Bug #1073190 reported by Yaakoub El Khamra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Confirmed
Low
Johannes Ring

Bug Description

the FindCGAL.cmake module tries to compile and link a CGAL test code. The code is linked against ${CMAKE_REQUIRED_LIBRARIES} and ${Boost_LIBRARIES}. It does not honor any linker flags set by the user. An easy work around is to append ${CMAKE_EXE_LINKER_FLAGS} to the list of of required libraries. The following is the resulting diff on the affected file: cmake/modules/FindCGAL.cmake

- set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Boost_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_EXE_LINKER_FLAGS})

I tested this and it works, but there might be a more elegant way of doing this, one that adds the linker flags to all modules where test code is compiled and linked. Anyways, current patch attached.

Regards
Yaakoub

Tags: cmake
Revision history for this message
Yaakoub El Khamra (yelkhamra) wrote :
Johannes Ring (johannr)
Changed in dolfin:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Johannes Ring (johannr)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.