Skip to content
Snippets Groups Projects
Commit 8d111205 authored by calrama's avatar calrama
Browse files

Update bash&powershell cmake functions

- Split package extraction & package discovery enabling
- windows: Use junctions instead of copying
  This allows keeping the files in the build folder so they
  can be transferred between jobs, but still serves as a
  workaround for Qt5's MOC being unable to access headers
  in the build directory.
parent 67666ce4
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,18 @@ function gitlab-trigger-pipeline { ...@@ -7,8 +7,18 @@ function gitlab-trigger-pipeline {
curl --request POST --form "token=$2" --form "ref=$3" "https://git.imp.fu-berlin.de/api/v4/projects/$1/trigger/pipeline" curl --request POST --form "token=$2" --form "ref=$3" "https://git.imp.fu-berlin.de/api/v4/projects/$1/trigger/pipeline"
} }
function cmake-integrate-package { function cmake-extract-package {
7z e $1-*.tar.xz; rm $1-*.tar.xz 7z e $1-*.tar.xz; rm $1-*.tar.xz
7z x $1-*.tar; rm $1-*.tar 7z x $1-*.tar; rm $1-*.tar
ln -s $(realpath $1-*) /usr/local/$1 mkdir -p vendor
mv $1-* vendor/$1
}
function cmake-enable-package-discovery {
ln -s $(realpath vendor/$1) /usr/local/$1
}
function cmake-integrate-package {
cmake-extract-package $1
cmake-enable-package-discovery $1
} }
...@@ -36,22 +36,29 @@ function GitLab-Fetch-Artifacts { ...@@ -36,22 +36,29 @@ function GitLab-Fetch-Artifacts {
} }
# #
# Sets up a CMake package for find_package from a tarball without copying # Unpacks a CMake package from its tarball into the vendor directory
# #
function CMake-Integrate-Package { function CMake-Extract-Package {
$name = $args[0] $name = $args[0]
7z e $name-*.tar.xz; Remove-Item -Force $name-*.tar.xz 7z e $name-*.tar.xz; Remove-Item -Force $name-*.tar.xz
7z x $name-*.tar; Remove-Item -Force $name-*.tar 7z x $name-*.tar; Remove-Item -Force $name-*.tar
[Environment]::SetEnvironmentVariable("${name}_ROOT", "$(resolve-path $name-*)") New-Item -ItemType Directory -Force 'vendor'
Move-Item $name-* vendor/$name
} }
# #
# Sets up a CMake package for find_package from a tarball # Enable discovery of a CMake package in the vendor directory via find_package
# #
function CMake-Install-Package { function CMake-Enable-Package-Discovery {
$name = $args[0] $name = $args[0]
7z e $name-*.tar.xz; Remove-Item -Force $name-*.tar.xz & cmd.exe /c mklink /J "C:/Program Files/$name" "$(resolve-path vendor/$name)"
7z x $name-*.tar; Remove-Item -Force $name-*.tar }
Copy-Item -Recurse $name-* "C:/Program Files/"
Remove-Item -Recurse -Force $name-* #
# Sets up a tarballed CMake package for find_package discovery
#
function CMake-Integrate-Package {
$name = $args[0]
CMake-Extract-Package $name
CMake-Enable-Package-Discovery $name
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment