Skip to content

Commit

Permalink
Add external includes as SYSTEM
Browse files Browse the repository at this point in the history
For instance, this disables warnings generated in third party headers (such as numerous -Wzero-as-null-pointer-constant in vorbisfile.h)
  • Loading branch information
AMDmi3 committed Oct 16, 2018
1 parent 185de0a commit 8ee683e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ ENDIF(LINUX)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/share/cmake)
FIND_PACKAGE(SDL2 REQUIRED)
IF(SDL2_FOUND)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${SDL2_INCLUDE_DIR})
SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${SDL2_LIBRARY})
ELSE(SDL2_FOUND)
MESSAGE(FATAL_ERROR "libSDL2 not found")
ENDIF(SDL2_FOUND)

FIND_PACKAGE(OpenGL REQUIRED)
IF(OPENGL_FOUND)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${OPENGL_LIBRARIES})
ELSE(OPENGL_FOUND)
MESSAGE(FATAL_ERROR "OpenGL not found")
Expand All @@ -73,7 +73,7 @@ FIND_PATH(ALUT_INCLUDE_DIR alut.h
PATH_SUFFIXES include/AL include)
IF(ALUT_INCLUDE_DIR)
MESSAGE(STATUS "Found alut headers: ${ALUT_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${ALUT_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${ALUT_INCLUDE_DIR})
ELSE(ALUT_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "alut headers not found")
ENDIF(ALUT_INCLUDE_DIR)
Expand All @@ -96,7 +96,7 @@ FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h
PATH_SUFFIXES include)
IF(OGG_INCLUDE_DIR)
MESSAGE(STATUS "Found ogg headers: ${OGG_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${OGG_INCLUDE_DIR})
ELSE(OGG_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "ogg headers not found")
ENDIF(OGG_INCLUDE_DIR)
Expand Down Expand Up @@ -132,7 +132,7 @@ FIND_PATH(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h
PATH_SUFFIXES vorbis include)
IF(VORBISFILE_INCLUDE_DIR)
MESSAGE(STATUS "Found vorbisfile headers: ${VORBISFILE_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(${VORBISFILE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${VORBISFILE_INCLUDE_DIR})
ELSE(VORBISFILE_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "vorbisfile headers not found")
ENDIF(VORBISFILE_INCLUDE_DIR)
Expand All @@ -154,7 +154,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
PATH_SUFFIXES freetype2)
IF(FREETYPE_INCLUDE_DIR_freetype2)
MESSAGE(STATUS "Found freetype2 headers: ${FREETYPE_INCLUDE_DIR_freetype2}")
INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR_freetype2})
INCLUDE_DIRECTORIES(SYSTEM ${FREETYPE_INCLUDE_DIR_freetype2})
ELSE(FREETYPE_INCLUDE_DIR_freetype2)
EXEC_PROGRAM("freetype-config" ARGS "--cflags" OUTPUT_VARIABLE freetype2_CFLAGS)
IF(freetype2_CFLAGS)
Expand Down

0 comments on commit 8ee683e

Please sign in to comment.