Run Cmake without changing to the build folder.

This commit is contained in:
Gonzalo Exequiel Pedone 2021-06-30 17:51:02 -03:00
parent 1f02dae022
commit 3eb15f58ef
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
6 changed files with 45 additions and 59 deletions

View file

@ -23,65 +23,63 @@ echo Building x64 virtual camera driver
echo. echo.
mkdir build-x64 mkdir build-x64
cd build-x64
setlocal setlocal
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" ( if "%CMAKE_GENERATOR%" == "MSYS Makefiles" (
cmake ^ cmake ^
-S . ^
-B build-x64 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x64
cmake --build . cmake --build build-x64 --target install
cmake --build . --target install
) )
endlocal endlocal
if "%CMAKE_GENERATOR:~0,13%" == "Visual Studio" ( if "%CMAKE_GENERATOR:~0,13%" == "Visual Studio" (
cmake ^ cmake ^
-S . ^
-B build-x64 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-A x64 ^ -A x64 ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x64 --config Release
cmake --build . --config Release cmake --build build-x64 --config Release --target install
cmake --build . --config Release --target install
) )
cd ..
echo. echo.
echo Building x86 virtual camera driver echo Building x86 virtual camera driver
echo. echo.
mkdir build-x86 mkdir build-x86
cd build-x86
setlocal setlocal
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\bin;%PATH% if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\bin;%PATH%
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" ( if "%CMAKE_GENERATOR%" == "MSYS Makefiles" (
cmake ^ cmake ^
-S . ^
-B build-x86 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x86
cmake --build . cmake --build build-x86 --target install
cmake --build . --target install
) )
endlocal endlocal
if "%CMAKE_GENERATOR:~0,13%" == "Visual Studio" ( if "%CMAKE_GENERATOR:~0,13%" == "Visual Studio" (
cmake ^ cmake ^
-S . ^
-B build-x86 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-A Win32 ^ -A Win32 ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x86 --config Release
cmake --build . --config Release cmake --build build-x86 --config Release --target install
cmake --build . --config Release --target install
) )
cd ..

View file

@ -34,23 +34,25 @@ echo
echo "Building x64 virtual camera driver" echo "Building x64 virtual camera driver"
echo echo
mkdir build-x64 mkdir build-x64
cd build-x64
x86_64-w64-mingw32-cmake \ x86_64-w64-mingw32-cmake \
-S . \
-B build-x64 \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}"
.. cmake --build build-x64
cmake --build . cmake --build build-x64 --target install
cd ..
echo echo
echo "Building x86 virtual camera driver" echo "Building x86 virtual camera driver"
echo echo
mkdir build-x86 mkdir build-x86
cd build-x86 cd build-x86
i686-w64-mingw32-cmake \ i686-w64-mingw32-cmake \
-S . \
-B build-x86 \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}"
.. cmake --build build-x86
cmake --build . cmake --build build-x86 --target install
EOF EOF
chmod +x ${BUILDSCRIPT} chmod +x ${BUILDSCRIPT}
sudo cp -vf ${BUILDSCRIPT} "root.x86_64/$HOME/" sudo cp -vf ${BUILDSCRIPT} "root.x86_64/$HOME/"

View file

@ -54,13 +54,6 @@ EOF
fi fi
cat << EOF >> ${DEPLOYSCRIPT} cat << EOF >> ${DEPLOYSCRIPT}
cd build-x64
cmake --build . --target install
cd ..
cd build-x86
cmake --build . --target install
cd ..
i686-w64-mingw32-strip \${INSTALL_PREFIX}/x86/* i686-w64-mingw32-strip \${INSTALL_PREFIX}/x86/*
x86_64-w64-mingw32-strip \${INSTALL_PREFIX}/x64/* x86_64-w64-mingw32-strip \${INSTALL_PREFIX}/x64/*

View file

@ -22,9 +22,10 @@ SOURCES_DIR=${PWD}
INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data
mkdir build mkdir build
cd build
cmake \ cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}"
.. cmake --build build
cmake --build . cmake --build build --target install

View file

@ -22,10 +22,6 @@ SOURCES_DIR=${PWD}
git clone https://github.com/webcamoid/DeployTools.git git clone https://github.com/webcamoid/DeployTools.git
cd build
cmake --build . --target install
cd ..
export INSTALL_PREFIX="${SOURCES_DIR}/webcamoid-data" export INSTALL_PREFIX="${SOURCES_DIR}/webcamoid-data"
export PACKAGES_DIR="${SOURCES_DIR}/webcamoid-packages" export PACKAGES_DIR="${SOURCES_DIR}/webcamoid-packages"
export PYTHONPATH="${SOURCES_DIR}/DeployTools" export PYTHONPATH="${SOURCES_DIR}/DeployTools"

View file

@ -24,33 +24,29 @@ echo Building x64 virtual camera driver
echo. echo.
mkdir build-x64 mkdir build-x64
cd build-x64
cmake ^ cmake ^
-S . ^
-B build-x64 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-A x64 ^ -A x64 ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x64 --config Release
cmake --build . --config Release cmake --build build-x64 --config Release --target install
cmake --build . --config Release --target install
cd ..
echo. echo.
echo Building x86 virtual camera driver echo Building x86 virtual camera driver
echo. echo.
mkdir build-x86 mkdir build-x86
cd build-x86
cmake ^ cmake ^
-S . ^
-B build-x86 ^
-G "%CMAKE_GENERATOR%" ^ -G "%CMAKE_GENERATOR%" ^
-A Win32 ^ -A Win32 ^
-DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
.. cmake --build build-x86 --config Release
cmake --build . --config Release cmake --build build-x86 --config Release --target install
cmake --build . --config Release --target install
cd ..