Skip to content

Commit

Permalink
Fixing prepare_externals.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Apr 11, 2024
1 parent a3b47c4 commit c47a438
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions script/prepare_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ rem COMMS_REPO - (Optional) Repository of the COMMS library
rem COMMS_TAG - (Optional) Tag of the COMMS library
rem COMMSDSL_REPO - (Optional) Repository of the commsdsl code generators
rem COMMSDSL_TAG - (Optional) Tag of the commdsl
rem COMMSDSL_PLATFORM - (Optional) Tag of the commdsl
rem CC_TOOLS_QT_REPO - (Optional) Repository of the cc_tools_qt
rem CC_TOOLS_QT_TAG - (Optional) Tag of the cc_tools_qt
rem CC_TOOLS_QT_MAJOR_QT_VERSION - (Optional) Major version of the Qt library
rem CC_TOOLS_QT_SKIP - (Optional) Skip build of cc_tools_qt
rem COMMON_INSTALL_DIR - (Optional) Common directory to perform installations
rem COMMON_BUILD_TYPE - (Optional) CMake build type
rem COMMON_CXX_STANDARD - (Optional) CMake C++ standard
Expand All @@ -19,7 +21,7 @@ rem -----------------------------------------------------

if [%BUILD_DIR%] == [] echo "BUILD_DIR hasn't been specified" & exit /b 1

if [%GENERATOR%] == [] set GENERATOR="NMake Makefiles"
if NOT [%GENERATOR%] == [] set GENERATOR_PARAM=-G %GENERATOR%

if NOT [%PLATFORM%] == [] set PLATFORM_PARAM=-A %PLATFORM%

Expand All @@ -33,6 +35,9 @@ if [%COMMSDSL_REPO%] == [] set COMMSDSL_REPO="https://github.com/commschamp/comm

if [%COMMSDSL_TAG%] == [] set COMMSDSL_TAG="master"

set COMMSDSL_PLATFORM_PARAM=%PLATFORM_PARAM%
if NOT [%COMMSDSL_PLATFORM%] == [] set COMMSDSL_PLATFORM_PARAM=-A %COMMSDSL_PLATFORM%

if [%CC_TOOLS_QT_REPO%] == [] set CC_TOOLS_QT_REPO="https://github.com/commschamp/cc_tools_qt.git"

if [%CC_TOOLS_QT_TAG%] == [] set CC_TOOLS_QT_TAG="master"
Expand Down Expand Up @@ -76,7 +81,7 @@ if exist %COMMS_SRC_DIR%/.git (
echo "Building COMMS library..."
mkdir "%COMMS_BUILD_DIR%"
cd %COMMS_BUILD_DIR%
cmake -G %GENERATOR% %PLATFORM_PARAM% -S %COMMS_SRC_DIR% -B %COMMS_BUILD_DIR% -DCMAKE_INSTALL_PREFIX=%COMMS_INSTALL_DIR% ^
cmake %GENERATOR_PARAM% %PLATFORM_PARAM% -S %COMMS_SRC_DIR% -B %COMMS_BUILD_DIR% -DCMAKE_INSTALL_PREFIX=%COMMS_INSTALL_DIR% ^
-DCMAKE_BUILD_TYPE=%COMMON_BUILD_TYPE% -DCMAKE_CXX_STANDARD=%COMMON_CXX_STANDARD%
if %errorlevel% neq 0 exit /b %errorlevel%
cmake --build %COMMS_BUILD_DIR% --config %COMMON_BUILD_TYPE% --target install
Expand All @@ -100,7 +105,7 @@ if exist %COMMSDSL_SRC_DIR%/.git (
echo "Building commsdsl ..."
mkdir "%COMMSDSL_BUILD_DIR%"
cd %COMMSDSL_BUILD_DIR%
cmake -G %GENERATOR% %PLATFORM_PARAM% -S %COMMSDSL_SRC_DIR% -B %COMMSDSL_BUILD_DIR% ^
cmake %GENERATOR_PARAM% %COMMSDSL_PLATFORM_PARAM% -S %COMMSDSL_SRC_DIR% -B %COMMSDSL_BUILD_DIR% ^
-DCMAKE_INSTALL_PREFIX=%COMMSDSL_INSTALL_DIR% -DCMAKE_BUILD_TYPE=%COMMON_BUILD_TYPE% ^
-DCOMMSDSL_INSTALL_LIBRARY=OFF -DCOMMSDSL_BUILD_COMMSDSL2TEST=ON -DCOMMSDSL_BUILD_COMMSDSL2TOOLS_QT=ON
if %errorlevel% neq 0 exit /b %errorlevel%
Expand All @@ -114,6 +119,11 @@ if %COMMON_CXX_STANDARD% LSS 17 (
goto cc_tools_qt_end
)

if %CC_TOOLS_QT_SKIP% GTR 0 (
echo "Skipping build of cc_tools_qt"
goto cc_tools_qt_end
)

if exist %CC_TOOLS_QT_SRC_DIR%/.git (
echo "Updating cc_tools_qt..."
cd %CC_TOOLS_QT_SRC_DIR%
Expand All @@ -130,7 +140,7 @@ if exist %CC_TOOLS_QT_SRC_DIR%/.git (
echo "Building cc_tools_qt ..."
mkdir "%CC_TOOLS_QT_BUILD_DIR%"
cd %CC_TOOLS_QT_BUILD_DIR%
cmake -G %GENERATOR% %PLATFORM_PARAM% -S %CC_TOOLS_QT_SRC_DIR% -B %CC_TOOLS_QT_BUILD_DIR% ^
cmake %GENERATOR_PARAM% %PLATFORM_PARAM% -S %CC_TOOLS_QT_SRC_DIR% -B %CC_TOOLS_QT_BUILD_DIR% ^
-DCMAKE_INSTALL_PREFIX=%CC_TOOLS_QT_INSTALL_DIR% -DCMAKE_BUILD_TYPE=%COMMON_BUILD_TYPE% ^
-DCC_TOOLS_QT_BUILD_APPS=OFF -DCMAKE_PREFIX_PATH=%COMMS_INSTALL_DIR%;%QTDIR% ^
-DCMAKE_CXX_STANDARD=%COMMON_CXX_STANDARD% %CC_TOOLS_QT_VERSION_OPT%
Expand Down

0 comments on commit c47a438

Please sign in to comment.