-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
436 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
QTVERSION=5.15.2 | ||
PROJECTROOT=../.. | ||
|
||
# default linux values | ||
QMAKEPATH=$HOME/Qt/${QTVERSION}/gcc_64/bin | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# overload for mac values | ||
QMAKE_PATH=/Application/Qt/${QTVERSION}/clang_64/bin | ||
fi | ||
|
||
display_usage() { | ||
echo "This script builds Remaken in shared mode." | ||
echo "It can receive three optional arguments." | ||
echo -e "\nUsage: \$0 [path to xpcf project root | default='${PROJECTROOT}'] [Qt kit version to use | default='${QTVERSION}'] [path to qmake | default='${QMAKEPATH}'] \n" | ||
} | ||
|
||
# check whether user had supplied -h or --help . If yes display usage | ||
if [[ ( $1 == "--help") || $1 == "-h" ]] | ||
then | ||
display_usage | ||
exit 0 | ||
fi | ||
|
||
if [ $# -ge 1 ]; then | ||
PROJECTROOT=$1 | ||
fi | ||
if [ $# -ge 2 ]; then | ||
QTVERSION=$2 | ||
fi | ||
if [ $# -eq 3 ]; then | ||
QMAKEPATH=$3 | ||
fi | ||
|
||
${PROJECTROOT}/scripts/unixes/build_remaken_project.sh remaken shared ${PROJECTROOT} ${QTVERSION} ${QMAKEPATH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash | ||
|
||
QTVERSION=5.15.2 | ||
PROJECTROOT=../.. | ||
MODE=shared | ||
QMAKE_MODE="" | ||
|
||
# default linux values | ||
QMAKE_PATH=$HOME/Qt/${QTVERSION}/gcc_64/bin | ||
QMAKE_SPEC=linux-g++ | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# overload for mac values | ||
QMAKE_PATH=/Application/Qt/${QTVERSION}/clang_64/bin | ||
QMAKE_SPEC=macx-clang | ||
fi | ||
|
||
display_usage() { | ||
echo "This script builds a remaken project." | ||
echo "It takes the project name as first argument and can receive four optional arguments." | ||
echo -e "\nUsage: \$0 [project name] [ build mode {shared|static} | default='${MODE}' ] [path to project root | default='${PROJECTROOT}'] [Qt kit version to use | default='${QTVERSION}'] [path to qmake | default='${QMAKEPATH}'] \n" | ||
} | ||
|
||
# check whether user had supplied -h or --help . If yes display usage | ||
if [[ ( $1 == "--help") || $1 == "-h" || $# -eq 0 ]] | ||
then | ||
display_usage | ||
exit 0 | ||
fi | ||
|
||
if [ $# -ge 1 ]; then | ||
PROJECTNAME=$1 | ||
fi | ||
if [ $# -ge 2 ]; then | ||
MODE=$2 | ||
fi | ||
if [ $# -ge 3 ]; then | ||
PROJECTROOT=$3 | ||
fi | ||
if [ $# -ge 4 ]; then | ||
QTVERSION=$4 | ||
fi | ||
if [ $# -eq 5 ]; then | ||
QMAKE_PATH=$5 | ||
fi | ||
|
||
if [[ ${MODE} != "shared" && ${MODE} != "static" ]]; then | ||
echo "mode must be either shared or static - ${MODE} is an unsupported value" | ||
exit 2 | ||
fi | ||
|
||
if [[ ${MODE} == "static" ]]; then | ||
QMAKE_MODE=CONFIG+=staticlib | ||
echo "${MODE} build enabled: building with ${QMAKE_MODE} option" | ||
fi | ||
|
||
if [ ! -d ${QMAKE_PATH} ]; then | ||
echo "Qt path '${QMAKE_PATH}' doesn't exist : check your Qt installation and kits" | ||
exit 2 | ||
fi | ||
|
||
if [ ! -d ${PROJECTROOT} ]; then | ||
echo "Project root path '${PROJECTROOT}' doesn't exist" | ||
exit 2 | ||
fi | ||
if [ ! -e ${PROJECTROOT}/${PROJECTNAME}.pro ]; then | ||
echo "Project path '${PROJECTROOT}/${PROJECTNAME}.pro' doesn't exist" | ||
echo "Trying ${PROJECTROOT}/${PROJECTNAME}/${PROJECTNAME}.pro" | ||
if [ -e ${PROJECTROOT}/${PROJECTNAME}/${PROJECTNAME}.pro ]; then | ||
PROJECTROOT=${PROJECTROOT}/${PROJECTNAME} | ||
else | ||
echo "Project path '${PROJECTROOT}/${PROJECTNAME}/${PROJECTNAME}.pro' doesn't exist" | ||
exit 2 | ||
fi | ||
fi | ||
if [[ ! ${PROJECTROOT:0:1} = / ]]; then | ||
PROJECTROOT=../../../${PROJECTROOT} | ||
fi | ||
echo "Project path used is : ${PROJECTROOT}/${PROJECTNAME}.pro" | ||
source set_brew_env.sh | ||
|
||
|
||
BUILDROOTFOLDER=build-${PROJECTNAME} | ||
|
||
if [ -d ${BUILDROOTFOLDER}/${MODE} ]; then | ||
rm -rf ${BUILDROOTFOLDER}/${MODE} | ||
fi | ||
mkdir -p ${BUILDROOTFOLDER}/${MODE}/debug | ||
mkdir -p ${BUILDROOTFOLDER}/${MODE}/release | ||
echo "===========> building ${PROJECTNAME} project <===========" | ||
pushd ${BUILDROOTFOLDER}/${MODE}/debug | ||
`${QMAKE_PATH}/qmake ${PROJECTROOT}/${PROJECTNAME}.pro -spec ${QMAKE_SPEC} ${QMAKE_MODE} CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug && /usr/bin/make qmake_all` | ||
make | ||
make install | ||
popd | ||
pushd ${BUILDROOTFOLDER}/${MODE}/release | ||
`${QMAKE_PATH}/qmake ${PROJECTROOT}/${PROJECTNAME}.pro -spec ${QMAKE_SPEC} ${QMAKE_MODE} CONFIG+=x86_64 CONFIG+=qml_debug && /usr/bin/make qmake_all` | ||
make | ||
make install | ||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
for i in $(find . -type d -name build-\*) | ||
do | ||
echo "Removing $i folder" | ||
rm -rf $i | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@echo off | ||
setlocal | ||
|
||
REM default parameter value | ||
set QTVERSION=6.2.2 | ||
set PROJECTROOT=../.. | ||
set QMAKEPATH=C:\Qt\%QTVERSION%\msvc2019_64\bin | ||
|
||
REM check whether user had supplied -h or --help . If yes display usage | ||
for %%A in ("--help" "-h") do if "%1"==%%A (call:display_usage %1 & exit /b 0) | ||
|
||
REM default win walues | ||
if NOT [%1]==[] set PROJECTROOT=%1 | ||
if NOT [%2]==[] set QTVERSION=%2 | ||
if NOT [%3]==[] set QMAKEPATH=%3 | ||
|
||
if not exist %PROJECTROOT% (echo "Remaken project root path '%PROJECTROOT%' doesn't exist" & exit /b 2) | ||
echo "Remaken project root path used is : %PROJECTROOT%" | ||
if not exist %QMAKEPATH% (echo "qmake.exe path 'QMAKEPATH' doesn't exist" & exit /b 2) | ||
echo "qmake path used is : %QMAKEPATH%" | ||
|
||
call %PROJECTROOT%/scripts/win/build_remaken_project.bat remaken shared %PROJECTROOT% %QTVERSION% %QMAKEPATH% | ||
|
||
endlocal | ||
goto:eof | ||
|
||
::-------------------------------------------------------- | ||
::-- Function display_usage starts below here | ||
::-------------------------------------------------------- | ||
|
||
:display_usage | ||
|
||
echo This script builds Remaken in shared mode. | ||
echo It can receive three optional argument. | ||
echo. | ||
echo Usage: param [path to remaken project root - default='%PROJECTROOT%'] [Qt kit version to use - default='%QTVERSION%'] [path to qmake.exe - default='%QMAKEPATH%'] | ||
exit /b 0 | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
@echo off | ||
setlocal | ||
|
||
REM default parameter value | ||
set QTVERSION=6.2.2 | ||
set PROJECTROOT=../.. | ||
set MODE=shared | ||
set QMAKEMODE= | ||
|
||
REM check whether user had supplied -h or --help . If yes display usage | ||
for %%A in ("--help" "-h") do if "%1"==%%A (call:display_usage %1 & exit /b 0) | ||
|
||
REM default win walues | ||
if not "%1" == "" goto args_count_ok | ||
:args_count_ko | ||
call:display_usage | ||
exit /b 1 | ||
:args_count_ok | ||
|
||
set PROJECTNAME=%1 | ||
if NOT [%2]==[] set MODE=%2 | ||
if NOT [%3]==[] set PROJECTROOT=%3 | ||
if NOT [%4]==[] set QTVERSION=%4 | ||
|
||
set JOM_PATH=c:\Qt\Tools\QtCreator\bin\jom | ||
set QMAKE_PATH=C:\Qt\%QTVERSION%\msvc2019_64\bin | ||
|
||
if not %MODE%==shared (if not %MODE%==static (echo "mode must be either shared or static - %MODE% is an unsupported value" & exit /b 2) ) | ||
if %MODE%==static ( | ||
set QMAKEMODE="CONFIG+=staticlib" | ||
if %MODE%==static (echo "%MODE% build enabled: building with "CONFIG+=staticlib" option") | ||
) | ||
|
||
if not exist %QMAKE_PATH% (echo "Qt path '%QMAKE_PATH%' doesn't exist : check your Qt installation and kits" & exit /b 2) | ||
|
||
if not exist %PROJECTROOT% (echo "Project root path '%PROJECTROOT%' doesn't exist" & exit /b 2) | ||
|
||
if not exist %PROJECTROOT%/%PROJECTNAME%.pro ( | ||
echo "Project path '%PROJECTROOT%/%PROJECTNAME%.pro' doesn't exist" | ||
echo "Trying %PROJECTROOT%/%PROJECTNAME%/%PROJECTNAME%.pro" | ||
if exist %PROJECTROOT%/%PROJECTNAME%/%PROJECTNAME%.pro (set PROJECTROOT=%PROJECTROOT%/%PROJECTNAME%) else echo ("Project path '%PROJECTROOT%/%PROJECTNAME%/%PROJECTNAME%.pro' doesn't exist" & exit /b /2) | ||
) | ||
|
||
REM check path is relative or absolute | ||
if not %PROJECTROOT:~1,1%==: (set PROJECTROOT=../../../%PROJECTROOT%) | ||
echo "Project root path used is : %PROJECTROOT%" | ||
echo "Project path used is : %PROJECTROOT%/%PROJECTNAME%.pro" | ||
|
||
REM call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" | ||
REM call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" | ||
@REM setup Visual Studio environment | ||
set output=setup_script.txt | ||
call init_compiler_env_script.bat --year 2019 --output %output% | ||
set /p setup_script=<"%output%" | ||
call "%setup_script%" | ||
del %output% | ||
|
||
set BUILDROOTFOLDER=build-%PROJECTNAME% | ||
|
||
if exist %BUILDROOTFOLDER%\%MODE% rmdir /S /Q %BUILDROOTFOLDER%\%MODE% | ||
if not exist %BUILDROOTFOLDER%\%MODE%\debug mkdir %BUILDROOTFOLDER%\%MODE%\debug | ||
if not exist %BUILDROOTFOLDER%\%MODE%\release mkdir %BUILDROOTFOLDER%\%MODE%\release | ||
|
||
echo "===========> building %PROJECTNAME% static <===========" | ||
pushd %BUILDROOTFOLDER%\%MODE%\debug | ||
%QMAKE_PATH%\qmake.exe %PROJECTROOT%/%PROJECTNAME%.pro -spec win32-msvc CONFIG+=debug %QMAKEMODE% | ||
%JOM_PATH%\jom.exe | ||
%JOM_PATH%\jom.exe install | ||
%JOM_PATH%\jom.exe create_setup | ||
|
||
popd | ||
pushd %BUILDROOTFOLDER%\\%MODE%\release | ||
%QMAKE_PATH%\qmake.exe %PROJECTROOT%/%PROJECTNAME%.pro -spec win32-msvc %QMAKEMODE% | ||
%JOM_PATH%\jom.exe | ||
%JOM_PATH%\jom.exe create_setup | ||
popd | ||
|
||
endlocal | ||
goto:eof | ||
|
||
::-------------------------------------------------------- | ||
::-- Function display_usage starts below here | ||
::-------------------------------------------------------- | ||
|
||
:display_usage | ||
|
||
echo This script builds a remaken project. | ||
echo It takes the project name as first argument and can receive threes optional arguments. | ||
echo. | ||
echo "Usage: [project name] [ build mode {shared|static} | default='%MODE%' ] [path to project root - default='%PROJECTROOT%'] [Qt kit version to use - default='%QTVERSION%']" | ||
exit /b 0 | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
cls | ||
setlocal | ||
|
||
for /f "delims=" %%D in ('dir /a:d /b build-*') do ( | ||
echo "Removing %%~fD folder" | ||
rmdir /S /Q %%~FD | ||
) | ||
|
||
for /f "delims=" %%D in ('dir /a:d /b test-*') do ( | ||
echo "Removing %%~fD folder" | ||
rmdir /S /Q %%~FD | ||
) | ||
|
||
rm out.txt | ||
|
||
endlocal | ||
goto:eof | ||
|
||
:end | ||
|
||
|
Oops, something went wrong.