File: cmake-prm-yaml-cpp.bash

package info (click to toggle)
grandorgue 3.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,928 kB
  • sloc: xml: 63,791; cpp: 53,876; sh: 601; makefile: 8
file content (18 lines) | stat: -rwxr-xr-x 552 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# Find the yaml-cpp-static cmake path and print the -Dyaml-cpp_DIR parameter
# $1 - target deb architecture. Default - current

set -e

TARGET_ARCH=${1:$(dpkg --print-architecture)}

MULTIARCH=$(dpkg-architecture -q DEB_TARGET_MULTIARCH -A $TARGET_ARCH)
if [[ -d /usr/lib/$MULTIARCH/cmake/yaml-cpp-static ]]; then
  CMAKE_PRM="-Dyaml-cpp_DIR=/usr/lib/$MULTIARCH/cmake/yaml-cpp-static"
elif [[ -d /usr/lib64/cmake/yaml-cpp-static ]]; then
  CMAKE_PRM="-Dyaml-cpp_DIR=/usr/lib64/cmake/yaml-cpp-static"
else
  CMAKE_PRM=""
fi
echo $CMAKE_PRM