Skip to content
Snippets Groups Projects
Commit c995551a authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Added error check and script uniformization

parent 23230cdc
No related branches found
No related tags found
No related merge requests found
......@@ -4,20 +4,35 @@
################################################################################
# aidge_core must be installed first in $env:AIDGE_INSTALL_PATH.
# Enable or disable automatic installation of requirements
# Run .\setup.ps1 -install_reqs:$false to disable it
param ([bool]$install_reqs=$true)
if (-not $env:AIDGE_INSTALL_PATH)
{
Write-Error -Message "AIDGE_INSTALL_PATH environment variable must be set to aidge_core install path." -ErrorAction Stop
}
# Compile & install aidge_core
# 1. Setup environment
################################################################################
if ($install_reqs)
{
# No additional dependencies
}
# 2. Compile & install aidge_core
################################################################################
$env:CMAKE_PREFIX_PATH=$env:AIDGE_INSTALL_PATH
md -Force build_cpp
md -Force $env:AIDGE_INSTALL_PATH
cd build_cpp
mkdir -Force build_cpp
mkdir -Force $env:AIDGE_INSTALL_PATH
Set-Location build_cpp
cmake -DCMAKE_INSTALL_PREFIX:PATH=$env:AIDGE_INSTALL_PATH -DCMAKE_BUILD_TYPE=Debug ..
if(!$?) { Set-Location $PSScriptRoot; Exit $LASTEXITCODE }
cmake --build . -j2
if(!$?) { Set-Location $PSScriptRoot; Exit $LASTEXITCODE }
cmake --install . --config Debug
if(!$?) { Set-Location $PSScriptRoot; Exit $LASTEXITCODE }
# Optional: run the unit tests
ctest --output-on-failure
if(!$?) { Set-Location $PSScriptRoot; Exit $LASTEXITCODE }
Set-Location $PSScriptRoot
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment