From 447368b472962fc4431f713a7908e26abe3aaf90 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 27 Sep 2022 10:48:09 -0600 Subject: Fix: OpenPGL related build error on windows Debug and Release libs are different libs on Windows and will give linker errors when you try to mix and match them. This changes retrieves both libs and fills the OPENPGL_LIBRARIES variable appropriately resolving the linker error. --- intern/cycles/cmake/external_libs.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index ab709b1ca10..184bf7d6ae3 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -284,7 +284,13 @@ if(WITH_CYCLES_PATH_GUIDING) find_package(openpgl QUIET) if(openpgl_FOUND) - get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION) + if(WIN32) + 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}) + else() + get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION) + endif() get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES) else() set(WITH_CYCLES_PATH_GUIDING OFF) -- cgit v1.2.3