Fix LLVM/OSL library detection on macOS to prefer own OSL libraries.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 4 Mar 2018 06:30:04 +0000 (07:30 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 4 Mar 2018 06:40:21 +0000 (07:40 +0100)
build_files/cmake/platform/platform_apple.cmake

index 1435572fa5e912384f6c88f3526665a22ee10f7c..caaf7b96d0ecbcd6e2a85fd4c4c748dd9ecfc042 100644 (file)
@@ -29,6 +29,9 @@ endmacro()
 
 if(NOT DEFINED LIBDIR)
        set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
 
 if(NOT DEFINED LIBDIR)
        set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin)
+       # Prefer lib directory paths
+       file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
+       set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
 else()
        message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
 endif()
 else()
        message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}")
 endif()
@@ -325,8 +328,8 @@ if(WITH_OPENVDB)
 endif()
 
 if(WITH_LLVM)
 endif()
 
 if(WITH_LLVM)
-       set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH     "Path to the LLVM installation")
-       set(LLVM_VERSION "3.4" CACHE STRING     "Version of LLVM to use")
+       set(LLVM_ROOT_DIR ${LIBDIR}/llvm)
+       set(LLVM_VERSION 3.4)
        if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
                set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
        else()
        if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
                set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
        else()
@@ -363,7 +366,7 @@ if(WITH_LLVM)
 endif()
 
 if(WITH_CYCLES_OSL)
 endif()
 
 if(WITH_CYCLES_OSL)
-       set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
+       set(CYCLES_OSL ${LIBDIR}/osl)
 
        find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
        find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
 
        find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
        find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)