summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/qt-cmake-create.bat.in18
-rwxr-xr-xbin/qt-cmake-create.in29
2 files changed, 47 insertions, 0 deletions
diff --git a/bin/qt-cmake-create.bat.in b/bin/qt-cmake-create.bat.in
new file mode 100644
index 0000000000..ff8f7310e9
--- /dev/null
+++ b/bin/qt-cmake-create.bat.in
@@ -0,0 +1,18 @@
+@echo off
+:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
+set script_dir_path=%~dp0
+
+:: Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
+set cmake_path=@CMAKE_COMMAND@
+if not exist "%cmake_path%" set cmake_path=cmake
+
+if NOT "%~2" == "" goto :showhelp
+if NOT "%~1" == "" (set PROJECT_DIR=%~1) else (set PROJECT_DIR=%cd%)
+
+"%cmake_path%" -DPROJECT_DIR="%PROJECT_DIR%" -P "%script_dir_path%\@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@\QtInitProject.cmake"
+exit /b %errorlevel%
+
+:showhelp
+echo Usage
+echo. qt-cmake-create <path/to/project>
+exit /b 1
diff --git a/bin/qt-cmake-create.in b/bin/qt-cmake-create.in
new file mode 100755
index 0000000000..7865d0fe91
--- /dev/null
+++ b/bin/qt-cmake-create.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+HELP_MESSAGE="Usage
+ qt-cmake-create <path/to/project>"
+
+# The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
+script_dir_path=`dirname $0`
+script_dir_path=`(cd "$script_dir_path"; /bin/pwd)`
+
+# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
+original_cmake_path="@CMAKE_COMMAND@"
+cmake_path=$original_cmake_path
+if ! test -f "$cmake_path"; then
+ cmake_path="cmake"
+fi
+
+if [ "$#" -gt 1 ]; then
+ echo "Invalid number of arguments"
+ echo "$HELP_MESSAGE"
+ exit 1
+fi
+
+if [ "$#" -gt 0 ]; then
+ PROJECT_DIR=$1
+else
+ PROJECT_DIR=$PWD
+fi
+exec "$cmake_path" -DPROJECT_DIR="$PROJECT_DIR" -P \
+ "$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/QtInitProject.cmake"