Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/platform/platform_unix.cmake')
-rw-r--r--build_files/cmake/platform/platform_unix.cmake48
1 files changed, 40 insertions, 8 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 62e0caa7c43..e13dd594631 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -23,6 +23,19 @@
# Libraries configuration for any *nix system including Linux and Unix.
+# Detect precompiled library directory
+set(LIBDIR_NAME ${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR})
+string(TOLOWER ${LIBDIR_NAME} LIBDIR_NAME)
+set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_NAME})
+
+if(EXISTS ${LIBDIR})
+ file(GLOB LIB_SUBDIRS ${LIBDIR}/*)
+ set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
+ set(WITH_STATIC_LIBS ON)
+ set(WITH_OPENMP_STATIC ON)
+endif()
+
+# Wrapper to prefer static libraries
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
find_package_static(${ARGV})
@@ -31,7 +44,7 @@ macro(find_package_wrapper)
endif()
endmacro()
-find_package_wrapper(JPEG REQUIRED)
+find_package_wrapper(JPG REQUIRED)
find_package_wrapper(PNG REQUIRED)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Freetype REQUIRED)
@@ -141,8 +154,15 @@ if(WITH_CODEC_SNDFILE)
endif()
if(WITH_CODEC_FFMPEG)
- set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
- set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
+ if(EXISTS ${LIBDIR})
+ # For precompiled lib directory, all ffmpeg dependencies are in the same folder
+ file(GLOB ffmpeg_libs ${LIBDIR}/ffmpeg/lib/*.a ${LIBDIR}/sndfile/lib/*.a)
+ set(FFMPEG ${LIBDIR}/ffmpeg CACHE PATH "FFMPEG Directory")
+ set(FFMPEG_LIBRARIES ${ffmpeg_libs} ${ffmpeg_libs} CACHE STRING "FFMPEG Libraries")
+ else()
+ set(FFMPEG /usr CACHE PATH "FFMPEG Directory")
+ set(FFMPEG_LIBRARIES avformat avcodec avutil avdevice swscale CACHE STRING "FFMPEG Libraries")
+ endif()
mark_as_advanced(FFMPEG)
@@ -217,10 +237,14 @@ endif()
if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
+ find_package_wrapper(Blosc)
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
+ elseif(NOT BLOSC_FOUND)
+ set(WITH_OPENVDB_BLOSC OFF)
+ message(STATUS "Blosc not found, disabling it")
endif()
endif()
@@ -329,6 +353,14 @@ if(WITH_OPENCOLORIO)
endif()
if(WITH_LLVM)
+ # Symbol conflicts with same UTF library used by OpenCollada
+ if(EXISTS ${LIBDIR})
+ set(LLVM_STATIC ON)
+ if(WITH_OPENCOLLADA)
+ list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
+ endif()
+ endif()
+
find_package_wrapper(LLVM)
if(NOT LLVM_FOUND)
@@ -358,7 +390,11 @@ if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
-list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
+if(HAIKU)
+ list(APPEND PLATFORM_LINKLIBS -lnetwork)
+else()
+ list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
+endif()
find_package(Threads REQUIRED)
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
@@ -400,10 +436,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
-# Solaris CC
-elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro")
- set(PLATFORM_CFLAGS "-pipe -features=extensions -fPIC -D__FUNCTION__=__func__")
-
# Intel C++ Compiler
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
# think these next two are broken