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 /build_files/cmake
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.
Diffstat (limited to 'build_files/cmake')
-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
3 files changed, 37 insertions, 0 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)