How to disable warnings of GCC compiler both in header and source files?
In main CMakeLisits.txt:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weffc++ -std=c++11")
...
add_subdirectory(lib)
In lib CMakeLisits.txt:
set(lib_SOURCES
...)
include_directories(${lib_SOURCE_DIR}/include ${lib_BINARY_DIR}/include)
add_library(ilib STATIC ${ilib_EXTRA_CFLAGS} ${ilib_SOURCES})
...
..
I've tried add in lib CMakeLists.txt
include_directories(SYSTEM ${lib_SOURCE_DIR}/include ${lib_BINARY_DIR}/include)
and it helped with headers, but I still have warnings in *.cpp
files
Then I tried
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-effc++")
in lib, CMakeLists.txt, and warnings in header appeared again
Don't understand what's happening
CMake version 2.8.12.2
gcc version 4.9.3