Prepare internal AppleWin build for CMake
[WebKit-https.git] / WebKitLibraries / win / tools / scripts / auto-version.pl
index 3c93f26..a70cc86 100755 (executable)
@@ -34,7 +34,13 @@ sub splitVersion($);
 
 die "You must supply an output path as the argument.\n" if ($#ARGV < 0);
 
-my $thisDirectory = dirname(abs_path($0));
+my $thisDirectory;
+my $WEBKIT_LIBRARIES = $ENV{'WEBKIT_LIBRARIES'};
+if (defined $WEBKIT_LIBRARIES) {
+    $thisDirectory = File::Spec->catfile($WEBKIT_LIBRARIES, 'tools', 'scripts');
+} else {
+    $thisDirectory = dirname(abs_path($0));
+}
 
 my $FALLBACK_VERSION_PATH = File::Spec->catfile($thisDirectory, 'VERSION');
 open(FALLBACK_VERSION_FILE, '<', $FALLBACK_VERSION_PATH) or die "Unable to open $FALLBACK_VERSION_PATH: $!";