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.cmake78
1 files changed, 46 insertions, 32 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index f1ce3221440..49b7f701de0 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -70,10 +70,6 @@ if(EXISTS ${LIBDIR})
set(CLANG_ROOT_DIR ${LIBDIR}/llvm)
endif()
-if(WITH_STATIC_LIBS)
- string(APPEND CMAKE_EXE_LINKER_FLAGS " -static-libstdc++")
-endif()
-
# Wrapper to prefer static libraries
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
@@ -83,15 +79,6 @@ macro(find_package_wrapper)
endif()
endmacro()
-# Utility to install precompiled shared libraries.
-macro(add_bundled_libraries library)
- if(EXISTS ${LIBDIR})
- file(GLOB _all_library_versions ${LIBDIR}/${library}/lib/*\.so*)
- list(APPEND PLATFORM_BUNDLED_LIBRARIES ${_all_library_versions})
- unset(_all_library_versions)
- endif()
-endmacro()
-
# ----------------------------------------------------------------------------
# Precompiled Libraries
#
@@ -175,6 +162,10 @@ endif()
if(WITH_IMAGE_OPENEXR)
find_package_wrapper(OpenEXR) # our own module
set_and_warn_library_found("OpenEXR" OPENEXR_FOUND WITH_IMAGE_OPENEXR)
+ if(WITH_IMAGE_OPENEXR)
+ add_bundled_libraries(openexr/lib)
+ add_bundled_libraries(imath/lib)
+ endif()
endif()
if(WITH_IMAGE_OPENJPEG)
@@ -214,7 +205,7 @@ if(WITH_SDL)
)
# unset(SDLMAIN_LIBRARY CACHE)
set_and_warn_library_found("SDL" SDL_FOUND WITH_SDL)
- endif()
+ endif()
endif()
# Codecs
@@ -330,11 +321,12 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
endif()
if(WITH_OPENVDB)
- find_package_wrapper(OpenVDB)
+ find_package(OpenVDB)
set_and_warn_library_found("OpenVDB" OPENVDB_FOUND WITH_OPENVDB)
if(OPENVDB_FOUND)
- find_package_wrapper(Blosc)
+ add_bundled_libraries(openvdb/lib)
+ find_package_wrapper(Blosc)
set_and_warn_library_found("Blosc" BLOSC_FOUND WITH_OPENVDB_BLOSC)
endif()
endif()
@@ -356,13 +348,16 @@ endif()
if(WITH_USD)
find_package_wrapper(USD)
set_and_warn_library_found("USD" USD_FOUND WITH_USD)
+ if(WITH_USD)
+ add_bundled_libraries(usd/lib)
+ endif()
endif()
if(WITH_BOOST)
# uses in build instructions to override include and library variables
if(NOT BOOST_CUSTOM)
if(WITH_STATIC_LIBS)
- set(Boost_USE_STATIC_LIBS ON)
+ set(Boost_USE_STATIC_LIBS OFF)
endif()
set(Boost_USE_MULTITHREADED ON)
set(__boost_packages filesystem regex thread date_time)
@@ -378,6 +373,9 @@ if(WITH_BOOST)
if(WITH_OPENVDB)
list(APPEND __boost_packages iostreams)
endif()
+ if(WITH_USD AND USD_PYTHON_SUPPORT)
+ list(APPEND __boost_packages python${PYTHON_VERSION_NO_DOTS})
+ endif()
list(APPEND __boost_packages system)
find_package(Boost 1.48 COMPONENTS ${__boost_packages})
if(NOT Boost_FOUND)
@@ -404,6 +402,8 @@ if(WITH_BOOST)
find_package(IcuLinux)
list(APPEND BOOST_LIBRARIES ${ICU_LIBRARIES})
endif()
+
+ add_bundled_libraries(boost/lib)
endif()
if(WITH_PUGIXML)
@@ -426,7 +426,6 @@ if(WITH_OPENIMAGEIO)
${ZLIB_LIBRARIES}
${BOOST_LIBRARIES}
)
- set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
set(OPENIMAGEIO_DEFINITIONS "")
if(WITH_IMAGE_TIFF)
@@ -440,6 +439,9 @@ if(WITH_OPENIMAGEIO)
endif()
set_and_warn_library_found("OPENIMAGEIO" OPENIMAGEIO_FOUND WITH_OPENIMAGEIO)
+ if(WITH_OPENIMAGEIO)
+ add_bundled_libraries(openimageio/lib)
+ endif()
endif()
if(WITH_OPENCOLORIO)
@@ -470,32 +472,38 @@ if(WITH_LLVM)
set_and_warn_library_found("LLVM" LLVM_FOUND WITH_LLVM)
if(LLVM_FOUND)
- if(WITH_CLANG)
- find_package_wrapper(Clang)
+ if(WITH_CLANG)
+ find_package_wrapper(Clang)
set_and_warn_library_found("Clang" CLANG_FOUND WITH_CLANG)
- endif()
+ endif()
- # Symbol conflicts with same UTF library used by OpenCollada
- if(EXISTS ${LIBDIR})
- if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
- list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
- endif()
+ # Symbol conflicts with same UTF library used by OpenCollada
+ if(EXISTS ${LIBDIR})
+ if(WITH_OPENCOLLADA AND (${LLVM_VERSION} VERSION_LESS "4.0.0"))
+ list(REMOVE_ITEM OPENCOLLADA_LIBRARIES ${OPENCOLLADA_UTF_LIBRARY})
endif()
endif()
+ endif()
endif()
if(WITH_OPENSUBDIV)
- find_package_wrapper(OpenSubdiv)
+ find_package(OpenSubdiv)
set(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARIES})
set(OPENSUBDIV_LIBPATH) # TODO, remove and reference the absolute path everywhere
set_and_warn_library_found("OpenSubdiv" OPENSUBDIV_FOUND WITH_OPENSUBDIV)
+ if(WITH_OPENSUBDIV)
+ add_bundled_libraries(opensubdiv/lib)
+ endif()
endif()
if(WITH_TBB)
find_package_wrapper(TBB)
set_and_warn_library_found("TBB" TBB_FOUND WITH_TBB)
+ if(WITH_TBB)
+ add_bundled_libraries(tbb/lib)
+ endif()
endif()
if(WITH_XR_OPENXR)
@@ -632,11 +640,11 @@ if(WITH_GHOST_WAYLAND)
endif()
if(_use_system_wayland)
- pkg_check_modules(wayland-client wayland-client>=1.12)
- pkg_check_modules(wayland-egl wayland-egl)
- pkg_check_modules(wayland-scanner wayland-scanner)
- pkg_check_modules(wayland-cursor wayland-cursor)
- pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
+ pkg_check_modules(wayland-client wayland-client>=1.12)
+ pkg_check_modules(wayland-egl wayland-egl)
+ pkg_check_modules(wayland-scanner wayland-scanner)
+ pkg_check_modules(wayland-cursor wayland-cursor)
+ pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
else()
# CentOS 7 packages have too old a version, a newer version exist in the
@@ -1020,4 +1028,10 @@ if(PLATFORM_BUNDLED_LIBRARIES)
# and because the build and install folder may be different.
set(CMAKE_SKIP_BUILD_RPATH FALSE)
list(APPEND CMAKE_BUILD_RPATH $ORIGIN/lib ${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/lib)
+
+ # Environment variables to run precompiled executables that needed libraries.
+ list(JOIN PLATFORM_BUNDLED_LIBRARY_DIRS ":" _library_paths)
+ set(PLATFORM_ENV_BUILD "LD_LIBRARY_PATH=\"${_library_paths};${LD_LIBRARY_PATH}\"")
+ set(PLATFORM_ENV_INSTALL "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX_WITH_CONFIG}/lib/;$LD_LIBRARY_PATH")
+ unset(_library_paths)
endif()