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:
authorBrecht Van Lommel <brecht@blender.org>2022-10-04 20:29:52 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-10-04 21:24:27 +0300
commitea95d042455157fec7930e6cc1599bc46c920cca (patch)
treec95a3523a8a222ef4fc6ccce7841075d20ebb960
parent6167a065a5d6eb1db356f4d93f05a9bc315eebb5 (diff)
Build: integrate OpenPGL into platform files like other libraries
To avoid issues with install_deps. If we more generally switch to using CMake configs then perhaps this code can be deduplicated again or at least simplified.
-rw-r--r--build_files/cmake/platform/platform_apple.cmake12
-rw-r--r--build_files/cmake/platform/platform_unix.cmake12
-rw-r--r--build_files/cmake/platform/platform_win32.cmake13
-rw-r--r--intern/cycles/cmake/external_libs.cmake8
4 files changed, 39 insertions, 6 deletions
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 04fa1561f88..9f1824ec827 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -429,6 +429,18 @@ if(WITH_HARU)
endif()
endif()
+if(WITH_CYCLES_PATH_GUIDING)
+ find_package(openpgl QUIET)
+ if(openpgl_FOUND)
+ get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
+ get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
+ message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
+ else()
+ set(WITH_CYCLES_PATH_GUIDING OFF)
+ message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
+ endif()
+endif()
+
set(ZSTD_ROOT_DIR ${LIBDIR}/zstd)
find_package(Zstd REQUIRED)
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index 47410b5f368..35103ec441b 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -584,6 +584,18 @@ if(WITH_HARU)
endif()
endif()
+if(WITH_CYCLES_PATH_GUIDING)
+ find_package_wrapper(openpgl)
+ if(openpgl_FOUND)
+ get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
+ get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
+ message(STATUS "Found OpenPGL: ${OPENPGL_LIBRARIES}")
+ else()
+ set(WITH_CYCLES_PATH_GUIDING OFF)
+ message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
+ endif()
+endif()
+
if(EXISTS ${LIBDIR})
without_system_libs_end()
endif()
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 866d0bede3d..4778ddebea6 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -936,6 +936,19 @@ if(WITH_HARU)
endif()
endif()
+if(WITH_CYCLES_PATH_GUIDING)
+ find_package(openpgl QUIET)
+ if(openpgl_FOUND)
+ get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE)
+ get_target_property(OPENPGL_LIBRARIES_DEBUG openpgl::openpgl LOCATION_DEBUG)
+ set(OPENPGL_LIBRARIES optimized ${OPENPGL_LIBRARIES_RELEASE} debug ${OPENPGL_LIBRARIES_DEBUG})
+ get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
+ else()
+ set(WITH_CYCLES_PATH_GUIDING OFF)
+ message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
+ endif()
+endif()
+
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index ac508e36965..9335024f2eb 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -104,10 +104,6 @@ if(CYCLES_STANDALONE_REPOSITORY)
else()
unset(_cycles_lib_dir)
endif()
-else()
- if(EXISTS ${LIBDIR})
- set(_cycles_lib_dir ${LIBDIR})
- endif()
endif()
###########################################################################
@@ -277,7 +273,7 @@ endif()
# OpenPGL
###########################################################################
-if(WITH_CYCLES_PATH_GUIDING)
+if(CYCLES_STANDALONE_REPOSITORY AND WITH_CYCLES_PATH_GUIDING)
if(EXISTS ${_cycles_lib_dir})
set(openpgl_DIR ${_cycles_lib_dir}/openpgl/lib/cmake/openpgl)
endif()
@@ -545,7 +541,7 @@ endif()
if(CYCLES_STANDALONE_REPOSITORY)
if((WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) OR
- WITH_CYCLES_HYDRA_RENDER_DELEGATE)
+ WITH_CYCLES_HYDRA_RENDER_DELEGATE)
if(MSVC AND EXISTS ${_cycles_lib_dir})
set(Epoxy_LIBRARIES "${_cycles_lib_dir}/epoxy/lib/epoxy.lib")
set(Epoxy_INCLUDE_DIRS "${_cycles_lib_dir}/epoxy/include")