CMake: Comply with include path reported by FindOpenGL.cmake
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2018 13:08:28 +0000 (15:08 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Aug 2018 13:08:28 +0000 (15:08 +0200)
The script clearly states:

  This makes the presumption that you are include al.h like
  #include "al.h"
  and not
  #include <AL/al.h>
  The reason for this is that the latter is not entirely portable.
  Windows/Creative Labs does not by default put their headers in AL/ and
  OS X uses the convention <OpenAL/al.h>.

This commit makes default precompiled OpenAL to be properly detected
and also removes hack on MacOS which was finding the OpenAL package but
then was overwriting include directory.

Note, that new audaspace in 2.8 is using expected #include <al.h>.

build_files/cmake/platform/platform_apple.cmake
build_files/cmake/platform/platform_win32.cmake
intern/audaspace/OpenAL/AUD_OpenALDevice.h

index faed0cf25fc48c0cd0c9fbc0a4d58fb40f222bd0..b9c898e60d8ffbb491165127a3c15fcc7459d55a 100644 (file)
@@ -43,7 +43,6 @@ if(WITH_OPENAL)
        find_package(OpenAL)
        if(OPENAL_FOUND)
                set(WITH_OPENAL ON)
-               set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include")
        else()
                set(WITH_OPENAL OFF)
        endif()
index 1460808038d1f0ac9fb4ef8b257c08c6aef03797..07dc3ec067113cedf04c701d95db873826ad62c0 100644 (file)
@@ -556,7 +556,7 @@ set(WINTAB_INC ${LIBDIR}/wintab/include)
 if(WITH_OPENAL)
        set(OPENAL ${LIBDIR}/openal)
        set(OPENALDIR ${LIBDIR}/openal)
-       set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
+       set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
        set(OPENAL_LIBPATH ${OPENAL}/lib)
        if(MSVC)
                set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
index f0e478249671dd2eb9ec7a2cd64a33d0cb4d3cf1..4fe7a5dcf390bbc02e3ff544753a1113fb0b8816 100644 (file)
@@ -37,8 +37,8 @@
 #include "AUD_Buffer.h"
 //struct AUD_OpenALBufferedFactory;
 
-#include <AL/al.h>
-#include <AL/alc.h>
+#include <al.h>
+#include <alc.h>
 #include <list>
 #include <pthread.h>