Skip to content

Commit cee5c16

Browse files
committed
Fix includes
- Add project's own with BEFORE so they come before system ones, and, for example, tinyxml2.h from other version of tinyxml installed systemwide is not picked up - Add system includes with SYSTEM - Fix includes for Ogg/Vorbis (add missing VORBIS_INCLUDE_DIR, spell VORBISFILE_INCLUDE_DIR(S) correctly - Remove duplicate include_directories statements
1 parent 17adb91 commit cee5c16

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if (ENABLE_OGG)
8888

8989
if (OGGVORBIS_FOUND AND VORBISFILE_FOUND)
9090
add_definitions(-D__HAVE_OGG)
91-
include_directories(${VORBISFILE_INCLUDE_DIR})
91+
include_directories(SYSTEM ${VORBIS_INCLUDE_DIR} ${VORBISFILE_INCLUDE_DIRS})
9292
set(OAML_LIBS ${OAML_LIBS} ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARIES})
9393
endif()
9494
endif()
@@ -118,7 +118,7 @@ if (ENABLE_RTAUDIO)
118118
find_package(ALSA)
119119
if (ALSA_FOUND)
120120
find_package(Threads REQUIRED CMAKE_THREAD_PREFER_PTHREAD)
121-
include_directories(${ALSA_INCLUDE_DIR})
121+
include_directories(SYSTEM ${ALSA_INCLUDE_DIR})
122122
list(APPEND OAML_LIBS ${ALSA_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
123123
add_definitions(-D__LINUX_ALSA__)
124124
message(STATUS "RtAudio: Using Linux ALSA")
@@ -163,10 +163,8 @@ endif()
163163
##
164164
# Build static and shared libraries
165165
#
166-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
167-
168166
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/GitSHA1.h.in" "${CMAKE_CURRENT_BINARY_DIR}/include/GitSHA1.h" @ONLY)
169-
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
167+
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
170168

171169
include(CheckIncludeFiles)
172170
check_include_files("${CMAKE_CURRENT_BINARY_DIR}/include/GitSha1.h" HAVE_GITSHA1_H)

0 commit comments

Comments
 (0)