Commit 7e5e3974 authored by Volker Hilsheimer's avatar Volker Hilsheimer

Support --qmake parameter in build-qt(module) jobs

Use qmake even if cmake is available.

Document things for the build-qt, and a few cleanups.
parent 7ce47e33
Configures and builds Qt from toplevel sources in the current directory
The job performs a top-level build of Qt, and supports Qt 5
(using qmake/make) and Qt 6 (using cmake/ninja).
The build directory on the guest is by default ~/qt-build
By default, the job configures Qt with
-confirm-license -developer-build -opensource -nomake examples
and builds the default target (i.e. all).
Supported job parameters:
--configure "configure line \"with spaces\""
Overrides the default configuration options.
--target target
Build a different target than the default, e.g.
$ minicoin run windows10 build-qt -- --target tst_qobject_check
$ minicoin run doc-server build-qt -- --target html_docs
--build name
Override the default build tree:
$minicoin run ubuntu1804 build-qt -- --build qt-build-5.15
--clean
Delete the build tree before configuring and building.
--qmake
Use qmake build system also if a cmake build system is present.
Ignored if the build is already configured with cmake, combine with
--clean or use a separate --build to switch build systems.
......@@ -12,7 +12,6 @@ if NOT DEFINED JOBDIR (
REM set defaults
if "!PARAM_build!"=="" SET "PARAM_build=qt-build"
SET "build_dir=!PARAM_build!"
if "!PARAM_target!"=="" SET PARAM_target=""
SET "target=!PARAM_target!"
SET error=0
......@@ -24,7 +23,7 @@ if DEFINED FLAG_clean (
if NOT EXIST !build_dir! mkdir !build_dir!
cd !build_dir!
echo Building !JOBDIR! into !build_dir!
echo Building '!JOBDIR!' into '!build_dir!'
if EXIST CMakeCache.txt (
echo Already configured with cmake - run with --clean to reconfigure
......@@ -33,15 +32,21 @@ if EXIST CMakeCache.txt (
echo Already configured with qmake - run with --clean to reconfigure
) else (
if EXIST %JOBDIR%/CMakeLists.txt (
if "%PARAM_configure%"=="" SET "PARAM_configure=-GNinja -DFEATURE_developer_build=ON -DBUILD_EXAMPLES=OFF"
echo Configuring !JOBDIR! with cmake: !PARAM_configure!
echo Pass --configure "configure options" to override
cmake !PARAM_configure! !JOBDIR!
) else (
if "%PARAM_configure%"=="" SET "PARAM_configure=-developer-build -confirm-license -opensource -nomake examples"
echo Configuring !JOBDIR! with qmake: !PARAM_configure!
echo Pass --configure "configure options" to override
!JOBDIR!/configure !PARAM_configure!
if NOT DEFINED FLAG_qmake (
if "%PARAM_configure%"=="" SET "PARAM_configure=-GNinja -DFEATURE_developer_build=ON -DBUILD_EXAMPLES=OFF"
echo Configuring !JOBDIR! with cmake: !PARAM_configure!
echo Pass --configure "configure options" to override
cmake !PARAM_configure! !JOBDIR!
) else (
if EXIST %JOBDIR%/configure.bat (
if "%PARAM_configure%"=="" SET "PARAM_configure=-developer-build -confirm-license -opensource -nomake examples"
echo Configuring !JOBDIR! with qmake: !PARAM_configure!
echo Pass --configure "configure options" to override
!JOBDIR!/configure.bat !PARAM_configure!
) else (
>&2 echo No CMake or qmake build system found in %JOBDIR%
)
)
)
)
)
......@@ -51,12 +56,14 @@ if exist build.ninja (
echo Building '!JOBDIR!' using 'ninja !target!'
ninja !target!
set error=%ERRORLEVEL%
) else if exist Makefile (
echo Building '!JOBDIR!' using '!maketool! !target!'
!maketool! !target!
set error=%ERRORLEVEL%
) else (
>&2 echo "No build system generated, aborting"
if exist Makefile (
echo Building '!JOBDIR!' using '!maketool! !target!'
!maketool! !target!
set error=%ERRORLEVEL%
) else (
>&2 echo "No build system generated, aborting"
)
)
exit /B %error%
......@@ -3,7 +3,7 @@
if [ -z $JOBDIR ]
then
echo "Error: path to host clone of Qt is required!"
>&2 echo "Error: path to host clone of Qt is required!"
exit 1
fi
......@@ -21,7 +21,7 @@ fi
[ -d $build_dir ] || mkdir -p $build_dir &> /dev/null
cd $build_dir
echo "Building $JOBDIR into $build_dir"
echo "Building '$JOBDIR' into '$build_dir'"
if [ -f CMakeCache.txt ]
then
......@@ -29,17 +29,21 @@ then
elif [ -f Makefile ]
then
echo "Already configured with qmake - run with --clean to reconfigure"
elif [ -f $JOBDIR/CMakeLists.txt ]
elif [ -f $JOBDIR/CMakeLists.txt ] && [ -z $FLAG_qmake ]
then
configure=${PARAM_configure:-"-GNinja -DFEATURE_developer_build=ON -DBUILD_EXAMPLES=OFF"}
echo "Configuring with cmake: $configure"
echo "Pass --configure \"configure options\" to override"
cmake $configure $JOBDIR
else
elif [ -f $JOBDIR/configure ]
then
configure=${PARAM_configure:-"-developer-build -confirm-license -opensource -nomake examples"}
echo "Configuring with qmake: $configure"
echo "Pass --configure \"configure options\" to override"
$JOBDIR/configure $configure
else
>&2 echo "No CMake or qmake build system found"
false
fi
error=$?
......
......@@ -16,9 +16,9 @@ and builds the src directory (as well the qmake target for Qt 6).
Supported job parameters:
--configure "configure line"
--configure "configure line \"with spaces\""
Overrides the default.
Overrides the default configuration options.
--target target
......@@ -27,8 +27,14 @@ Supported job parameters:
$ minicoin run windows10 build-qtmodule -- --target tst_qobject_check
$ minicoin run doc-server build-qtmodule -- --target html_docs
--build
--build name
Specify a suffix for the build directory, e.g.
$minicoin run ubuntu1804 build-qtmodule -- --build 5.15
Will build the current module into qt-[module]-5.15
--clean
Delete the build tree before configuring and building.
......@@ -4,7 +4,7 @@ SETLOCAL ENABLEDELAYEDEXPANSION
call c:\minicoin\util\parse-opts.cmd %*
call c:\minicoin\util\discover-make.cmd
if NOT DEFINED !JOBDIR! (
if NOT DEFINED JOBDIR (
echo Error: path to host clone of Qt module is required!
exit /B 1
)
......@@ -44,7 +44,7 @@ if not exist %module%-build!build! (
)
cd %module%-build!build!
echo Building %module% from %sources%
echo Building '%module%' from '%sources%' into '%module%-build!build!'
if exist CMakeCache.txt (
echo '%module%' already configured with cmake
......@@ -55,7 +55,7 @@ if exist CMakeCache.txt (
if "%module%" == "qtbase" (
set "generate_toollink=qmake"
set "configure=-confirm-license -developer-build -opensource -nomake examples -debug !configure!"
if exist %sources%\CMakeLists.txt (
if exist %sources%\CMakeLists.txt if not defined FLAG_qmake (
set "generate_toollink=!generate_toollink! qt-cmake"
set "configure=!configure! -cmake -cmake-generator Ninja"
) else (
......
......@@ -48,7 +48,7 @@ fi
mkdir $module-build$build 2> /dev/null
cd $module-build$build
echo "Building '$module' from '$sources'"
echo "Building '$module' from '$sources' into '$module-build$build'"
if [ -f CMakeCache.txt ] && [ -z $configure ]
then
......@@ -60,7 +60,7 @@ elif [[ -f "$sources/configure" ]]
then
generate_toollink=( "qmake" )
configure="-confirm-license -developer-build -opensource -nomake examples $configure"
if [ -f $sources/CMakeLists.txt ]
if [ -f $sources/CMakeLists.txt ] && [ -z $FLAG_qmake ]
then
generate_toollink=( $generate_toollink "qt-cmake" )
configure="$configure -cmake -cmake-generator Ninja"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment