# HG changeset patch
# User Nick Wellnhofer <wellnhofer@aevum.de>
# Date 1662584367 -7200
#      Wed Sep 07 22:59:27 2022 +0200
# Node ID ad2b88a65cef6e39372fa552dd7008aef1da8581
# Parent  6fadedc3dc4eca6aec9e71e0479b5bb9982fb04d
tests: Fix LIBXSLT_PLUGINS_PATH for multi-config CMake

Required for the MSVC tests.

I wonder if there's an easier way to get the actual binary dir for
multi-config CMake generators.

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -377,11 +377,17 @@
 				PREFIX ""
 				OUTPUT_NAME xmlsoft_org_xslt_testplugin
 			)
+			# There must be an easier way...
+			get_cmake_property(MULTI_CONFIG GENERATOR_IS_MULTI_CONFIG)
+			if (MULTI_CONFIG)
+				set(PLUGINS_PATH ${PROJECT_BINARY_DIR}/$<CONFIG>)
+			else()
+				set(PLUGINS_PATH ${PROJECT_BINARY_DIR})
+			endif()
 			set_tests_properties(
 				runtest PROPERTIES
-				ENVIRONMENT "LIBXSLT_PLUGINS_PATH=${CMAKE_CURRENT_BINARY_DIR}"
-			)
-		endif()
+				ENVIRONMENT LIBXSLT_PLUGINS_PATH=${PLUGINS_PATH}
+		)
 	endif()
 
 	if(Threads_FOUND)