Skip to content
Permalink
Browse files

Add extra CXXFLAGS flags set by user; can be -D CXX_EXTRA_FLAGS or en…

…vironment variable

- Command line -D option overrides environment variable
- Useful for suppressing transient upstream warnings in dependencies, like Qt
  • Loading branch information
dakcarto committed Sep 24, 2013
1 parent 1ca2258 commit 3fce4a5c0a7e84f485a4b090dd94b07bec4987c5
Showing with 12 additions and 0 deletions.
  1. +12 −0 CMakeLists.txt
@@ -327,6 +327,18 @@ IF (PEDANTIC)
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-overloaded-virtual")
ENDIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")

# add any extra CXXFLAGS flags set by user. can be -D CXX_EXTRA_FLAGS or environment variable
# command line -D option overrides environment variable
# e.g. useful for suppressing transient upstream warnings in dependencies, like Qt
SET(CXX_EXTRA_FLAGS "" CACHE STRING "Additional appended CXXFLAGS")
IF ("${CXX_EXTRA_FLAGS}" STREQUAL "" AND DEFINED $ENV{CXX_EXTRA_FLAGS})
SET(CXX_EXTRA_FLAGS "$ENV{CXX_EXTRA_FLAGS}")
ENDIF ("${CXX_EXTRA_FLAGS}" STREQUAL "" AND DEFINED $ENV{CXX_EXTRA_FLAGS})
IF (NOT "${CXX_EXTRA_FLAGS}" STREQUAL "")
MESSAGE (STATUS "Appending CXX_EXTRA_FLAGS")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_EXTRA_FLAGS}")
ENDIF (NOT "${CXX_EXTRA_FLAGS}" STREQUAL "")
ENDIF (MSVC)

ENDIF (PEDANTIC)

0 comments on commit 3fce4a5

Please sign in to comment.
You can’t perform that action at this time.