a4a6473
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
Norvald H. Ryeng 905ffd5
index 7c1e82b5..a92ba915 100644
a4a6473
--- a/mysql-test/CMakeLists.txt
a4a6473
+++ b/mysql-test/CMakeLists.txt
a4a6473
@@ -56,6 +56,10 @@ INSTALL(
a4a6473
 ENDIF()
1a2ec63
 
1a2ec63
 
a4a6473
+# Expand some paths in the perl scripts correctly
a4a6473
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/lib/My/ConfigFactory.pm ${CMAKE_CURRENT_SOURCE_DIR}/lib/My/ConfigFactory.pm @ONLY)
a4a6473
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql-test-run.pl ${CMAKE_CURRENT_SOURCE_DIR}/mysql-test-run.pl @ONLY)
a4a6473
+
a4a6473
 IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
a4a6473
   # Enable running mtr from build directory
a4a6473
   CONFIGURE_FILE(
a4a6473
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
Norvald H. Ryeng 905ffd5
index 8c058527..7acd8534 100755
a4a6473
--- a/mysql-test/mysql-test-run.pl
a4a6473
+++ b/mysql-test/mysql-test-run.pl
Norvald H. Ryeng 905ffd5
@@ -1479,11 +1479,11 @@ sub command_line_setup {
1a2ec63
   }
1a2ec63
 
1a2ec63
   # Look for language files and charsetsdir, use same share
Norvald H. Ryeng 905ffd5
-  $path_language = mtr_path_exists("$bindir/share/mysql", "$bindir/share");
Norvald H. Ryeng 905ffd5
+  $path_language = mtr_path_exists("$bindir/@INSTALL_MYSQLSHAREDIR@", "$bindir/share/mysql", "$bindir/share");
Norvald H. Ryeng 905ffd5
   my $path_share = $path_language;
1a2ec63
 
Norvald H. Ryeng 905ffd5
   @share_locations =
ffd96fa
-    ("share/mysql-" . $mysql_base_version, "share/mysql", "share");
ffd96fa
+    ("@INSTALL_MYSQLSHAREDIR@", "share/mysql-" . $mysql_base_version, "share/mysql", "share");
a4a6473
 
Norvald H. Ryeng 905ffd5
   $path_charsetsdir = my_find_dir($basedir, \@share_locations, "charsets");
1a2ec63