a4a6473
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
Lars Tangvald 9be4f7f
index f77bd022..a3a3bd9f 100644
a4a6473
--- a/mysql-test/CMakeLists.txt
a4a6473
+++ b/mysql-test/CMakeLists.txt
Lars Tangvald 9be4f7f
@@ -57,6 +57,9 @@ IF(INSTALL_MYSQLTESTDIR)
a4a6473
 ENDIF()
1a2ec63
 
1a2ec63
 
Lars Tangvald 780acf2
+# Expand some paths in the perl script correctly
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
Lars Tangvald 780acf2
   FIND_PROGRAM(PERL_EXECUTABLE perl
a4a6473
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
Lars Tangvald 9be4f7f
index b82611fd..7fc5987e 100755
a4a6473
--- a/mysql-test/mysql-test-run.pl
a4a6473
+++ b/mysql-test/mysql-test-run.pl
Lars Tangvald 9be4f7f
@@ -1656,7 +1656,7 @@ sub command_line_setup {
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