summaryrefslogtreecommitdiffstats
path: root/bin/qt-configure-module.bat.in
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-08-31 10:38:53 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-09-11 00:41:10 +0200
commit457cf10f7e0d91dd23dd499f6b70f0224e35e8be (patch)
tree2adc117d96b73d2dc103dc669e9a8eda6ad59ea0 /bin/qt-configure-module.bat.in
parentc30ea1f4124420f7d9e961f51898cedbe4c5d4ee (diff)
CMake: Introduce qt-configure-module
Add a convenience script to configure a Qt module separately. This script reads and interprets the qt_cmdline.cmake files of the Qt module to be configured and eventually calls qt-cmake-private. Example usage: <install-prefix>/bin/qt-configure-module <source-root>/qtdeclarative -qml-network -- --trace-expand --trace-redirect=cmake.trace Change-Id: I026f1a050cd3f4df740611c32ba8c03161bba7a3 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'bin/qt-configure-module.bat.in')
-rw-r--r--bin/qt-configure-module.bat.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/bin/qt-configure-module.bat.in b/bin/qt-configure-module.bat.in
new file mode 100644
index 0000000000..fa49723741
--- /dev/null
+++ b/bin/qt-configure-module.bat.in
@@ -0,0 +1,38 @@
+@echo off
+setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
+set script_dir_path=%~dp0
+set script_dir_path=%script_dir_path:~0,-1%
+
+if "%1" == "" (
+ call :print_usage
+ exit /b 1
+)
+
+set module_root=%1
+shift
+if not exist "%module_root%\CMakeLists.txt" (
+ echo Error: %module_root% is not a valid Qt module source directory. >&2
+ call :print_usage
+ exit /b 1
+)
+
+if exist "config.opt" del "config.opt"
+set first_iteration=indeed
+for %%a in (%*) do (
+ if defined first_iteration (
+ :: Drop the first argument, which is the module root.
+ set first_iteration=
+ ) else (
+ echo %%a >> "config.opt"
+ )
+)
+
+set cmake_script_path=%script_dir_path%\@__relative_path_to_processconfigureargs_script@
+call "%script_dir_path%"\qt-cmake-private.bat -DOPTFILE=config.opt -DMODULE_ROOT="%module_root%" ^
+ -DCMAKE_COMMAND="%script_dir_path%\qt-cmake-private.bat" ^
+ -P "%cmake_script_path%"
+goto :eof
+
+:print_usage
+echo Usage: qt-configure-module ^<module-source-dir^> [options]
+goto :eof