gcc has an option -isystem, that can replace -I. The documentation is:
-isystem dir
Search dir for header files, after all directories specified by -I but
before the standard system directories. Mark it as a system directory,
so that it gets the same special treatment as is applied to the
standard system directories. If dir begins with "=", then the "=" will
be replaced by the sysroot prefix; see --sysroot and -isysroot.
The "special treatment" means that gcc will not warn about constructions in
headers in directories pointed by -isystem instead of -I.
In the CGAL testsuite, there are a lot of warnings that comes from
third-party libraries (mostly from Boost, but also from Eigen).
This patch tells cmake to use -isystem with gcc, for all CGAL 3rd-party
directories.
31 lines
1.1 KiB
CMake
31 lines
1.1 KiB
CMake
# This module setups the compiler for the RS library.
|
|
# It assumes that find_package(RS) was already called.
|
|
|
|
if( RS_FOUND AND NOT RS_SETUP )
|
|
|
|
message( STATUS "UseRS" )
|
|
message( STATUS "RS include: ${RS_INCLUDE_DIR}" )
|
|
message( STATUS "RS definitions: ${RS_DEFINITIONS}" )
|
|
message( STATUS "RS libraries: ${RS_LIBRARIES}" )
|
|
|
|
if( APPLE AND CMAKE_COMPILER_IS_GNUCXX )
|
|
include( CGAL_VersionUtils )
|
|
EXEC_PROGRAM( ${CMAKE_CXX_COMPILER}
|
|
ARGS -dumpversion
|
|
OUTPUT_VARIABLE RS_GXX_VERSION )
|
|
VERSION_DECOMPOSE( ${RS_GXX_VERSION} GXX_MAJ GXX_MIN GXX_PAT GXX_TWE )
|
|
IS_VERSION_LESS( "${GXX_MAJ}.${GXX_MIN}" "4.3" IS_OLD_GXX )
|
|
if( IS_OLD_GXX )
|
|
message( STATUS "TLS is not supported by g++<4.3 on Mac OS X" )
|
|
add_definitions( "-DCGAL_RS_NO_TLS" )
|
|
endif( IS_OLD_GXX )
|
|
endif( APPLE AND CMAKE_COMPILER_IS_GNUCXX )
|
|
|
|
include_directories ( SYSTEM ${RS_INCLUDE_DIR} )
|
|
add_definitions( ${RS_DEFINITIONS} "-DCGAL_USE_RS" )
|
|
link_libraries( ${RS_LIBRARIES} )
|
|
|
|
set (RS_SETUP TRUE)
|
|
|
|
endif( RS_FOUND AND NOT RS_SETUP )
|