Compiler flags cascading to other projects [closed]

asked 2013-06-10 11:31:47 -0600

oars gravatar image

I'm having issues with the ros-groovy-visp package as it requires the Cmakelist file to include a separate cmake file: /opt/ros/groovy/share/visp/VISPUse.cmake. The problem arises since this file adds compiler flags which are then affecting compilation for other projects

# Add extra build flags to be able to consider especially for OpenMP
list(APPEND CMAKE_CXX_FLAGS "-fopenmp")
list(APPEND CMAKE_CXX_FLAGS "-std=c++0x")

## Remove duplicates compilation flags separate_arguments(CMAKE_CXX_FLAGS)
list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE)

How can I go about and remove the compiler flags added by this makefile? Are there better ways of handling this?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-05-28 22:29:58.112401