"Fossies" - the Fresh Open Source Software Archive

Member "icinga2-2.10.5/tools/win32/configure.ps1" (23 May 2019, 2294 Bytes) of package /linux/misc/icinga2-2.10.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Microsoft PowerShell source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "configure.ps1": 2.10.2_vs_2.10.3.

    1 if (-not (Test-Path env:ICINGA2_BUILDPATH)) {
    2   $env:ICINGA2_BUILDPATH = '.\build'
    3 }
    4 
    5 if (-not (Test-Path env:CMAKE_BUILD_TYPE)) {
    6   $env:CMAKE_BUILD_TYPE = 'RelWithDebInfo'
    7 }
    8 if (-not (Test-Path "$env:ICINGA2_BUILDPATH")) {
    9   mkdir "$env:ICINGA2_BUILDPATH" | out-null
   10 }
   11 if (-not (Test-Path "$env:ICINGA2_BUILDPATH\install")) {
   12   mkdir "$env:ICINGA2_BUILDPATH\install" | out-null
   13 }
   14 if (-not (Test-Path env:CMAKE_PATH)) {
   15   $env:CMAKE_PATH = 'C:\Program Files\CMake\bin'
   16 }
   17 if (-not ($env:PATH -contains $env:CMAKE_PATH)) {
   18   $env:PATH = $env:CMAKE_PATH + ';' + $env:PATH
   19 }
   20 
   21 if (-not (Test-Path env:CMAKE_GENERATOR)) {
   22   $env:CMAKE_GENERATOR = 'Visual Studio 15 2017 Win64'
   23 }
   24 if (-not (Test-Path env:OPENSSL_ROOT_DIR)) {
   25   if (Test-Path env:VSCMD_ARG_TGT_ARCH) {
   26     $OpenSSL_arch = $env:VSCMD_ARG_TGT_ARCH
   27   } else {
   28     throw "Missing env variable VSCMD_ARG_TGT_ARCH"
   29   }
   30 
   31   if (Test-Path env:VSCMD_VER) {
   32     $VSmajor = $env:VSCMD_VER -replace "\..*$", ""
   33     $OpenSSL_vcbuild = "vc${VSmajor}0"
   34   } else {
   35     throw "Missing env variable VSCMD_VER"
   36   }
   37 
   38   $env:OPENSSL_ROOT_DIR = "$env:ICINGA2_BUILDPATH\vendor\OpenSSL-$OpenSSL_arch-$OpenSSL_vcbuild"
   39 }
   40 if (-not (Test-Path env:BOOST_ROOT)) {
   41   $env:BOOST_ROOT = 'c:\local\boost_1_65_1'
   42 }
   43 if (-not (Test-Path env:BOOST_LIBRARYDIR)) {
   44   $env:BOOST_LIBRARYDIR = 'c:\local\boost_1_65_1\lib64-msvc-14.1'
   45 }
   46 if (-not (Test-Path env:FLEX_BINARY)) {
   47   $env:FLEX_BINARY = 'C:\ProgramData\chocolatey\bin\win_flex.exe'
   48 }
   49 if (-not (Test-Path env:BISON_BINARY)) {
   50   $env:BISON_BINARY = 'C:\ProgramData\chocolatey\bin\win_bison.exe'
   51 }
   52 
   53 $sourcePath = Get-Location
   54 
   55 cd "$env:ICINGA2_BUILDPATH"
   56 
   57 #-DCMAKE_INSTALL_PREFIX="C:\Program Files\Icinga2" `
   58 
   59 # Invalidate cache in case something in the build environment changed
   60 if (Test-Path CMakeCache.txt) {
   61   Remove-Item -Force CMakeCache.txt | Out-Null
   62 }
   63 
   64 & cmake.exe "$sourcePath" `
   65   -DCMAKE_BUILD_TYPE="$env:CMAKE_BUILD_TYPE" `
   66   -G $env:CMAKE_GENERATOR -DCPACK_GENERATOR=WIX `
   67   -DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF `
   68   -DOPENSSL_ROOT_DIR="$env:OPENSSL_ROOT_DIR" `
   69   -DBOOST_ROOT="$env:BOOST_ROOT" `
   70   -DBOOST_LIBRARYDIR="$env:BOOST_LIBRARYDIR" `
   71   -DFLEX_EXECUTABLE="$env:FLEX_BINARY" `
   72   -DBISON_EXECUTABLE="$env:BISON_BINARY"
   73 
   74 cd "$sourcePath"
   75 
   76 if ($lastexitcode -ne 0) {
   77   exit $lastexitcode
   78 }