Cmake/macOS: strictly disallow searching in frameworks

This is a stricter version of the change made in
{rBbb872b25f219d1a9bc2446228b6dc}

Cmake must never look into Frameworks when the system
library guards (`without_system_libs_begin`/`without_system_libs_end`)
are present.

OpenAL didn't follow this and OpenAL.framework in Xcode would be used.
The Cmake's `FindOpenAL.cmake` looks for both library (in this case,
the .framework file), and include dir.
Precompiled libraries don't contain the former. So `find_package`
cannot be used, or it becomes the hack that {rBb2c707747da9} removed.
So hardcode the include dir path, and other variables.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9267
This commit is contained in:
Ankit Meel 2020-10-19 18:45:44 +05:30 committed by Ankit Meel
parent 4d9f357bf6
commit 83124856d0
Notes: blender-bot 2023-02-14 10:32:59 +01:00
Referenced by commit 4fb67ae809, CMake/macOS: use system OpenAL for the time being.
2 changed files with 7 additions and 7 deletions

View File

@ -1243,7 +1243,7 @@ macro(without_system_libs_begin)
set(CMAKE_IGNORE_PATH "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES};${CMAKE_SYSTEM_INCLUDE_PATH};${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES};${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}")
if(APPLE)
# Avoid searching for headers in frameworks (like Mono), and libraries in LIBDIR.
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_FRAMEWORK NEVER)
endif()
endmacro()

View File

@ -73,12 +73,12 @@ if(EXISTS ${LIBDIR})
endif()
if(WITH_OPENAL)
find_package(OpenAL)
if(OPENAL_FOUND)
set(WITH_OPENAL ON)
else()
set(WITH_OPENAL OFF)
endif()
# Hardcoding this is better than CMake searching in `~/Library/Frameworks`
# or `/Library/Frameworks` or Xcode SDK's frameworks.
set(OPENAL_INCLUDE_DIR "${LIBDIR}/openal/include/AL")
set(OPENAL_LIBRARY)
set(OPENAL_FOUND TRUE)
print_found_status("OpenAL" "${OPENAL_INCLUDE_DIR}")
endif()
if(WITH_ALEMBIC)