mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
parent
1de37ceeff
commit
0359368451
17
.github/scripts/build.sh
vendored
17
.github/scripts/build.sh
vendored
@ -33,23 +33,24 @@ elif [[ $RUNNER_OS == "Windows" ]]; then
|
|||||||
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
|
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
|
||||||
elif [[ "$RUNNER_OS" == 'Linux' ]]; then
|
elif [[ "$RUNNER_OS" == 'Linux' ]]; then
|
||||||
echo "Docker arguments used: DOCKER_IMAGE=${DOCKER_IMAGE}, DOCKER_TAG=${DOCKER_TAG}, TARGET_ARCH=${TARGET_ARCH}"
|
echo "Docker arguments used: DOCKER_IMAGE=${DOCKER_IMAGE}, DOCKER_TAG=${DOCKER_TAG}, TARGET_ARCH=${TARGET_ARCH}"
|
||||||
|
# verification bypass of external dependencies
|
||||||
|
git config --global --add safe.directory "${GITHUB_WORKSPACE}/dependencies/external/*"
|
||||||
# set GitHub Container Registry url
|
# set GitHub Container Registry url
|
||||||
REGISTRY_URL="ghcr.io/hyperion-project/${DOCKER_IMAGE}"
|
REGISTRY_URL="ghcr.io/paulchen-panther/${DOCKER_IMAGE}"
|
||||||
# take ownership of deploy dir
|
# take ownership of deploy dir
|
||||||
mkdir ${GITHUB_WORKSPACE}/deploy
|
mkdir ${GITHUB_WORKSPACE}/deploy
|
||||||
|
|
||||||
# run docker
|
# run docker
|
||||||
docker run --rm --platform=${TARGET_ARCH} \
|
docker run --rm --platform=${TARGET_ARCH} \
|
||||||
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
|
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
|
||||||
-v "${GITHUB_WORKSPACE}:/source:ro" \
|
-v "${GITHUB_WORKSPACE}:/source:rw" \
|
||||||
$REGISTRY_URL:$DOCKER_TAG \
|
$REGISTRY_URL:$DOCKER_TAG \
|
||||||
/bin/bash -c "mkdir hyperion && cp -r source/. /hyperion &&
|
/bin/bash -c "mkdir -p /source/build && cd /source/build &&
|
||||||
cd /hyperion && mkdir build && cd build &&
|
|
||||||
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2 &&
|
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ../ || exit 2 &&
|
||||||
make -j $(nproc) package || exit 3 &&
|
cmake --build /source/build --target package -- -j $(nproc) || exit 3 &&
|
||||||
cp /hyperion/build/bin/h* /deploy/ 2>/dev/null || : &&
|
cp /source/build/bin/h* /deploy/ 2>/dev/null || : &&
|
||||||
cp /hyperion/build/Hyperion-* /deploy/ 2>/dev/null || : &&
|
cp /source/build/Hyperion-* /deploy/ 2>/dev/null || : &&
|
||||||
cd /hyperion && source /hyperion/test/testrunner.sh || exit 4 &&
|
cd /source && source /source/test/testrunner.sh || exit 5 &&
|
||||||
exit 0;
|
exit 0;
|
||||||
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
|
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
|
||||||
|
|
||||||
|
207
.github/workflows/apt.yml
vendored
207
.github/workflows/apt.yml
vendored
@ -1,207 +0,0 @@
|
|||||||
name: Hyperion APT Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Reusable from nightly and push
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
head_sha:
|
|
||||||
type: string
|
|
||||||
description: The branch, tag or SHA to checkout
|
|
||||||
default: "master"
|
|
||||||
required: false
|
|
||||||
nightly:
|
|
||||||
type: boolean
|
|
||||||
description: Nightly build
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
publish:
|
|
||||||
type: boolean
|
|
||||||
description: Publish packages
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
# For running the workflow manually via GitHub Actions tab
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
head_sha:
|
|
||||||
type: string
|
|
||||||
description: The branch, tag or SHA to checkout
|
|
||||||
default: "master"
|
|
||||||
required: false
|
|
||||||
nightly:
|
|
||||||
type: boolean
|
|
||||||
description: Nightly build
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
publish:
|
|
||||||
type: boolean
|
|
||||||
description: Publish packages
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
ghcr: hyperion-project
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: 🐧 ${{ matrix.os.description }} (${{ matrix.architecture[0] }})
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [
|
|
||||||
{ distribution: ubuntu, codename: focal, description: Ubuntu 20.04 (Focal Fossa) },
|
|
||||||
{ distribution: ubuntu, codename: jammy, description: Ubuntu 22.04 (Jammy Jellyfish) },
|
|
||||||
{ distribution: ubuntu, codename: lunar, description: Ubuntu 23.04 (Lunar Lobster) },
|
|
||||||
{ distribution: ubuntu, codename: mantic, description: Ubuntu 23.10 (Mantic Minotaur) },
|
|
||||||
{ distribution: debian, codename: buster, description: Debian 10.x (Buster) },
|
|
||||||
{ distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye) },
|
|
||||||
{ distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm) },
|
|
||||||
{ distribution: debian, codename: trixie, description: Debian 13.x (Trixie) }
|
|
||||||
]
|
|
||||||
architecture: [
|
|
||||||
[ amd64, linux/amd64 ],
|
|
||||||
[ arm64, linux/arm64 ],
|
|
||||||
[ armhf, linux/arm/v7 ]
|
|
||||||
]
|
|
||||||
include:
|
|
||||||
- os: { distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye) }
|
|
||||||
architecture: [ armel, linux/arm/v6 ]
|
|
||||||
- os: { distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm) }
|
|
||||||
architecture: [ armel, linux/arm/v6 ]
|
|
||||||
- os: { distribution: debian, codename: trixie, description: Debian 13.x (Trixie) }
|
|
||||||
architecture: [ armel, linux/arm/v6 ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔧 Prepare
|
|
||||||
run: |
|
|
||||||
echo '::group::Checking the version number'
|
|
||||||
if [[ "${{ inputs.nightly }}" = true ]]; then
|
|
||||||
echo "$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD)" > .version
|
|
||||||
else
|
|
||||||
tr -d '\n' < .version > temp && mv temp .version
|
|
||||||
fi
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Generate environment variables'
|
|
||||||
VERSION=$(cat .version)
|
|
||||||
echo VERSION=${VERSION} >> $GITHUB_ENV
|
|
||||||
if [[ $VERSION == *"-"* ]]; then
|
|
||||||
echo STANDARDS_VERSION=$(echo ${VERSION%-*}) >> $GITHUB_ENV
|
|
||||||
echo DEBIAN_FORMAT='3.0 (quilt)' >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo STANDARDS_VERSION=$(echo ${VERSION%+*}) >> $GITHUB_ENV
|
|
||||||
echo DEBIAN_FORMAT='3.0 (native)' >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 🛠️ Setup QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: 👷 Build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p "${GITHUB_WORKSPACE}/deploy"
|
|
||||||
docker run --rm --platform=${{ matrix.architecture[1] }} \
|
|
||||||
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
|
|
||||||
-v "${GITHUB_WORKSPACE}:/source:rw" \
|
|
||||||
ghcr.io/${{ env.ghcr }}/${{ matrix.os.distribution }}:${{ matrix.os.codename }} \
|
|
||||||
/bin/bash -c "cd /source && \
|
|
||||||
mkdir -p debian/source && echo '${{ env.DEBIAN_FORMAT }}' > debian/source/format && echo 10 > debian/compat && \
|
|
||||||
dch --create --distribution ${{ matrix.os.codename }} --package 'hyperion' -v '${{ env.VERSION }}~${{ matrix.os.codename }}' '${{ github.event.commits[0].message }}' && \
|
|
||||||
cp -fr LICENSE debian/copyright && \
|
|
||||||
sed 's/@ARCHITECTURE@/${{ matrix.architecture[0] }}/g; s/@STANDARDS_VERSION@/${{ env.STANDARDS_VERSION }}/g' debian/control.in > debian/control && \
|
|
||||||
debuild -b -uc -us && \
|
|
||||||
cp ../hyperion_*.deb /deploy"
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ inputs.publish }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
path: deploy
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
publish:
|
|
||||||
name: 🚀 Publish DEB packages
|
|
||||||
if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
|
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
|
|
||||||
|
|
||||||
- name: 🔑 GPG Import
|
|
||||||
if: ${{ env.SECRET_GPG_KEY != null }}
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v5
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.GPG_KEY }}
|
|
||||||
env:
|
|
||||||
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
|
|
||||||
|
|
||||||
- name: 💾 Artifact download
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: 🔧 Prepare
|
|
||||||
if: ${{ env.SECRET_APT_REPO_NIGHTLY != null && env.SECRET_APT_REPO != null }}
|
|
||||||
run: |
|
|
||||||
echo '::group::Install reprepro'
|
|
||||||
sudo apt -y install reprepro
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Create initial structure'
|
|
||||||
mkdir -p deb/{conf,dists,db}
|
|
||||||
cp debian/distributions deb/conf/distributions
|
|
||||||
if [[ "${{ inputs.nightly }}" = true ]]; then
|
|
||||||
touch "deb/$(git rev-parse --short HEAD)"
|
|
||||||
fi
|
|
||||||
reprepro -Vb deb createsymlinks
|
|
||||||
reprepro -Vb deb export
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Include artifacts into the package source'
|
|
||||||
for file in artifact/hyperion_*.deb; do
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
dist=${file#*~}
|
|
||||||
dist=${dist%_*}
|
|
||||||
reprepro -Vb deb/ includedeb "$dist" "$file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Set server directory'
|
|
||||||
if [[ "${{ inputs.nightly }}" = true ]]; then
|
|
||||||
echo "SERVER_DIR=${{ secrets.APT_REPO_NIGHTLY }}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "SERVER_DIR=${{ secrets.APT_REPO }}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
SECRET_APT_REPO_NIGHTLY: ${{ secrets.APT_REPO_NIGHTLY }}
|
|
||||||
SECRET_APT_REPO: ${{ secrets.APT_REPO }}
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
|
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
||||||
with:
|
|
||||||
server: releases.hyperion-project.org
|
|
||||||
username: ${{ secrets.REPO_USER }}
|
|
||||||
password: ${{ secrets.REPO_PASSWORD }}
|
|
||||||
server-dir: ${{ env.SERVER_DIR }}
|
|
||||||
local-dir: "./deb/"
|
|
||||||
dangerous-clean-slate: true
|
|
||||||
env:
|
|
||||||
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
|
|
||||||
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
|
|
||||||
|
|
||||||
- name: 🧹 Cleanup
|
|
||||||
uses: geekyeggo/delete-artifact@v2
|
|
||||||
with:
|
|
||||||
name: artifact
|
|
||||||
failOnError: false
|
|
2
.github/workflows/cleanup.yml
vendored
2
.github/workflows/cleanup.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: 🧹 Clean artifacts
|
name: 🧹 Cleanup old artifacts
|
||||||
|
|
||||||
# Run cleanup workflow at the end of every day
|
# Run cleanup workflow at the end of every day
|
||||||
on:
|
on:
|
||||||
|
4
.github/workflows/codeql.yml
vendored
4
.github/workflows/codeql.yml
vendored
@ -1,4 +1,8 @@
|
|||||||
name: 📊 CodeQL
|
name: 📊 CodeQL
|
||||||
|
run-name: |
|
||||||
|
${{ github.event_name == 'schedule' && '⏰ Scheduled CodeQL run' || '' }}
|
||||||
|
${{ github.event_name == 'push' && format('📊 Pushed CodeQL run - {0}', github.event.head_commit.message) || '' }}
|
||||||
|
${{ github.event_name == 'pull_request' && format('📊 CodeQL run for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
196
.github/workflows/dnf.yml
vendored
196
.github/workflows/dnf.yml
vendored
@ -1,196 +0,0 @@
|
|||||||
name: Hyperion DNF Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Reusable from nightly and push
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
head_sha:
|
|
||||||
type: string
|
|
||||||
description: The branch, tag or SHA to checkout
|
|
||||||
default: "master"
|
|
||||||
required: false
|
|
||||||
nightly:
|
|
||||||
type: boolean
|
|
||||||
description: Nightly build
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
publish:
|
|
||||||
type: boolean
|
|
||||||
description: Publish packages
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
# For running the workflow manually via GitHub Actions tab
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
head_sha:
|
|
||||||
type: string
|
|
||||||
description: The branch, tag or SHA to checkout
|
|
||||||
default: "master"
|
|
||||||
required: false
|
|
||||||
nightly:
|
|
||||||
type: boolean
|
|
||||||
description: Nightly build
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
publish:
|
|
||||||
type: boolean
|
|
||||||
description: Publish packages
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
env:
|
|
||||||
ghcr: hyperion-project
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: 🐧 ${{ matrix.os.distribution }} ${{ matrix.os.version }} (${{ matrix.architecture[0] }})
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [
|
|
||||||
{ distribution: Fedora, version: 37 },
|
|
||||||
{ distribution: Fedora, version: 38 },
|
|
||||||
{ distribution: Fedora, version: 39 },
|
|
||||||
{ distribution: Fedora, version: 40 }
|
|
||||||
]
|
|
||||||
architecture: [
|
|
||||||
[ amd64, linux/amd64 ]
|
|
||||||
]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔧 Prepare
|
|
||||||
run: |
|
|
||||||
echo '::group::Checking the version number'
|
|
||||||
if [[ "${{ inputs.nightly }}" = true ]]; then
|
|
||||||
echo VERSION=$(tr -d '\n' < .version)+nightly$(date '+%Y%m%d')$(git rev-parse --short HEAD | sed s/-/_/g) >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo VERSION=$(tr -d '\n' < .version | sed s/-/_/g) >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 🛠️ Setup QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: 👷 Build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Set distribution name to lower case'
|
|
||||||
DISTRIBUTION=$(echo '${{ matrix.os.distribution }}' | tr '[:upper:]' '[:lower:]')
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Building Hyperion'
|
|
||||||
mkdir -p "${GITHUB_WORKSPACE}/deploy"
|
|
||||||
docker run --rm --platform=${{ matrix.architecture[1] }} \
|
|
||||||
-w "/root" \
|
|
||||||
-v "${GITHUB_WORKSPACE}/deploy:/deploy" \
|
|
||||||
-v "${GITHUB_WORKSPACE}:/root/hyperion.ng:rw" \
|
|
||||||
ghcr.io/${{ env.ghcr }}/${DISTRIBUTION}:${{ matrix.os.version }} \
|
|
||||||
/bin/bash -c "tar -czf rpmbuild/SOURCES/hyperion.ng.tar.gz hyperion.ng/ && \
|
|
||||||
cp -f hyperion.ng/rpmbuild/hyperion.spec.in rpmbuild/SPECS/hyperion.spec && \
|
|
||||||
rpmbuild -ba --define '_version ${{ env.VERSION }}' rpmbuild/SPECS/hyperion.spec --clean && \
|
|
||||||
cp -fv rpmbuild/RPMS/$(uname -m)/hyperion* /deploy"
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
ACTOR: "Hyperion Project <admin@hyperion-project.org>"
|
|
||||||
COMMIT_MESSAGE: ${{ github.event.commits[0].message }}
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ inputs.publish }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
path: deploy
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
publish:
|
|
||||||
name: 🚀 Publish RPM packages
|
|
||||||
if: ${{ github.repository == 'hyperion-project' && inputs.publish }}
|
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: fedora
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }}
|
|
||||||
|
|
||||||
- name: 🔑 GPG Import
|
|
||||||
id: import_gpg
|
|
||||||
if: ${{ env.SECRET_GPG_KEY != null }}
|
|
||||||
uses: crazy-max/ghaction-import-gpg@v5
|
|
||||||
with:
|
|
||||||
gpg_private_key: ${{ secrets.GPG_KEY }}
|
|
||||||
env:
|
|
||||||
SECRET_GPG_KEY: ${{ secrets.GPG_KEY }}
|
|
||||||
|
|
||||||
- name: 💾 Artifact download
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
|
|
||||||
- name: 🔧 Prepare
|
|
||||||
if: ${{ env.SECRET_DNF_REPO_NIGHTLY != null && env.SECRET_DNF_REPO != null }}
|
|
||||||
run: |
|
|
||||||
echo '::group::Install createrepo & rpm-sign'
|
|
||||||
dnf install createrepo rpm-sign -y
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Make folders, sign/copy packages and create metadata/manifest files'
|
|
||||||
mkdir rpm/
|
|
||||||
gpg --armor --output hyperion.pub.key --export 'admin@hyperion-project.org'
|
|
||||||
rpm --import hyperion.pub.key
|
|
||||||
channel=$([ "${{ inputs.nightly }}" = true ] && echo "Nightly" || echo "Stable")
|
|
||||||
declare -A distArray=([fc]=fedora [el]=rhel)
|
|
||||||
for file in artifact/hyperion-*.rpm; do
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
dist_ver_arch=$(basename -- "$file")
|
|
||||||
dist_ver_arch=${dist_ver_arch%.*}
|
|
||||||
dist_ver=${dist_ver_arch%.*}
|
|
||||||
dist_ver=${dist_ver##*.}
|
|
||||||
[ -z "${dist_ver:0:2}" ] && continue
|
|
||||||
rpm=rpm/${distArray[${dist_ver:0:2}]}/${dist_ver:2}/${dist_ver_arch##*.}
|
|
||||||
mkdir -p $rpm/ && cp $file $rpm/
|
|
||||||
rpm --define "_gpg_name ${{ steps.import_gpg.outputs.keyid }}" --addsign $rpm/*.rpm
|
|
||||||
rpm --checksig $rpm/*.rpm
|
|
||||||
createrepo $rpm/
|
|
||||||
gpg --yes --detach-sign --armor $rpm/repodata/repomd.xml
|
|
||||||
sed -r "s/@CHANNEL@/${channel}/g; s/@DIST@/${distArray[${dist_ver:0:2}]}/g; s/@ARCH@/${dist_ver_arch##*.}/g" ${GITHUB_WORKSPACE}/rpmbuild/hyperion.repo.in > rpm/${distArray[${dist_ver:0:2}]}/hyperion.repo
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Set server directory'
|
|
||||||
if [[ "${{ inputs.nightly }}" = true ]]; then
|
|
||||||
echo "SERVER_DIR=${{ secrets.DNF_REPO_NIGHTLY }}" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
echo "SERVER_DIR=${{ secrets.DNF_REPO }}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
SECRET_DNF_REPO_NIGHTLY: ${{ secrets.DNF_REPO_NIGHTLY }}
|
|
||||||
SECRET_DNF_REPO: ${{ secrets.DNF_REPO }}
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ env.SECRET_REPO_USER != null && env.SECRET_REPO_PASSWORD != null && env.SERVER_DIR != null }}
|
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
|
||||||
with:
|
|
||||||
server: releases.hyperion-project.org
|
|
||||||
username: ${{ secrets.REPO_USER }}
|
|
||||||
password: ${{ secrets.REPO_PASSWORD }}
|
|
||||||
server-dir: ${{ env.SERVER_DIR }}
|
|
||||||
local-dir: "./rpm/"
|
|
||||||
dangerous-clean-slate: true
|
|
||||||
env:
|
|
||||||
SECRET_REPO_USER: ${{ secrets.REPO_USER }}
|
|
||||||
SECRET_REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
|
|
||||||
|
|
||||||
- name: 🧹 Cleanup
|
|
||||||
uses: geekyeggo/delete-artifact@v2
|
|
||||||
with:
|
|
||||||
name: artifact
|
|
||||||
failOnError: false
|
|
111
.github/workflows/nightly.yml
vendored
111
.github/workflows/nightly.yml
vendored
@ -1,111 +0,0 @@
|
|||||||
name: 🌑️ Nightly builds
|
|
||||||
|
|
||||||
# Create nightly builds at the end of every day
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
###############################################
|
|
||||||
###### rpi_ws281x submodule update check ######
|
|
||||||
###############################################
|
|
||||||
|
|
||||||
update_submodule:
|
|
||||||
name: 🔁 Update Submodule rpi_ws281x (Nightly build only)
|
|
||||||
if: ${{ !startsWith(github.repository, 'hyperion-project') }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
fetch-depth: 0
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔁 Update Submodule rpi_ws281x
|
|
||||||
id: update
|
|
||||||
run: git submodule update --remote --recursive dependencies/external/rpi_ws281x
|
|
||||||
|
|
||||||
- name: ✅ Check git status
|
|
||||||
id: status
|
|
||||||
run: echo "status=$(git status -s)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: ✏️ Add/Commit changes
|
|
||||||
if: ${{ steps.status.outputs.status }}
|
|
||||||
run: |
|
|
||||||
git config --local user.email "20935312+Hyperion-Bot@users.noreply.github.com"
|
|
||||||
git config --local user.name "Hyperion-Bot"
|
|
||||||
git config --local diff.ignoreSubmodules dirty
|
|
||||||
git commit -am "Update submodule rpi_ws281x"
|
|
||||||
|
|
||||||
- name: 📦 Push changes
|
|
||||||
if: ${{ env.SECRET_BOT_TOKEN != null && steps.status.outputs.status }}
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.HYPERION_BOT_TOKEN }}
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
env:
|
|
||||||
SECRET_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}
|
|
||||||
|
|
||||||
##################################
|
|
||||||
###### APT/DNF commit check ######
|
|
||||||
##################################
|
|
||||||
|
|
||||||
check:
|
|
||||||
name: 🔀 Compare local <-> nightly (Nightly build only)
|
|
||||||
needs: [update_submodule]
|
|
||||||
if: ${{ !startsWith(github.repository, 'hyperion-project') }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: ✅ Check if commit has changed (APT)
|
|
||||||
id: apt-build-necessary
|
|
||||||
run: |
|
|
||||||
if wget --spider "https://nightly.apt.releases.hyperion-project.org//$(git rev-parse --short HEAD)" 2>/dev/null; then
|
|
||||||
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: ✅ Check if commit has changed (DNF)
|
|
||||||
id: dnf-build-necessary
|
|
||||||
run: |
|
|
||||||
if wget --spider "https://nightly.dnf.releases.hyperion-project.org/$(git rev-parse --short HEAD)" 2>/dev/null; then
|
|
||||||
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
outputs:
|
|
||||||
build-apt-nightly: ${{ steps.apt-build-necessary.outputs.commit-has-changed }}
|
|
||||||
build-dnf-nightly: ${{ steps.dnf-build-necessary.outputs.commit-has-changed }}
|
|
||||||
|
|
||||||
###################################
|
|
||||||
###### APT reusable workflow ######
|
|
||||||
###################################
|
|
||||||
|
|
||||||
apt_build:
|
|
||||||
name: 👷 APT Build
|
|
||||||
needs: [check]
|
|
||||||
if: ${{ needs.check.outputs.build-apt-nightly == 'true' }}
|
|
||||||
uses: ./.github/workflows/apt.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
nightly: true
|
|
||||||
publish: true
|
|
||||||
|
|
||||||
###################################
|
|
||||||
###### DNF reusable workflow ######
|
|
||||||
###################################
|
|
||||||
|
|
||||||
dnf_build:
|
|
||||||
name: 👷 DNF Build
|
|
||||||
needs: [check]
|
|
||||||
if: ${{ needs.check.outputs.build-dnf-nightly == 'true' }}
|
|
||||||
uses: ./.github/workflows/dnf.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
nightly: true
|
|
||||||
publish: true
|
|
258
.github/workflows/push_pull.yml
vendored
258
.github/workflows/push_pull.yml
vendored
@ -1,10 +1,7 @@
|
|||||||
name: Hyperion CI/PR Builds
|
name: Hyperion CI/PR Builds
|
||||||
run-name: |
|
run-name: |
|
||||||
${{ github.event_name == 'pull_request' && '📦 Generate artifacts for PR' || '' }}
|
${{ github.event_name == 'push' && '🌱 Push build -' || '' }}
|
||||||
${{ github.event_name == 'pull_request' && github.event.pull_request.number || '' }}
|
${{ github.event_name == 'pull_request' && format('📦 Artifacts build for PR {0} - {1}', github.event.pull_request.number, github.event.pull_request.title) || github.event.head_commit.message }}
|
||||||
${{ github.event_name == 'pull_request' && '-' || '' }}
|
|
||||||
${{ github.event_name == 'push' && '🌱 Push Build -' || '' }}
|
|
||||||
${{ github.event_name == 'pull_request' && github.event.pull_request.title || github.event.head_commit.message }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -16,242 +13,37 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
|
||||||
# Cancel running actions when a new action on the same PR is started
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
######################
|
# GitHub Push/Pull Request (Release only on tagged commits)
|
||||||
###### Linux #########
|
github_build:
|
||||||
######################
|
name: Qt ${{ matrix.qt_version }} Build ${{ matrix.qt_version == '6' && '(Testing))' || '' }}
|
||||||
|
|
||||||
Linux:
|
|
||||||
name: 🐧 ${{ matrix.os.description }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [
|
qt_version: ['5', '6']
|
||||||
{ description: Debian Buster (x86_64), platform: x11, architecture: [ amd64, linux/amd64 ] },
|
uses: ./.github/workflows/qt5_6.yml
|
||||||
{ description: Debian Buster (Raspberry Pi v1 & ZERO), platform: rpi, architecture: [ armv6, linux/arm/v5 ] },
|
secrets: inherit
|
||||||
{ description: Debian Buster (Raspberry Pi 2/3/4), platform: rpi, architecture: [ armv7, linux/arm/v7 ] },
|
with:
|
||||||
{ description: Debian Buster (Generic AARCH64), platform: amlogic, architecture: [ aarch64, linux/arm64 ] }
|
qt_version: ${{ matrix.qt_version }}
|
||||||
]
|
event_name: ${{ github.event_name }}
|
||||||
include:
|
pull_request_number: ${{ github.event.pull_request.number }}
|
||||||
- distribution: debian
|
publish: ${{ startsWith(github.event.ref, 'refs/tags') }}
|
||||||
- codename: buster
|
|
||||||
|
|
||||||
steps:
|
# Build DEB/RPM Packages for APT/DNF Repository (runs only on tagged commits)
|
||||||
- name: ⬇ Checkout
|
repo_build:
|
||||||
uses: actions/checkout@v4
|
name: 🚀 Let Hyperion build its own repository (APT/DNF)
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔧 Prepare PR
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Append PR number to version'
|
|
||||||
tr -d '\n' < .version > temp && mv temp .version
|
|
||||||
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 🛠️ Setup QEMU
|
|
||||||
if: ${{ matrix.os.architecture[0] != 'amd64' }}
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: 👷 Build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Build Hyperion'
|
|
||||||
./.github/scripts/build.sh
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
DOCKER_IMAGE: ${{ matrix.distribution }}
|
|
||||||
DOCKER_TAG: ${{ matrix.codename }}
|
|
||||||
PLATFORM: ${{ matrix.os.platform }}
|
|
||||||
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ github.event_name == 'pull_request' && matrix.os.architecture[0] || 'artifact' }}
|
|
||||||
path: ${{ github.event_name == 'pull_request' && 'deploy/*.tar.gz' || 'deploy/Hyperion-*' }}
|
|
||||||
|
|
||||||
######################
|
|
||||||
###### macOS #########
|
|
||||||
######################
|
|
||||||
|
|
||||||
macOS:
|
|
||||||
name: 🍏 macOS
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔧 Prepare PR
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Append PR number to version'
|
|
||||||
tr -d '\n' < .version > temp && mv temp .version
|
|
||||||
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 👷 Build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Update/Install dependencies'
|
|
||||||
brew update || true
|
|
||||||
brew install --overwrite qt5 libusb
|
|
||||||
brew link --overwrite --force qt5
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
echo '::group::Build packages'
|
|
||||||
./.github/scripts/build.sh
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
PLATFORM: osx
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ github.event_name == 'pull_request' && 'macOS' || 'artifact' }}
|
|
||||||
path: 'build/Hyperion-*'
|
|
||||||
|
|
||||||
######################
|
|
||||||
###### Windows #######
|
|
||||||
######################
|
|
||||||
|
|
||||||
windows:
|
|
||||||
name: 🪟 Windows
|
|
||||||
runs-on: windows-2022
|
|
||||||
env:
|
|
||||||
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
|
|
||||||
QT_VERSION: 5.15.2
|
|
||||||
steps:
|
|
||||||
- name: ⬇ Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 🔧 Prepare PR
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Append PR number to version'
|
|
||||||
tr -d '\n' < .version > temp && mv temp .version
|
|
||||||
echo -n "+PR${{ github.event.pull_request.number }}" >> .version
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 💾 Cache/Restore
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
|
|
||||||
key: ${{ runner.os }}-chocolatey
|
|
||||||
|
|
||||||
- name: 📥 Install OpenSSL, DirectX SDK, libjpeg-turbo
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
choco install --no-progress openssl --version=1.1.1.2100 -y
|
|
||||||
choco install --no-progress directx-sdk -y
|
|
||||||
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/2.0.6/libjpeg-turbo-2.0.6-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
|
|
||||||
.\libjpeg-turbo /S
|
|
||||||
|
|
||||||
- name: 📥 Install Qt
|
|
||||||
uses: jurplel/install-qt-action@v3
|
|
||||||
with:
|
|
||||||
version: ${{env.QT_VERSION}}
|
|
||||||
target: 'desktop'
|
|
||||||
arch: 'win64_msvc2019_64'
|
|
||||||
cache: 'true'
|
|
||||||
cache-key-prefix: 'cache-qt-windows'
|
|
||||||
|
|
||||||
- name: 🛠️ Setup MSVC
|
|
||||||
shell: cmd
|
|
||||||
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
|
|
||||||
|
|
||||||
- name: 👷 Build
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo '::group::Build packages'
|
|
||||||
./.github/scripts/build.sh
|
|
||||||
echo '::endgroup::'
|
|
||||||
env:
|
|
||||||
PLATFORM: windows
|
|
||||||
|
|
||||||
- name: 📦 Upload
|
|
||||||
if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'pull_request' }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: ${{ github.event_name == 'pull_request' && 'windows' || 'artifact' }}
|
|
||||||
path: ${{ github.event_name == 'pull_request' && 'build/*.exe' || 'build/Hyperion-*' }}
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
###### Publish GitHub Releases ######
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
github_publish:
|
|
||||||
name: 🚀 Publish GitHub Releases
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags')
|
if: startsWith(github.event.ref, 'refs/tags')
|
||||||
needs: [Linux, macOS, windows]
|
needs: [ github_build ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: ⬇ Checkout
|
- name: 📲 Dispatch APT/DNF build
|
||||||
uses: actions/checkout@v4
|
if: ${{ env.SECRET_HYPERION_BOT_TOKEN != null }}
|
||||||
|
uses: peter-evans/repository-dispatch@v2.1.2
|
||||||
- name: 🔧 Prepare
|
|
||||||
run: |
|
|
||||||
echo '::group::Generate environment variables from .version and tag'
|
|
||||||
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
|
||||||
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
|
|
||||||
echo '::endgroup::'
|
|
||||||
|
|
||||||
- name: 💾 Artifact download
|
|
||||||
uses: actions/download-artifact@v3.0.2
|
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
repository: hyperion-project/hyperion.releases-ci
|
||||||
|
token: ${{ secrets.HYPERION_BOT_TOKEN }}
|
||||||
- name: 📦 Upload
|
event-type: releases_repo_build
|
||||||
uses: softprops/action-gh-release@v1
|
client-payload: '{ "head_sha": "${{ github.sha }}" }'
|
||||||
with:
|
|
||||||
name: Hyperion ${{ env.VERSION }}
|
|
||||||
tag_name: ${{ env.TAG }}
|
|
||||||
files: "artifacts/**"
|
|
||||||
draft: true
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
SECRET_HYPERION_BOT_TOKEN: ${{ secrets.HYPERION_BOT_TOKEN }}
|
||||||
|
|
||||||
###################################
|
|
||||||
###### APT reusable workflow ######
|
|
||||||
###################################
|
|
||||||
|
|
||||||
apt_build:
|
|
||||||
name: APT Build
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags')
|
|
||||||
needs: [Linux, macOS, windows]
|
|
||||||
uses: ./.github/workflows/apt.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
nightly: false
|
|
||||||
publish: true
|
|
||||||
|
|
||||||
###################################
|
|
||||||
###### DNF reusable workflow ######
|
|
||||||
###################################
|
|
||||||
|
|
||||||
dnf_build:
|
|
||||||
name: DNF Build
|
|
||||||
if: startsWith(github.event.ref, 'refs/tags')
|
|
||||||
needs: [Linux, macOS, windows]
|
|
||||||
uses: ./.github/workflows/dnf.yml
|
|
||||||
secrets: inherit
|
|
||||||
with:
|
|
||||||
nightly: false
|
|
||||||
publish: true
|
|
||||||
|
250
.github/workflows/qt5_6.yml
vendored
Normal file
250
.github/workflows/qt5_6.yml
vendored
Normal file
@ -0,0 +1,250 @@
|
|||||||
|
name: GitHub Qt5/6 Builds
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Reusable from push_pull.yml
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
qt_version:
|
||||||
|
type: string
|
||||||
|
description: Build with this Qt version
|
||||||
|
default: '5'
|
||||||
|
required: false
|
||||||
|
event_name:
|
||||||
|
type: string
|
||||||
|
description: The event name
|
||||||
|
default: ''
|
||||||
|
required: false
|
||||||
|
pull_request_number:
|
||||||
|
type: string
|
||||||
|
description: The corresponding PR number
|
||||||
|
default: ''
|
||||||
|
required: false
|
||||||
|
publish:
|
||||||
|
type: boolean
|
||||||
|
description: Package publishing
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
ghcr: hyperion-project
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
######################
|
||||||
|
###### Linux #########
|
||||||
|
######################
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
name: 🐧 ${{ matrix.os.description }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [
|
||||||
|
{ distribution: debian, codename: buster, description: Debian Buster (x86_64), architecture: [ amd64, linux/amd64 ] },
|
||||||
|
{ distribution: debian, codename: bullseye, description: Debian Bullseye (x86_64), architecture: [ amd64, linux/amd64 ] },
|
||||||
|
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 1/ZERO), architecture: [ armv6, linux/arm/v5 ] },
|
||||||
|
{ distribution: debian, codename: buster, description: Debian Buster (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
|
||||||
|
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Raspberry Pi 2/3/4), architecture: [ armv7, linux/arm/v7 ] },
|
||||||
|
{ distribution: debian, codename: buster, description: Debian Buster (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] },
|
||||||
|
{ distribution: debian, codename: bullseye, description: Debian Bullseye (Generic AARCH64), architecture: [ aarch64, linux/arm64 ] }
|
||||||
|
]
|
||||||
|
isQt5:
|
||||||
|
- ${{ inputs.qt_version == '5' }}
|
||||||
|
include:
|
||||||
|
- os.architecture[0]: amd64
|
||||||
|
platform: x11
|
||||||
|
- os.architecture[0]: armv6
|
||||||
|
platform: rpi
|
||||||
|
- os.architecture[0]: armv7
|
||||||
|
platform: rpi
|
||||||
|
- os.architecture[0]: aarch64
|
||||||
|
platform: amlogic
|
||||||
|
exclude:
|
||||||
|
- isQt5: true
|
||||||
|
os: { distribution: debian, codename: bullseye }
|
||||||
|
- isQt5: false
|
||||||
|
os: { distribution: debian, codename: buster }
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: ⬇ Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: 🔧 Prepare
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo '::group::Append PR number to version (PR only)'
|
||||||
|
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
|
||||||
|
tr -d '\n' < .version > temp && mv temp .version
|
||||||
|
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
|
||||||
|
fi
|
||||||
|
echo '::endgroup::'
|
||||||
|
|
||||||
|
- name: 👷 Build
|
||||||
|
shell: bash
|
||||||
|
run: ./.github/scripts/build.sh
|
||||||
|
env:
|
||||||
|
DOCKER_IMAGE: ${{ matrix.os.distribution }}
|
||||||
|
DOCKER_TAG: ${{ matrix.os.codename }}${{ inputs.qt_version == '6' && '-qt6' || '' }}
|
||||||
|
PLATFORM: ${{ matrix.platform }}
|
||||||
|
TARGET_ARCH: ${{ matrix.os.architecture[1] }}
|
||||||
|
|
||||||
|
- name: 📦 Upload
|
||||||
|
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
|
||||||
|
path: ${{ inputs.event_name == 'pull_request' && 'deploy/*.tar.gz' || 'deploy/Hyperion-*' }}
|
||||||
|
env:
|
||||||
|
NAME: format('{0}_{1}_{2}{3}', matrix.os.distribution, matrix.os.codename, matrix.os.architecture[0], inputs.qt_version == '6' && '_qt6' || '')
|
||||||
|
|
||||||
|
######################
|
||||||
|
###### macOS #########
|
||||||
|
######################
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
name: 🍏 macOS x64
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: ⬇ Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: 🔧 Prepare
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo '::group::Append PR number to version (PR only)'
|
||||||
|
if [[ "${{ inputs.event_name }}" = "pull_request" ]]; then
|
||||||
|
tr -d '\n' < .version > temp && mv temp .version
|
||||||
|
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
|
||||||
|
fi
|
||||||
|
echo '::endgroup::'
|
||||||
|
|
||||||
|
echo '::group::Update/Install dependencies'
|
||||||
|
brew update || true
|
||||||
|
brew install --overwrite qt${{ inputs.qt_version }} libusb
|
||||||
|
brew link --overwrite --force qt${{ inputs.qt_version }}
|
||||||
|
echo '::endgroup::'
|
||||||
|
|
||||||
|
- name: 👷 Build
|
||||||
|
shell: bash
|
||||||
|
run: ./.github/scripts/build.sh
|
||||||
|
env:
|
||||||
|
PLATFORM: osx
|
||||||
|
|
||||||
|
- name: 📦 Upload
|
||||||
|
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
|
||||||
|
path: 'build/Hyperion-*'
|
||||||
|
env:
|
||||||
|
NAME: ${{ inputs.qt_version == '6' && 'macOS_x64_qt6' || 'macOS_x64' }}
|
||||||
|
|
||||||
|
######################
|
||||||
|
###### Windows #######
|
||||||
|
######################
|
||||||
|
|
||||||
|
windows:
|
||||||
|
name: 🪟 Windows x64
|
||||||
|
runs-on: windows-2022
|
||||||
|
env:
|
||||||
|
VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
|
||||||
|
steps:
|
||||||
|
- name: ⬇ Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: 🔧 Prepare PR
|
||||||
|
if: ${{ inputs.event_name == 'pull_request' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo '::group::Append PR number to version'
|
||||||
|
tr -d '\n' < .version > temp && mv temp .version
|
||||||
|
echo -n "+PR${{ inputs.pull_request_number }}" >> .version
|
||||||
|
echo '::endgroup::'
|
||||||
|
|
||||||
|
- name: 💾 Cache/Restore
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
|
||||||
|
key: ${{ runner.os }}${{ inputs.qt_version == '6' && '-chocolatey-qt6' || '-chocolatey' }}
|
||||||
|
|
||||||
|
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo ${{ inputs.qt_version == '6' && 'and Vulkan-SDK' || '' }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
choco install --no-progress directx-sdk ${{env.VULKAN_SDK}} -y
|
||||||
|
choco install --no-progress ${{env.OPENSSL}} -y
|
||||||
|
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/3.0.1/libjpeg-turbo-3.0.1-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
|
||||||
|
.\libjpeg-turbo /S
|
||||||
|
env:
|
||||||
|
VULKAN_SDK: ${{ inputs.qt_version == '6' && 'vulkan-sdk' || '' }}
|
||||||
|
OPENSSL: ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
|
||||||
|
|
||||||
|
- name: 📥 Install Qt
|
||||||
|
uses: jurplel/install-qt-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ inputs.qt_version == '6' && '6.5.2' || '5.15.2' }}
|
||||||
|
target: 'desktop'
|
||||||
|
modules: ${{ inputs.qt_version == '6' && 'qtserialport' || '' }}
|
||||||
|
arch: 'win64_msvc2019_64'
|
||||||
|
cache: 'true'
|
||||||
|
cache-key-prefix: 'cache-qt-windows'
|
||||||
|
|
||||||
|
- name: 🛠️ Setup MSVC
|
||||||
|
shell: cmd
|
||||||
|
run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat"
|
||||||
|
|
||||||
|
- name: 👷 Build
|
||||||
|
shell: bash
|
||||||
|
run: ./.github/scripts/build.sh
|
||||||
|
env:
|
||||||
|
PLATFORM: windows
|
||||||
|
|
||||||
|
- name: 📦 Upload
|
||||||
|
if: ${{ inputs.publish || inputs.event_name == 'pull_request' }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.event_name == 'pull_request' && env.NAME || 'artifact' }}
|
||||||
|
path: ${{ inputs.event_name == 'pull_request' && 'build/*.exe' || 'build/Hyperion-*' }}
|
||||||
|
env:
|
||||||
|
NAME: ${{ inputs.qt_version == '6' && 'windows_x64_qt6' || 'windows_x64' }}
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
###### Publish GitHub Releases ######
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
github_publish:
|
||||||
|
name: 🚀 Publish GitHub Releases
|
||||||
|
if: ${{ inputs.qt_version == '5' && inputs.publish }}
|
||||||
|
needs: [Linux, macOS, windows]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: ⬇ Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 🔧 Prepare
|
||||||
|
run: |
|
||||||
|
echo '::group::Generate environment variables from .version and tag'
|
||||||
|
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||||
|
echo "VERSION=$(tr -d '\n' < .version)" >> $GITHUB_ENV
|
||||||
|
echo '::endgroup::'
|
||||||
|
|
||||||
|
- name: 💾 Artifact download
|
||||||
|
uses: actions/download-artifact@v3.0.2
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
|
||||||
|
- name: 📦 Upload
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: Hyperion ${{ env.VERSION }}
|
||||||
|
tag_name: ${{ env.TAG }}
|
||||||
|
files: "artifacts/**"
|
||||||
|
draft: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
7
.gitmodules
vendored
7
.gitmodules
vendored
@ -1,7 +1,7 @@
|
|||||||
[submodule "dependencies/external/rpi_ws281x"]
|
[submodule "dependencies/external/rpi_ws281x"]
|
||||||
path = dependencies/external/rpi_ws281x
|
path = dependencies/external/rpi_ws281x
|
||||||
url = https://github.com/jgarff/rpi_ws281x
|
url = https://github.com/hyperion-project/rpi_ws281x
|
||||||
branch = master
|
branch = main
|
||||||
[submodule "dependencies/external/flatbuffers"]
|
[submodule "dependencies/external/flatbuffers"]
|
||||||
path = dependencies/external/flatbuffers
|
path = dependencies/external/flatbuffers
|
||||||
url = https://github.com/google/flatbuffers
|
url = https://github.com/google/flatbuffers
|
||||||
@ -15,3 +15,6 @@
|
|||||||
[submodule "dependencies/external/mbedtls"]
|
[submodule "dependencies/external/mbedtls"]
|
||||||
path = dependencies/external/mbedtls
|
path = dependencies/external/mbedtls
|
||||||
url = ../../Mbed-TLS/mbedtls.git
|
url = ../../Mbed-TLS/mbedtls.git
|
||||||
|
[submodule "dependencies/external/rpi_ws281x"]
|
||||||
|
path = dependencies/external/rpi_ws281x
|
||||||
|
url = https://github.com/Paulchen-Panther/rpi_ws281x
|
||||||
|
@ -70,6 +70,7 @@ Note: The wizard will configure an APIv2 capable bridge always with Entertainmen
|
|||||||
- Changed default build from Stretch to Buster
|
- Changed default build from Stretch to Buster
|
||||||
- Support Qt 6.7, Update to Protobuf 23.4.0, Update mbedTLS to v3.4.0, Update flatbuffers to v23.5.26
|
- Support Qt 6.7, Update to Protobuf 23.4.0, Update mbedTLS to v3.4.0, Update flatbuffers to v23.5.26
|
||||||
- Use C++17 standard as default
|
- Use C++17 standard as default
|
||||||
|
- Added Pull Request (PR) installation script, allowing users to test development builds savely on Linux
|
||||||
- Fixed missing include limits in QJsonSchemaChecker - Thanks @Portisch
|
- Fixed missing include limits in QJsonSchemaChecker - Thanks @Portisch
|
||||||
- Fixed dependencies for deb packages in Debian Bookworm (#1579) - Thanks @hg42, @Psirus
|
- Fixed dependencies for deb packages in Debian Bookworm (#1579) - Thanks @hg42, @Psirus
|
||||||
- Fixed git version identification when run in docker and local code
|
- Fixed git version identification when run in docker and local code
|
||||||
|
428
CMakeLists.txt
428
CMakeLists.txt
@ -1,17 +1,17 @@
|
|||||||
cmake_minimum_required(VERSION 3.5.0)
|
cmake_minimum_required(VERSION 3.5.0)
|
||||||
|
|
||||||
message( STATUS "CMake Version: ${CMAKE_VERSION}" )
|
message(STATUS "CMake Version: ${CMAKE_VERSION}")
|
||||||
|
|
||||||
macro(addIndent text)
|
macro(addIndent text)
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
||||||
list(APPEND CMAKE_MESSAGE_INDENT ${text})
|
list(APPEND CMAKE_MESSAGE_INDENT ${text})
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(removeIndent)
|
macro(removeIndent)
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
||||||
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
PROJECT(hyperion)
|
PROJECT(hyperion)
|
||||||
@ -31,9 +31,16 @@ set(CMAKE_AUTOMOC ON)
|
|||||||
# auto prepare .qrc files
|
# auto prepare .qrc files
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
# Configure CCache if available
|
# multicore compiling
|
||||||
|
include(ProcessorCount)
|
||||||
|
ProcessorCount(NCORES)
|
||||||
|
if(NOT NCORES EQUAL 0)
|
||||||
|
set(CMAKE_BUILD_PARALLEL_LEVEL NCORES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Configure CCache ifavailable
|
||||||
find_program(CCACHE_FOUND ccache)
|
find_program(CCACHE_FOUND ccache)
|
||||||
if ( CCACHE_FOUND )
|
if(CCACHE_FOUND)
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||||
endif(CCACHE_FOUND)
|
endif(CCACHE_FOUND)
|
||||||
@ -58,163 +65,163 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||||||
|
|
||||||
# Set build variables
|
# Set build variables
|
||||||
# Grabber
|
# Grabber
|
||||||
SET ( DEFAULT_AMLOGIC OFF )
|
set(DEFAULT_AMLOGIC OFF)
|
||||||
SET ( DEFAULT_DISPMANX OFF )
|
set(DEFAULT_DISPMANX OFF)
|
||||||
SET ( DEFAULT_DX OFF )
|
set(DEFAULT_DX OFF)
|
||||||
SET ( DEFAULT_MF OFF )
|
set(DEFAULT_MF OFF)
|
||||||
SET ( DEFAULT_OSX OFF )
|
set(DEFAULT_OSX OFF)
|
||||||
SET ( DEFAULT_QT ON )
|
set(DEFAULT_QT ON )
|
||||||
SET ( DEFAULT_V4L2 OFF )
|
set(DEFAULT_V4L2 OFF)
|
||||||
SET ( DEFAULT_AUDIO ON )
|
set(DEFAULT_AUDIO ON )
|
||||||
SET ( DEFAULT_X11 OFF )
|
set(DEFAULT_X11 OFF)
|
||||||
SET ( DEFAULT_XCB OFF )
|
set(DEFAULT_XCB OFF)
|
||||||
|
|
||||||
# Input
|
# Input
|
||||||
SET ( DEFAULT_BOBLIGHT_SERVER ON )
|
set(DEFAULT_BOBLIGHT_SERVER ON )
|
||||||
SET ( DEFAULT_CEC OFF )
|
set(DEFAULT_CEC OFF)
|
||||||
SET ( DEFAULT_FLATBUF_SERVER ON )
|
set(DEFAULT_FLATBUF_SERVER ON )
|
||||||
SET ( DEFAULT_PROTOBUF_SERVER ON )
|
set(DEFAULT_PROTOBUF_SERVER ON )
|
||||||
|
|
||||||
# Output
|
# Output
|
||||||
SET ( DEFAULT_FORWARDER ON )
|
set(DEFAULT_FORWARDER ON )
|
||||||
SET ( DEFAULT_FLATBUF_CONNECT ON )
|
set(DEFAULT_FLATBUF_CONNECT ON )
|
||||||
|
|
||||||
# LED-Devices
|
# LED-Devices
|
||||||
SET ( DEFAULT_DEV_NETWORK ON )
|
set(DEFAULT_DEV_NETWORK ON )
|
||||||
SET ( DEFAULT_DEV_SERIAL ON )
|
set(DEFAULT_DEV_SERIAL ON )
|
||||||
SET ( DEFAULT_DEV_SPI OFF )
|
set(DEFAULT_DEV_SPI OFF)
|
||||||
SET ( DEFAULT_DEV_TINKERFORGE OFF )
|
set(DEFAULT_DEV_TINKERFORGE OFF)
|
||||||
SET ( DEFAULT_DEV_USB_HID OFF )
|
set(DEFAULT_DEV_USB_HID OFF)
|
||||||
SET ( DEFAULT_DEV_WS281XPWM OFF )
|
set(DEFAULT_DEV_WS281XPWM OFF)
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
SET ( DEFAULT_EFFECTENGINE ON )
|
set(DEFAULT_EFFECTENGINE ON )
|
||||||
SET ( DEFAULT_EXPERIMENTAL OFF )
|
set(DEFAULT_EXPERIMENTAL OFF)
|
||||||
SET ( DEFAULT_MDNS ON )
|
set(DEFAULT_MDNS ON )
|
||||||
SET ( DEFAULT_REMOTE_CTL ON )
|
set(DEFAULT_REMOTE_CTL ON )
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
SET ( DEFAULT_JSONCHECKS ON )
|
set(DEFAULT_JSONCHECKS ON )
|
||||||
SET ( DEFAULT_DEPLOY_DEPENDENCIES ON )
|
set(DEFAULT_DEPLOY_DEPENDENCIES ON )
|
||||||
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
|
set(DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF)
|
||||||
SET ( DEFAULT_USE_SYSTEM_PROTO_LIBS OFF )
|
set(DEFAULT_USE_SYSTEM_PROTO_LIBS OFF)
|
||||||
SET ( DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF )
|
set(DEFAULT_USE_SYSTEM_MBEDTLS_LIBS OFF)
|
||||||
SET ( DEFAULT_USE_SYSTEM_QMDNS_LIBS OFF )
|
set(DEFAULT_USE_SYSTEM_QMDNS_LIBS OFF)
|
||||||
SET ( DEFAULT_TESTS OFF )
|
set(DEFAULT_TESTS OFF)
|
||||||
|
|
||||||
# Build Hyperion with a reduced set of functionality, overwrites other default values
|
# Build Hyperion with a reduced set of functionality, overwrites other default values
|
||||||
SET ( DEFAULT_HYPERION_LIGHT OFF )
|
set(DEFAULT_HYPERION_LIGHT OFF)
|
||||||
|
|
||||||
IF ( ${CMAKE_SYSTEM} MATCHES "Linux" )
|
if(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||||
SET ( DEFAULT_FB ON )
|
set(DEFAULT_FB ON)
|
||||||
SET ( DEFAULT_V4L2 ON )
|
set(DEFAULT_V4L2 ON)
|
||||||
SET ( DEFAULT_DEV_SPI ON )
|
set(DEFAULT_DEV_SPI ON)
|
||||||
SET ( DEFAULT_DEV_TINKERFORGE ON )
|
set(DEFAULT_DEV_TINKERFORGE ON)
|
||||||
SET ( DEFAULT_DEV_USB_HID ON )
|
set(DEFAULT_DEV_USB_HID ON)
|
||||||
SET ( DEFAULT_CEC ON )
|
set(DEFAULT_CEC ON)
|
||||||
ELSEIF ( WIN32 )
|
elseif (WIN32)
|
||||||
SET ( DEFAULT_DX ON )
|
set(DEFAULT_DX ON)
|
||||||
SET ( DEFAULT_MF ON )
|
set(DEFAULT_MF ON)
|
||||||
ELSE()
|
else()
|
||||||
SET ( DEFAULT_FB OFF )
|
set(DEFAULT_FB OFF)
|
||||||
SET ( DEFAULT_V4L2 OFF )
|
set(DEFAULT_V4L2 OFF)
|
||||||
SET ( DEFAULT_DEV_SPI OFF )
|
set(DEFAULT_DEV_SPI OFF)
|
||||||
SET ( DEFAULT_DEV_TINKERFORGE OFF )
|
set(DEFAULT_DEV_TINKERFORGE OFF)
|
||||||
SET ( DEFAULT_DEV_USB_HID OFF )
|
set(DEFAULT_DEV_USB_HID OFF)
|
||||||
SET ( DEFAULT_CEC OFF )
|
set(DEFAULT_CEC OFF)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
if ( NOT DEFINED PLATFORM )
|
if(NOT DEFINED PLATFORM)
|
||||||
if ( APPLE )
|
if(APPLE)
|
||||||
SET( PLATFORM "osx")
|
set(PLATFORM "osx")
|
||||||
elseif ( WIN32 )
|
elseif (WIN32)
|
||||||
SET( PLATFORM "windows")
|
set(PLATFORM "windows")
|
||||||
elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" )
|
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86")
|
||||||
SET( PLATFORM "x11")
|
set(PLATFORM "x11")
|
||||||
elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
|
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" OR "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
|
||||||
SET( PLATFORM "rpi")
|
set(PLATFORM "rpi")
|
||||||
FILE( READ /proc/cpuinfo SYSTEM_CPUINFO )
|
file(READ /proc/cpuinfo SYSTEM_CPUINFO)
|
||||||
STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO )
|
STRING (TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO)
|
||||||
if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4 )
|
if("${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
|
||||||
SET( PLATFORM "amlogic" )
|
set(PLATFORM "amlogic")
|
||||||
elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
|
elseif (("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||||
SET( PLATFORM "amlogic64" )
|
set(PLATFORM "amlogic64")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if ( PLATFORM )
|
if(PLATFORM)
|
||||||
message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
|
message(STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
|
||||||
else()
|
else()
|
||||||
message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=<rpi|amlogic|amlogic64|x11|x11-dev|osx|osx-dev>")
|
message(FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=<rpi|amlogic|amlogic64|x11|x11-dev|osx|osx-dev>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message( STATUS "PLATFORM: ${PLATFORM}")
|
message(STATUS "PLATFORM: ${PLATFORM}")
|
||||||
|
|
||||||
# Macro to get path of first sub dir of a dir, used for MAC OSX lib/header searching
|
# Macro to get path of first sub dir of a dir, used for MAC OSX lib/header searching
|
||||||
MACRO(FIRSTSUBDIR result curdir)
|
macro(FIRSTSUBDIR result curdir)
|
||||||
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
||||||
SET(dirlist "")
|
set(dirlist "")
|
||||||
FOREACH(child ${children})
|
foreach(child ${children})
|
||||||
IF(IS_DIRECTORY ${curdir}/${child})
|
if(IS_DIRECTORY ${curdir}/${child})
|
||||||
LIST(APPEND dirlist "${curdir}/${child}")
|
list(APPEND dirlist "${curdir}/${child}")
|
||||||
BREAK()
|
break()
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
SET(${result} ${dirlist})
|
set(${result} ${dirlist})
|
||||||
ENDMACRO()
|
endmacro()
|
||||||
|
|
||||||
if ( "${PLATFORM}" MATCHES "osx" )
|
if("${PLATFORM}" MATCHES "osx")
|
||||||
# specify the min version of the target platform (only GitHub Actions)
|
# specify the min version of the target platform (only GitHub Actions)
|
||||||
if( DEFINED ENV{GITHUB_ACTIONS} AND DEFINED ENV{GITHUB_WORKSPACE} )
|
if(DEFINED ENV{GITHUB_WORKSPACE})
|
||||||
SET ( CMAKE_OSX_DEPLOYMENT_TARGET "10.15" )
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# add specific prefix paths
|
# add specific prefix paths
|
||||||
FIRSTSUBDIR(SUBDIRPY "/usr/local/opt/python3/Frameworks/Python.framework/Versions")
|
FIRSTSUBDIR(SUBDIRPY "/usr/local/opt/python3/Frameworks/Python.framework/Versions")
|
||||||
SET ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${SUBDIRPY} )
|
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${SUBDIRPY})
|
||||||
|
|
||||||
include_directories("/opt/X11/include/")
|
include_directories("/opt/X11/include/")
|
||||||
SET ( DEFAULT_OSX ON )
|
set(DEFAULT_OSX ON )
|
||||||
SET ( DEFAULT_AUDIO OFF )
|
set(DEFAULT_AUDIO OFF)
|
||||||
SET ( DEFAULT_DEV_USB_HID ON )
|
set(DEFAULT_DEV_USB_HID ON )
|
||||||
|
|
||||||
elseif ( "${PLATFORM}" MATCHES "rpi" )
|
elseif ("${PLATFORM}" MATCHES "rpi")
|
||||||
SET ( DEFAULT_DISPMANX ON )
|
set(DEFAULT_DISPMANX ON)
|
||||||
SET ( DEFAULT_DEV_WS281XPWM ON )
|
set(DEFAULT_DEV_WS281XPWM ON)
|
||||||
elseif ( "${PLATFORM}" MATCHES "^amlogic" )
|
elseif ("${PLATFORM}" MATCHES "^amlogic")
|
||||||
SET ( DEFAULT_AMLOGIC ON )
|
set(DEFAULT_AMLOGIC ON)
|
||||||
if ( "${PLATFORM}" MATCHES "-dev$" )
|
if("${PLATFORM}" MATCHES "-dev$")
|
||||||
SET ( DEFAULT_AMLOGIC ON )
|
set(DEFAULT_AMLOGIC ON)
|
||||||
SET ( DEFAULT_DISPMANX OFF )
|
set(DEFAULT_DISPMANX OFF)
|
||||||
SET ( DEFAULT_QT OFF )
|
set(DEFAULT_QT OFF)
|
||||||
SET ( DEFAULT_CEC OFF )
|
set(DEFAULT_CEC OFF)
|
||||||
endif()
|
endif()
|
||||||
elseif ( "${PLATFORM}" MATCHES "^x11" )
|
elseif ("${PLATFORM}" MATCHES "^x11")
|
||||||
SET ( DEFAULT_X11 ON )
|
set(DEFAULT_X11 ON)
|
||||||
SET ( DEFAULT_XCB ON )
|
set(DEFAULT_XCB ON)
|
||||||
if ( "${PLATFORM}" MATCHES "-dev$" )
|
if("${PLATFORM}" MATCHES "-dev$")
|
||||||
SET ( DEFAULT_AMLOGIC ON)
|
set(DEFAULT_AMLOGIC ON)
|
||||||
SET ( DEFAULT_DEV_WS281XPWM ON )
|
set(DEFAULT_DEV_WS281XPWM ON)
|
||||||
endif()
|
endif()
|
||||||
elseif ( "${PLATFORM}" STREQUAL "imx6" )
|
elseif ("${PLATFORM}" STREQUAL "imx6")
|
||||||
SET ( DEFAULT_FB ON )
|
set(DEFAULT_FB ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# enable tests for -dev builds
|
# enable tests for -dev builds
|
||||||
if ( "${PLATFORM}" MATCHES "-dev$" )
|
if("${PLATFORM}" MATCHES "-dev$")
|
||||||
SET ( DEFAULT_TESTS ON )
|
set(DEFAULT_TESTS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
STRING( TOUPPER "-DPLATFORM_${PLATFORM}" PLATFORM_DEFINE)
|
string(TOUPPER "-DPLATFORM_${PLATFORM}" PLATFORM_DEFINE)
|
||||||
STRING( REPLACE "-DEV" "" PLATFORM_DEFINE "${PLATFORM_DEFINE}" )
|
string(REPLACE "-DEV" "" PLATFORM_DEFINE "${PLATFORM_DEFINE}")
|
||||||
ADD_DEFINITIONS( ${PLATFORM_DEFINE} )
|
ADD_DEFINITIONS(${PLATFORM_DEFINE})
|
||||||
|
|
||||||
# set the build options
|
# set the build options
|
||||||
|
|
||||||
option(HYPERION_LIGHT "Build Hyperion with a reduced set of functionality" ${DEFAULT_HYPERION_LIGHT} )
|
option(HYPERION_LIGHT "Build Hyperion with a reduced set of functionality" ${DEFAULT_HYPERION_LIGHT})
|
||||||
message(STATUS "HYPERION_LIGHT = ${HYPERION_LIGHT}")
|
message(STATUS "HYPERION_LIGHT = ${HYPERION_LIGHT}")
|
||||||
|
|
||||||
if (HYPERION_LIGHT)
|
if(HYPERION_LIGHT)
|
||||||
message(STATUS "HYPERION_LIGHT: Hyperion is build with a reduced set of functionality.")
|
message(STATUS "HYPERION_LIGHT: Hyperion is build with a reduced set of functionality.")
|
||||||
# Disable Grabbers
|
# Disable Grabbers
|
||||||
SET ( DEFAULT_AMLOGIC OFF )
|
SET ( DEFAULT_AMLOGIC OFF )
|
||||||
@ -225,48 +232,49 @@ if (HYPERION_LIGHT)
|
|||||||
SET ( DEFAULT_OSX OFF )
|
SET ( DEFAULT_OSX OFF )
|
||||||
SET ( DEFAULT_QT OFF )
|
SET ( DEFAULT_QT OFF )
|
||||||
SET ( DEFAULT_V4L2 OFF )
|
SET ( DEFAULT_V4L2 OFF )
|
||||||
SET ( DEFAULT_AUDIO OFF )
|
|
||||||
SET ( DEFAULT_X11 OFF )
|
SET ( DEFAULT_X11 OFF )
|
||||||
SET ( DEFAULT_XCB OFF )
|
SET ( DEFAULT_XCB OFF )
|
||||||
|
|
||||||
|
SET ( DEFAULT_AUDIO OFF )
|
||||||
|
|
||||||
# Disable Input Servers
|
# Disable Input Servers
|
||||||
SET ( DEFAULT_BOBLIGHT_SERVER OFF )
|
set(DEFAULT_BOBLIGHT_SERVER OFF)
|
||||||
SET ( DEFAULT_CEC OFF )
|
set(DEFAULT_CEC OFF)
|
||||||
SET ( DEFAULT_FLATBUF_SERVER OFF )
|
set(DEFAULT_FLATBUF_SERVER OFF)
|
||||||
SET ( DEFAULT_PROTOBUF_SERVER OFF )
|
set(DEFAULT_PROTOBUF_SERVER OFF)
|
||||||
|
|
||||||
# Disable Output Connectors
|
# Disable Output Connectors
|
||||||
SET ( DEFAULT_FORWARDER OFF )
|
set(DEFAULT_FORWARDER OFF)
|
||||||
SET ( DEFAULT_FLATBUF_CONNECT OFF )
|
set(DEFAULT_FLATBUF_CONNECT OFF)
|
||||||
|
|
||||||
# Disable Services
|
# Disable Services
|
||||||
SET ( DEFAULT_EFFECTENGINE OFF )
|
set(DEFAULT_EFFECTENGINE OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Grabber options:")
|
message(STATUS "Grabber options:")
|
||||||
|
|
||||||
addIndent(" - ")
|
addIndent(" - ")
|
||||||
|
|
||||||
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC} )
|
option(ENABLE_AMLOGIC "Enable the AMLOGIC video grabber" ${DEFAULT_AMLOGIC})
|
||||||
message(STATUS "ENABLE_AMLOGIC = ${ENABLE_AMLOGIC}")
|
message(STATUS "ENABLE_AMLOGIC = ${ENABLE_AMLOGIC}")
|
||||||
|
|
||||||
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX} )
|
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ${DEFAULT_DISPMANX})
|
||||||
message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}")
|
message(STATUS "ENABLE_DISPMANX = ${ENABLE_DISPMANX}")
|
||||||
|
|
||||||
option(ENABLE_DX "Enable the DirectX grabber" ${DEFAULT_DX})
|
option(ENABLE_DX "Enable the DirectX grabber" ${DEFAULT_DX})
|
||||||
message(STATUS "ENABLE_DX = ${ENABLE_DX}")
|
message(STATUS "ENABLE_DX = ${ENABLE_DX}")
|
||||||
|
|
||||||
if (ENABLE_AMLOGIC)
|
if(ENABLE_AMLOGIC)
|
||||||
SET(ENABLE_FB ON)
|
set(ENABLE_FB ON)
|
||||||
else()
|
else()
|
||||||
option(ENABLE_FB " Enable the framebuffer grabber" ${DEFAULT_FB} )
|
option(ENABLE_FB " Enable the framebuffer grabber" ${DEFAULT_FB})
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "ENABLE_FB = ${ENABLE_FB}")
|
message(STATUS "ENABLE_FB = ${ENABLE_FB}")
|
||||||
|
|
||||||
option(ENABLE_MF "Enable the Media Foundation grabber" ${DEFAULT_MF})
|
option(ENABLE_MF "Enable the Media Foundation grabber" ${DEFAULT_MF})
|
||||||
message(STATUS "ENABLE_MF = ${ENABLE_MF}")
|
message(STATUS "ENABLE_MF = ${ENABLE_MF}")
|
||||||
|
|
||||||
option(ENABLE_OSX "Enable the OSX grabber" ${DEFAULT_OSX} )
|
option(ENABLE_OSX "Enable the OSX grabber" ${DEFAULT_OSX})
|
||||||
message(STATUS "ENABLE_OSX = ${ENABLE_OSX}")
|
message(STATUS "ENABLE_OSX = ${ENABLE_OSX}")
|
||||||
|
|
||||||
option(ENABLE_QT "Enable the Qt grabber" ${DEFAULT_QT})
|
option(ENABLE_QT "Enable the Qt grabber" ${DEFAULT_QT})
|
||||||
@ -277,30 +285,28 @@ message(STATUS "ENABLE_V4L2 = ${ENABLE_V4L2}")
|
|||||||
|
|
||||||
option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11})
|
option(ENABLE_X11 "Enable the X11 grabber" ${DEFAULT_X11})
|
||||||
message(STATUS "ENABLE_X11 = ${ENABLE_X11}")
|
message(STATUS "ENABLE_X11 = ${ENABLE_X11}")
|
||||||
option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO})
|
|
||||||
message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}")
|
|
||||||
|
|
||||||
option(ENABLE_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_WS281XPWM} )
|
|
||||||
message(STATUS "ENABLE_WS281XPWM = ${ENABLE_WS281XPWM}")
|
|
||||||
|
|
||||||
option(ENABLE_XCB "Enable the XCB grabber" ${DEFAULT_XCB})
|
option(ENABLE_XCB "Enable the XCB grabber" ${DEFAULT_XCB})
|
||||||
message(STATUS "ENABLE_XCB = ${ENABLE_XCB}")
|
message(STATUS "ENABLE_XCB = ${ENABLE_XCB}")
|
||||||
|
|
||||||
|
option(ENABLE_AUDIO "Enable the AUDIO grabber" ${DEFAULT_AUDIO})
|
||||||
|
message(STATUS "ENABLE_AUDIO = ${ENABLE_AUDIO}")
|
||||||
|
|
||||||
removeIndent()
|
removeIndent()
|
||||||
|
|
||||||
message(STATUS "Input options:")
|
message(STATUS "Input options:")
|
||||||
addIndent(" - ")
|
addIndent(" - ")
|
||||||
|
|
||||||
option(ENABLE_BOBLIGHT_SERVER "Enable BOBLIGHT server" ${DEFAULT_BOBLIGHT_SERVER} )
|
option(ENABLE_BOBLIGHT_SERVER "Enable BOBLIGHT server" ${DEFAULT_BOBLIGHT_SERVER})
|
||||||
message(STATUS "ENABLE_BOBLIGHT_SERVER = ${ENABLE_BOBLIGHT_SERVER}")
|
message(STATUS "ENABLE_BOBLIGHT_SERVER = ${ENABLE_BOBLIGHT_SERVER}")
|
||||||
|
|
||||||
option(ENABLE_CEC "Enable the libcec and CEC control" ${DEFAULT_CEC} )
|
option(ENABLE_CEC "Enable the libcec and CEC control" ${DEFAULT_CEC})
|
||||||
message(STATUS "ENABLE_CEC = ${ENABLE_CEC}")
|
message(STATUS "ENABLE_CEC = ${ENABLE_CEC}")
|
||||||
|
|
||||||
option(ENABLE_FLATBUF_SERVER "Enable Flatbuffers server" ${DEFAULT_FLATBUF_SERVER} )
|
option(ENABLE_FLATBUF_SERVER "Enable Flatbuffers server" ${DEFAULT_FLATBUF_SERVER})
|
||||||
message(STATUS "ENABLE_FLATBUF_SERVER = ${ENABLE_FLATBUF_SERVER}")
|
message(STATUS "ENABLE_FLATBUF_SERVER = ${ENABLE_FLATBUF_SERVER}")
|
||||||
|
|
||||||
option(ENABLE_PROTOBUF_SERVER "Enable Protocol Buffers server" ${DEFAULT_PROTOBUF_SERVER} )
|
option(ENABLE_PROTOBUF_SERVER "Enable Protocol Buffers server" ${DEFAULT_PROTOBUF_SERVER})
|
||||||
message(STATUS "ENABLE_PROTOBUF_SERVER = ${ENABLE_PROTOBUF_SERVER}")
|
message(STATUS "ENABLE_PROTOBUF_SERVER = ${ENABLE_PROTOBUF_SERVER}")
|
||||||
|
|
||||||
removeIndent()
|
removeIndent()
|
||||||
@ -308,13 +314,13 @@ removeIndent()
|
|||||||
message(STATUS "Output options:")
|
message(STATUS "Output options:")
|
||||||
addIndent(" - ")
|
addIndent(" - ")
|
||||||
|
|
||||||
option(ENABLE_FORWARDER "Enable Hyperion forwarding" ${DEFAULT_FORWARDER} )
|
option(ENABLE_FORWARDER "Enable Hyperion forwarding" ${DEFAULT_FORWARDER})
|
||||||
message(STATUS "ENABLE_FORWARDER = ${ENABLE_FORWARDER}")
|
message(STATUS "ENABLE_FORWARDER = ${ENABLE_FORWARDER}")
|
||||||
|
|
||||||
if (ENABLE_FORWARDER)
|
if(ENABLE_FORWARDER)
|
||||||
SET(ENABLE_FLATBUF_CONNECT ON)
|
set(ENABLE_FLATBUF_CONNECT ON)
|
||||||
else()
|
else()
|
||||||
option(ENABLE_FLATBUF_CONNECT "Enable Flatbuffers connecting remotely" ${DEFAULT_FLATBUF_CONNECT} )
|
option(ENABLE_FLATBUF_CONNECT "Enable Flatbuffers connecting remotely" ${DEFAULT_FLATBUF_CONNECT})
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "ENABLE_FLATBUF_CONNECT = ${ENABLE_FLATBUF_CONNECT}")
|
message(STATUS "ENABLE_FLATBUF_CONNECT = ${ENABLE_FLATBUF_CONNECT}")
|
||||||
|
|
||||||
@ -323,22 +329,22 @@ removeIndent()
|
|||||||
message(STATUS "LED-Device options:")
|
message(STATUS "LED-Device options:")
|
||||||
addIndent(" - ")
|
addIndent(" - ")
|
||||||
|
|
||||||
option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK} )
|
option(ENABLE_DEV_NETWORK "Enable the Network devices" ${DEFAULT_DEV_NETWORK})
|
||||||
message(STATUS "ENABLE_DEV_NETWORK = ${ENABLE_DEV_NETWORK}")
|
message(STATUS "ENABLE_DEV_NETWORK = ${ENABLE_DEV_NETWORK}")
|
||||||
|
|
||||||
option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL} )
|
option(ENABLE_DEV_SERIAL "Enable the Serial devices" ${DEFAULT_DEV_SERIAL})
|
||||||
message(STATUS "ENABLE_DEV_SERIAL = ${ENABLE_DEV_SERIAL}")
|
message(STATUS "ENABLE_DEV_SERIAL = ${ENABLE_DEV_SERIAL}")
|
||||||
|
|
||||||
option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI} )
|
option(ENABLE_DEV_SPI "Enable the SPI device" ${DEFAULT_DEV_SPI})
|
||||||
message(STATUS "ENABLE_DEV_SPI = ${ENABLE_DEV_SPI}")
|
message(STATUS "ENABLE_DEV_SPI = ${ENABLE_DEV_SPI}")
|
||||||
|
|
||||||
option(ENABLE_DEV_TINKERFORGE "Enable the TINKERFORGE device" ${DEFAULT_DEV_TINKERFORGE})
|
option(ENABLE_DEV_TINKERFORGE "Enable the TINKERFORGE device" ${DEFAULT_DEV_TINKERFORGE})
|
||||||
message(STATUS "ENABLE_DEV_TINKERFORGE = ${ENABLE_DEV_TINKERFORGE}")
|
message(STATUS "ENABLE_DEV_TINKERFORGE = ${ENABLE_DEV_TINKERFORGE}")
|
||||||
|
|
||||||
option(ENABLE_DEV_USB_HID "Enable the libusb and hid devices" ${DEFAULT_DEV_USB_HID} )
|
option(ENABLE_DEV_USB_HID "Enable the libusb and hid devices" ${DEFAULT_DEV_USB_HID})
|
||||||
message(STATUS "ENABLE_DEV_USB_HID = ${ENABLE_DEV_USB_HID}")
|
message(STATUS "ENABLE_DEV_USB_HID = ${ENABLE_DEV_USB_HID}")
|
||||||
|
|
||||||
option(ENABLE_DEV_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_DEV_WS281XPWM} )
|
option(ENABLE_DEV_WS281XPWM "Enable the WS281x-PWM device" ${DEFAULT_DEV_WS281XPWM})
|
||||||
message(STATUS "ENABLE_DEV_WS281XPWM = ${ENABLE_DEV_WS281XPWM}")
|
message(STATUS "ENABLE_DEV_WS281XPWM = ${ENABLE_DEV_WS281XPWM}")
|
||||||
|
|
||||||
removeIndent()
|
removeIndent()
|
||||||
@ -379,7 +385,7 @@ endif()
|
|||||||
|
|
||||||
message(STATUS "DEFAULT_USE_SYSTEM_MBEDTLS_LIBS = ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS}")
|
message(STATUS "DEFAULT_USE_SYSTEM_MBEDTLS_LIBS = ${DEFAULT_USE_SYSTEM_MBEDTLS_LIBS}")
|
||||||
|
|
||||||
if (ENABLE_MDNS)
|
if(ENABLE_MDNS)
|
||||||
message(STATUS "DEFAULT_USE_SYSTEM_QMDNS_LIBS = ${DEFAULT_USE_SYSTEM_QMDNS_LIBS}")
|
message(STATUS "DEFAULT_USE_SYSTEM_QMDNS_LIBS = ${DEFAULT_USE_SYSTEM_QMDNS_LIBS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -392,14 +398,14 @@ message(STATUS "ENABLE_TESTS = ${ENABLE_TESTS}")
|
|||||||
|
|
||||||
removeIndent()
|
removeIndent()
|
||||||
|
|
||||||
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
|
set(FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf)
|
||||||
SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )
|
set(FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf)
|
||||||
|
|
||||||
SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto )
|
set(PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto)
|
||||||
SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )
|
set(PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto)
|
||||||
|
|
||||||
if(ENABLE_JSONCHECKS OR ENABLE_EFFECTENGINE)
|
if(ENABLE_JSONCHECKS OR ENABLE_EFFECTENGINE)
|
||||||
if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
|
if("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
|
||||||
set(Python_ADDITIONAL_VERSIONS 3.5)
|
set(Python_ADDITIONAL_VERSIONS 3.5)
|
||||||
find_package(PythonInterp 3.5 REQUIRED)
|
find_package(PythonInterp 3.5 REQUIRED)
|
||||||
else()
|
else()
|
||||||
@ -412,38 +418,38 @@ endif()
|
|||||||
|
|
||||||
if(ENABLE_JSONCHECKS)
|
if(ENABLE_JSONCHECKS)
|
||||||
# check all json files
|
# check all json files
|
||||||
FILE ( GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json )
|
file (GLOB_RECURSE HYPERION_SCHEMAS RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libsrc/*schema*.json)
|
||||||
SET( JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
|
set(JSON_FILES ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default ${HYPERION_SCHEMAS})
|
||||||
|
|
||||||
EXECUTE_PROCESS (
|
execute_process (
|
||||||
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
|
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkjson.py ${JSON_FILES}
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
RESULT_VARIABLE CHECK_JSON_FAILED
|
RESULT_VARIABLE CHECK_JSON_FAILED
|
||||||
)
|
)
|
||||||
IF ( ${CHECK_JSON_FAILED} )
|
if(${CHECK_JSON_FAILED})
|
||||||
MESSAGE (FATAL_ERROR "check of json files failed" )
|
message (FATAL_ERROR "check of json files failed")
|
||||||
ENDIF ()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_EFFECTENGINE)
|
if(ENABLE_EFFECTENGINE)
|
||||||
EXECUTE_PROCESS (
|
execute_process (
|
||||||
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
|
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkeffects.py effects effects/schema
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
RESULT_VARIABLE CHECK_EFFECTS_FAILED
|
RESULT_VARIABLE CHECK_EFFECTS_FAILED
|
||||||
)
|
)
|
||||||
IF ( ${CHECK_EFFECTS_FAILED} )
|
if(${CHECK_EFFECTS_FAILED})
|
||||||
MESSAGE (FATAL_ERROR "check of json effect files failed" )
|
message (FATAL_ERROR "check of json effect files failed")
|
||||||
ENDIF ()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
EXECUTE_PROCESS (
|
execute_process (
|
||||||
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
|
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/checkschema.py ${CMAKE_BINARY_DIR}/config/hyperion.config.json.default libsrc/hyperion/hyperion.schema.json
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
RESULT_VARIABLE CHECK_CONFIG_FAILED
|
RESULT_VARIABLE CHECK_CONFIG_FAILED
|
||||||
)
|
)
|
||||||
|
|
||||||
IF ( ${CHECK_CONFIG_FAILED} )
|
if(${CHECK_CONFIG_FAILED})
|
||||||
MESSAGE (FATAL_ERROR "check of json default config failed" )
|
message (FATAL_ERROR "check of json default config failed")
|
||||||
ENDIF ()
|
endif()
|
||||||
endif(ENABLE_JSONCHECKS)
|
endif(ENABLE_JSONCHECKS)
|
||||||
|
|
||||||
# Add project specific cmake modules (find, etc)
|
# Add project specific cmake modules (find, etc)
|
||||||
@ -457,8 +463,8 @@ configure_file("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR
|
|||||||
include_directories("${PROJECT_BINARY_DIR}")
|
include_directories("${PROJECT_BINARY_DIR}")
|
||||||
|
|
||||||
# Define the global output path of binaries
|
# Define the global output path of binaries
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH})
|
file(MAKE_DIRECTORY ${LIBRARY_OUTPUT_PATH})
|
||||||
file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
|
file(MAKE_DIRECTORY ${EXECUTABLE_OUTPUT_PATH})
|
||||||
@ -471,27 +477,21 @@ include_directories(${CMAKE_SOURCE_DIR}/include)
|
|||||||
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
|
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
|
||||||
|
|
||||||
# MSVC options
|
# MSVC options
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
# Search for Windows SDK
|
# Search for Windows SDK
|
||||||
find_package(WindowsSDK REQUIRED)
|
find_package(WindowsSDK REQUIRED)
|
||||||
message(STATUS "WINDOWS SDK: ${WINDOWSSDK_LATEST_DIR} ${WINDOWSSDK_LATEST_NAME}")
|
message(STATUS "WINDOWS SDK: ${WINDOWSSDK_LATEST_DIR} ${WINDOWSSDK_LATEST_NAME}")
|
||||||
message(STATUS "MSVC VERSION: ${MSVC_VERSION}")
|
message(STATUS "MSVC VERSION: ${MSVC_VERSION}")
|
||||||
|
|
||||||
# Search for DirectX9
|
|
||||||
if (ENABLE_DX)
|
|
||||||
find_package(DirectX9 REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Don't create new dynamic tags (RUNPATH) and setup -rpath to search for shared libs in BINARY/../lib folder (only for Unix)
|
# Don't create new dynamic tags (RUNPATH) and setup -rpath to search for shared libs in BINARY/../lib folder (only for Unix)
|
||||||
if (ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE)
|
if(ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
|
||||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
|
||||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreGraphics")
|
set(CMAKE_EXE_LINKER_FLAGS "-framework CoreGraphics")
|
||||||
@ -502,18 +502,18 @@ find_package(Threads REQUIRED)
|
|||||||
# Allow to overwrite QT base directory
|
# Allow to overwrite QT base directory
|
||||||
# Either supply QTDIR as -DQTDIR=<path> to cmake or set and environment variable QTDIR pointing to the Qt installation
|
# Either supply QTDIR as -DQTDIR=<path> to cmake or set and environment variable QTDIR pointing to the Qt installation
|
||||||
# For Windows and OSX, the default Qt installation path are tried to resolved automatically
|
# For Windows and OSX, the default Qt installation path are tried to resolved automatically
|
||||||
if (NOT DEFINED QTDIR)
|
if(NOT DEFINED QTDIR)
|
||||||
if (DEFINED ENV{QTDIR})
|
if(DEFINED ENV{QTDIR})
|
||||||
set(QTDIR $ENV{QTDIR})
|
set(QTDIR $ENV{QTDIR})
|
||||||
else()
|
else()
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
FIRSTSUBDIR(SUBDIRQT "C:/Qt")
|
FIRSTSUBDIR(SUBDIRQT "C:/Qt")
|
||||||
if (NOT ${SUBDIRQT} STREQUAL "")
|
if(NOT ${SUBDIRQT} STREQUAL "")
|
||||||
set(QTDIR "${SUBDIRQT}/msvc2019_64")
|
set(QTDIR "${SUBDIRQT}/msvc2019_64")
|
||||||
endif()
|
endif()
|
||||||
elseif ( "${PLATFORM}" MATCHES "osx" )
|
elseif ("${PLATFORM}" MATCHES "osx")
|
||||||
# QT6 x86_64 location
|
# QT6 x86_64 location
|
||||||
if (EXISTS /usr/local/opt/qt6)
|
if(EXISTS /usr/local/opt/qt6)
|
||||||
set(QTDIR "/usr/local/opt/qt6")
|
set(QTDIR "/usr/local/opt/qt6")
|
||||||
# QT6 arm64 location
|
# QT6 arm64 location
|
||||||
elseif (EXISTS /opt/homebrew/opt/qt@6)
|
elseif (EXISTS /opt/homebrew/opt/qt@6)
|
||||||
@ -529,34 +529,34 @@ if (NOT DEFINED QTDIR)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED QTDIR)
|
if(DEFINED QTDIR)
|
||||||
message(STATUS "Add QTDIR: ${QTDIR} to CMAKE_PREFIX_PATH")
|
message(STATUS "Add QTDIR: ${QTDIR} to CMAKE_PREFIX_PATH")
|
||||||
list(PREPEND CMAKE_PREFIX_PATH ${QTDIR} "${QTDIR}/lib")
|
list(PREPEND CMAKE_PREFIX_PATH ${QTDIR} "${QTDIR}/lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_PREFIX_PATH)
|
if(CMAKE_PREFIX_PATH)
|
||||||
message( STATUS "CMAKE_PREFIX_PATH used: ${CMAKE_PREFIX_PATH}" )
|
message(STATUS "CMAKE_PREFIX_PATH used: ${CMAKE_PREFIX_PATH}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# find QT libs
|
# find QT libs
|
||||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network Sql Widgets REQUIRED)
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Network Sql Widgets REQUIRED)
|
||||||
message( STATUS "Found Qt Version: ${QT_VERSION}" )
|
message(STATUS "Found Qt Version: ${QT_VERSION}")
|
||||||
|
|
||||||
if (${QT_VERSION_MAJOR} GREATER_EQUAL 6 )
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
SET(QT_MIN_VERSION "6.2.2")
|
set(QT_MIN_VERSION "6.2.2")
|
||||||
else()
|
else()
|
||||||
SET(QT_MIN_VERSION "5.5.0")
|
set(QT_MIN_VERSION "5.5.0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if ( "${QT_VERSION}" VERSION_LESS "${QT_MIN_VERSION}" )
|
if("${QT_VERSION}" VERSION_LESS "${QT_MIN_VERSION}")
|
||||||
message( FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}" )
|
message(FATAL_ERROR "Your Qt version is to old! Minimum required ${QT_MIN_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} COMPONENTS Core Gui Network Sql Widgets REQUIRED)
|
find_package(Qt${QT_VERSION_MAJOR} ${QT_VERSION} COMPONENTS Core Gui Network Sql Widgets REQUIRED)
|
||||||
|
|
||||||
message( STATUS "Qt version used: ${QT_VERSION}" )
|
message(STATUS "Qt version used: ${QT_VERSION}")
|
||||||
|
|
||||||
if (APPLE AND (${QT_VERSION_MAJOR} GREATER_EQUAL 6) )
|
if(APPLE AND (${QT_VERSION_MAJOR} GREATER_EQUAL 6))
|
||||||
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -568,29 +568,29 @@ add_definitions(${QT_DEFINITIONS})
|
|||||||
add_subdirectory(dependencies)
|
add_subdirectory(dependencies)
|
||||||
add_subdirectory(libsrc)
|
add_subdirectory(libsrc)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
if (ENABLE_TESTS)
|
if(ENABLE_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Add resources directory
|
# Add resources directory
|
||||||
add_subdirectory(resources)
|
add_subdirectory(resources)
|
||||||
|
|
||||||
# remove generated files on make cleaan too
|
# remove generated files on make cleaan too
|
||||||
LIST( APPEND GENERATED_QRC
|
list(APPEND GENERATED_QRC
|
||||||
${CMAKE_BINARY_DIR}/WebConfig.qrc
|
${CMAKE_BINARY_DIR}/WebConfig.qrc
|
||||||
${CMAKE_BINARY_DIR}/HyperionConfig.h
|
${CMAKE_BINARY_DIR}/HyperionConfig.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_EFFECTENGINE)
|
if(ENABLE_EFFECTENGINE)
|
||||||
LIST( APPEND GENERATED_QRC
|
list(APPEND GENERATED_QRC
|
||||||
${CMAKE_BINARY_DIR}/EffectEngine.qrc
|
${CMAKE_BINARY_DIR}/EffectEngine.qrc
|
||||||
)
|
)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_QRC}" )
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${GENERATED_QRC}")
|
||||||
|
|
||||||
# uninstall target
|
# uninstall target
|
||||||
configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
||||||
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||||
|
|
||||||
# enable make package - no code after this line !
|
# enable make package - no code after this line !
|
||||||
|
@ -16,6 +16,8 @@ BUILD_PACKAGES=true
|
|||||||
PACKAGES=""
|
PACKAGES=""
|
||||||
# platform string inserted to cmake cmd
|
# platform string inserted to cmake cmd
|
||||||
BUILD_PLATFORM=""
|
BUILD_PLATFORM=""
|
||||||
|
#Run build with Qt6 or Qt5
|
||||||
|
BUILD_WITH_QT5=false
|
||||||
#Run build using GitHub code files
|
#Run build using GitHub code files
|
||||||
BUILD_LOCAL=false
|
BUILD_LOCAL=false
|
||||||
#Build from scratch
|
#Build from scratch
|
||||||
@ -70,9 +72,10 @@ echo "########################################################
|
|||||||
# docker-compile.sh -a, --architecture # The output architecture, e.g., amd64, arm64, arm/v7
|
# docker-compile.sh -a, --architecture # The output architecture, e.g., amd64, arm64, arm/v7
|
||||||
# docker-compile.sh -b, --type # Release or Debug build
|
# docker-compile.sh -b, --type # Release or Debug build
|
||||||
# docker-compile.sh -p, --packages # If true, build packages with CPack
|
# docker-compile.sh -p, --packages # If true, build packages with CPack
|
||||||
|
# docker-compile.sh --qt5 # Build with Qt5, otherwise build with Qt6
|
||||||
|
# docker-compile.sh -f, --platform # cmake PLATFORM parameter, e.g. x11, amlogic-dev
|
||||||
# docker-compile.sh -l, --local # Run build using local code files
|
# docker-compile.sh -l, --local # Run build using local code files
|
||||||
# docker-compile.sh -c, --incremental # Run incremental build, i.e. do not delete files created during previous build
|
# docker-compile.sh -c, --incremental # Run incremental build, i.e. do not delete files created during previous build
|
||||||
# docker-compile.sh -f, --platform # cmake PLATFORM parameter, e.g. x11, amlogic-dev
|
|
||||||
# docker-compile.sh -v, --verbose # Run the script in verbose mode
|
# docker-compile.sh -v, --verbose # Run the script in verbose mode
|
||||||
# docker-compile.sh -- args # Additonal cmake arguments, e.g., -DHYPERION_LIGHT=ON
|
# docker-compile.sh -- args # Additonal cmake arguments, e.g., -DHYPERION_LIGHT=ON
|
||||||
# More informations to docker containers available at: https://github.com/Hyperion-Project/hyperion.docker-ci"
|
# More informations to docker containers available at: https://github.com/Hyperion-Project/hyperion.docker-ci"
|
||||||
@ -85,10 +88,10 @@ function log () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_distribution () {
|
function check_distribution () {
|
||||||
url=${REGISTRY_URL}/$1:${CODENAME}
|
url=${REGISTRY_URL}/$1:${CODENAME}
|
||||||
|
|
||||||
log "Check for distribution at: $url"
|
log "Check for distribution at: $url"
|
||||||
if $($DOCKER buildx imagetools inspect "$url" 2>&1 | grep -q $2) ; then
|
if $($DOCKER buildx imagetools inspect "$url" 2>&1 | grep -q $2) ; then
|
||||||
rc=0
|
rc=0
|
||||||
else
|
else
|
||||||
rc=1
|
rc=1
|
||||||
@ -97,47 +100,50 @@ function check_distribution () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Compile Hyperion using a Docker container"
|
echo "Compile Hyperion using a Docker container"
|
||||||
options=$(getopt -l "architecture:,name:,type:,packages:,platform:,local,incremental,verbose,help" -o "a:n:b:p:f:lcvh" -a -- "$@")
|
options=$(getopt -l "architecture:,name:,type:,packages:,platform:,qt5,local,incremental,verbose,help" -o "a:n:b:p:f:lcvh" -a -- "$@")
|
||||||
|
|
||||||
eval set -- "$options"
|
eval set -- "$options"
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
case $1 in
|
case $1 in
|
||||||
-a|--architecture)
|
-a|--architecture)
|
||||||
shift
|
shift
|
||||||
ARCHITECTURE=`echo $1 | tr '[:upper:]' '[:lower:]'`
|
ARCHITECTURE=`echo $1 | tr '[:upper:]' '[:lower:]'`
|
||||||
;;
|
;;
|
||||||
-n|--name)
|
-n|--name)
|
||||||
shift
|
shift
|
||||||
CODENAME=`echo $1 | tr '[:upper:]' '[:lower:]'`
|
CODENAME=`echo $1 | tr '[:upper:]' '[:lower:]'`
|
||||||
;;
|
;;
|
||||||
-b|--type)
|
-b|--type)
|
||||||
shift
|
shift
|
||||||
BUILD_TYPE=$1
|
BUILD_TYPE=$1
|
||||||
;;
|
;;
|
||||||
-p|--packages)
|
-p|--packages)
|
||||||
shift
|
shift
|
||||||
BUILD_PACKAGES=$1
|
BUILD_PACKAGES=$1
|
||||||
;;
|
;;
|
||||||
-f|--platform)
|
-f|--platform)
|
||||||
shift
|
shift
|
||||||
BUILD_PLATFORM=$1
|
BUILD_PLATFORM=$1
|
||||||
;;
|
;;
|
||||||
-l|--local)
|
--qt5)
|
||||||
|
BUILD_WITH_QT5=true
|
||||||
|
;;
|
||||||
|
-l|--local)
|
||||||
BUILD_LOCAL=true
|
BUILD_LOCAL=true
|
||||||
;;
|
;;
|
||||||
-i|--incremental)
|
-i|--incremental)
|
||||||
BUILD_INCREMENTAL=true
|
BUILD_INCREMENTAL=true
|
||||||
;;
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
_VERBOSE=1
|
_VERBOSE=1
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
printHelp
|
printHelp
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
break;;
|
break;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
@ -157,20 +163,26 @@ fi
|
|||||||
|
|
||||||
PLATFORM_ARCHITECTURE="linux/"${ARCHITECTURE}
|
PLATFORM_ARCHITECTURE="linux/"${ARCHITECTURE}
|
||||||
|
|
||||||
|
QTVERSION="5"
|
||||||
|
if [ ${BUILD_WITH_QT5} == false ]; then
|
||||||
|
QTVERSION="6"
|
||||||
|
CODENAME="${CODENAME}-qt6"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "---> Evaluate distribution for codename:${CODENAME} on platform architecture ${PLATFORM_ARCHITECTURE}"
|
echo "---> Evaluate distribution for codename:${CODENAME} on platform architecture ${PLATFORM_ARCHITECTURE}"
|
||||||
DISTRIBUTION="debian"
|
DISTRIBUTION="debian"
|
||||||
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
||||||
DISTRIBUTION="ubuntu"
|
DISTRIBUTION="ubuntu"
|
||||||
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
||||||
DISTRIBUTION="fedora"
|
DISTRIBUTION="fedora"
|
||||||
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
if ! check_distribution ${DISTRIBUTION} ${PLATFORM_ARCHITECTURE} ; then
|
||||||
echo "No docker image found for a distribution with codename: ${CODENAME} on platform architecture ${PLATFORM_ARCHITECTURE}"
|
echo "No docker image found for a distribution with codename: ${CODENAME} to be build on platform architecture ${PLATFORM_ARCHITECTURE}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "---> Build with -> Distribution: ${DISTRIBUTION}, Codename: ${CODENAME}, Architecture: ${ARCHITECTURE}, Type: ${BUILD_TYPE}, Platform: ${BUILD_PLATFORM}, Build Packages: ${BUILD_PACKAGES}, Build local: ${BUILD_LOCAL}, Build incremental: ${BUILD_INCREMENTAL}"
|
echo "---> Build with -> Distribution: ${DISTRIBUTION}, Codename: ${CODENAME}, Architecture: ${ARCHITECTURE}, Type: ${BUILD_TYPE}, Platform: ${BUILD_PLATFORM}, QT Version: ${QTVERSION}, Build Packages: ${BUILD_PACKAGES}, Build local: ${BUILD_LOCAL}, Build incremental: ${BUILD_INCREMENTAL}"
|
||||||
|
|
||||||
# Determine the current architecture
|
# Determine the current architecture
|
||||||
CURRENT_ARCHITECTURE=`uname -m`
|
CURRENT_ARCHITECTURE=`uname -m`
|
||||||
@ -182,33 +194,32 @@ if [ ${CURRENT_ARCHITECTURE} == "aarch64" ]; then
|
|||||||
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
|
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
|
||||||
if [ $IS_V7L -ne 0 ]; then
|
if [ $IS_V7L -ne 0 ]; then
|
||||||
USER_ARCHITECTURE="arm/v7"
|
USER_ARCHITECTURE="arm/v7"
|
||||||
else
|
else
|
||||||
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
|
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
|
||||||
if [ $IS_V6L -ne 0 ]; then
|
if [ $IS_V6L -ne 0 ]; then
|
||||||
USER_ARCHITECTURE="arm/v6"
|
USER_ARCHITECTURE="arm/v6"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
|
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
|
||||||
log "Identified user space current architecture: $USER_ARCHITECTURE"
|
log "Identified user space current architecture: $USER_ARCHITECTURE"
|
||||||
CURRENT_ARCHITECTURE=$USER_ARCHITECTURE
|
CURRENT_ARCHITECTURE=$USER_ARCHITECTURE
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
CURRENT_ARCHITECTURE=${CURRENT_ARCHITECTURE//x86_/amd}
|
CURRENT_ARCHITECTURE=${CURRENT_ARCHITECTURE//x86_/amd}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Identified kernel current architecture: $CURRENT_ARCHITECTURE"
|
log "Identified kernel current architecture: $CURRENT_ARCHITECTURE"
|
||||||
if [ $ARCHITECTURE != $CURRENT_ARCHITECTURE ]; then
|
if [ $ARCHITECTURE != $CURRENT_ARCHITECTURE ]; then
|
||||||
echo "---> Build is not for the same architecturem, install emulation environment for ${PLATFORM_ARCHITECTURE}"
|
echo "---> Build is not for the same architecturem, enable emulation for ${PLATFORM_ARCHITECTURE}"
|
||||||
$DOCKER run --privileged --rm tonistiigi/binfmt --install "${PLATFORM_ARCHITECTURE}"
|
ENTRYPOINT_OPTION=
|
||||||
DOCKERRC=${?}
|
|
||||||
|
if [ $CURRENT_ARCHITECTURE != "amd64" ]; then
|
||||||
if [ ${DOCKERRC} == 0 ]; then
|
echo "---> Emulation builds can only be executed on linux/amd64, linux/x86_64 platforms, current architecture is ${CURRENT_ARCHITECTURE}"
|
||||||
echo "---> Emulation environment installed sucessfully"
|
|
||||||
echo "---> You can uninstall it via following command: "docker run --privileged --rm tonistiigi/binfmt --uninstall ${PLATFORM_ARCHITECTURE}""
|
|
||||||
else
|
|
||||||
echo "---> Failed to install emulation environment"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
log "Build natively for platform architecture: ${PLATFORM_ARCHITECTURE}"
|
||||||
|
ENTRYPOINT_OPTION="--entrypoint="""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "---> BASE_PATH = ${BASE_PATH}"
|
log "---> BASE_PATH = ${BASE_PATH}"
|
||||||
@ -257,7 +268,8 @@ echo "---> Compiling Hyperion from source code at ${CODE_PATH}"
|
|||||||
# execute inside container all commands on bash
|
# execute inside container all commands on bash
|
||||||
|
|
||||||
echo "---> Startup docker..."
|
echo "---> Startup docker..."
|
||||||
$DOCKER run --rm --platform=${PLATFORM_ARCHITECTURE}\
|
$DOCKER run --rm --platform=${PLATFORM_ARCHITECTURE} \
|
||||||
|
${ENTRYPOINT_OPTION} \
|
||||||
-v "${DEPLOY_PATH}:/deploy" \
|
-v "${DEPLOY_PATH}:/deploy" \
|
||||||
-v "${CODE_PATH}/:/source:rw" \
|
-v "${CODE_PATH}/:/source:rw" \
|
||||||
${REGISTRY_URL}/${DISTRIBUTION}:${CODENAME} \
|
${REGISTRY_URL}/${DISTRIBUTION}:${CODENAME} \
|
||||||
|
@ -73,13 +73,13 @@ if [ ${ARCHITECTURE} == "aarch64" ]; then
|
|||||||
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
|
IS_V7L=`cat /proc/$$/maps |grep -m1 -c v7l`
|
||||||
if [ $IS_V7L -ne 0 ]; then
|
if [ $IS_V7L -ne 0 ]; then
|
||||||
USER_ARCHITECTURE="armv7l"
|
USER_ARCHITECTURE="armv7l"
|
||||||
else
|
else
|
||||||
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
|
IS_V6L=`cat /proc/$$/maps |grep -m1 -c v6l`
|
||||||
if [ $IS_V6L -ne 0 ]; then
|
if [ $IS_V6L -ne 0 ]; then
|
||||||
USER_ARCHITECTURE="armv6l"
|
USER_ARCHITECTURE="armv6l"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
|
if [ $ARCHITECTURE != $USER_ARCHITECTURE ]; then
|
||||||
echo "---> Identified kernel target architecture: $ARCHITECTURE"
|
echo "---> Identified kernel target architecture: $ARCHITECTURE"
|
||||||
echo "---> Identified user space target architecture: $USER_ARCHITECTURE"
|
echo "---> Identified user space target architecture: $USER_ARCHITECTURE"
|
||||||
ARCHITECTURE=$USER_ARCHITECTURE
|
ARCHITECTURE=$USER_ARCHITECTURE
|
||||||
@ -134,11 +134,11 @@ if [ -z "$run_id" ]; then
|
|||||||
# Determine run_id from head_sha
|
# Determine run_id from head_sha
|
||||||
runs=$(request_call "$api_url/actions/runs?head_sha=$head_sha")
|
runs=$(request_call "$api_url/actions/runs?head_sha=$head_sha")
|
||||||
run_id=$(echo "$runs" | tr '\r\n' ' ' | ${pythonCmd} -c """
|
run_id=$(echo "$runs" | tr '\r\n' ' ' | ${pythonCmd} -c """
|
||||||
import json,sys
|
import json,sys,os
|
||||||
data = json.load(sys.stdin)
|
data = json.load(sys.stdin)
|
||||||
|
|
||||||
for i in data['workflow_runs']:
|
for i in data['workflow_runs']:
|
||||||
if i['name'] == 'Hyperion PR Build':
|
if os.path.basename(i['path']) == 'push_pull.yml':
|
||||||
print(i['id'])
|
print(i['id'])
|
||||||
break
|
break
|
||||||
""" 2>/dev/null)
|
""" 2>/dev/null)
|
||||||
@ -198,11 +198,11 @@ if [[ ! -z ${CURRENT_SERVICE} ]]; then
|
|||||||
echo "---> Stop current service: ${CURRENT_SERVICE}"
|
echo "---> Stop current service: ${CURRENT_SERVICE}"
|
||||||
|
|
||||||
STOPCMD="systemctl stop --quiet ${CURRENT_SERVICE} --now"
|
STOPCMD="systemctl stop --quiet ${CURRENT_SERVICE} --now"
|
||||||
USERNAME=${SUDO_USER:-$(whoami)}
|
USERNAME=${SUDO_USER:-$(whoami)}
|
||||||
if [ ${USERNAME} != "root" ]; then
|
if [ ${USERNAME} != "root" ]; then
|
||||||
STOPCMD="sudo ${STOPCMD}"
|
STOPCMD="sudo ${STOPCMD}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${STOPCMD} >/dev/null 2>&1
|
${STOPCMD} >/dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "---> Critical Error: Failed to stop service: ${CURRENT_SERVICE}, Hyperion may not be started. Stop Hyperion manually."
|
echo "---> Critical Error: Failed to stop service: ${CURRENT_SERVICE}, Hyperion may not be started. Stop Hyperion manually."
|
||||||
|
@ -14,7 +14,7 @@ macro(DeployMacOS TARGET)
|
|||||||
install(CODE "set(PLUGIN_DIR \"${QT_PLUGIN_DIR}\")" COMPONENT "Hyperion")
|
install(CODE "set(PLUGIN_DIR \"${QT_PLUGIN_DIR}\")" COMPONENT "Hyperion")
|
||||||
install(CODE "set(BUILD_DIR \"${CMAKE_BINARY_DIR}\")" COMPONENT "Hyperion")
|
install(CODE "set(BUILD_DIR \"${CMAKE_BINARY_DIR}\")" COMPONENT "Hyperion")
|
||||||
install(CODE "set(ENABLE_EFFECTENGINE \"${ENABLE_EFFECTENGINE}\")" COMPONENT "Hyperion")
|
install(CODE "set(ENABLE_EFFECTENGINE \"${ENABLE_EFFECTENGINE}\")" COMPONENT "Hyperion")
|
||||||
|
|
||||||
install(CODE [[
|
install(CODE [[
|
||||||
|
|
||||||
file(GET_RUNTIME_DEPENDENCIES
|
file(GET_RUNTIME_DEPENDENCIES
|
||||||
@ -36,6 +36,7 @@ macro(DeployMacOS TARGET)
|
|||||||
FILES "${dependency}"
|
FILES "${dependency}"
|
||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
|
||||||
TYPE SHARED_LIBRARY
|
TYPE SHARED_LIBRARY
|
||||||
|
FOLLOW_SYMLINK_CHAIN
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
@ -48,7 +49,6 @@ macro(DeployMacOS TARGET)
|
|||||||
foreach(PLUGIN "platforms" "sqldrivers" "imageformats")
|
foreach(PLUGIN "platforms" "sqldrivers" "imageformats")
|
||||||
if(EXISTS ${PLUGIN_DIR}/${PLUGIN})
|
if(EXISTS ${PLUGIN_DIR}/${PLUGIN})
|
||||||
file(GLOB files "${PLUGIN_DIR}/${PLUGIN}/*")
|
file(GLOB files "${PLUGIN_DIR}/${PLUGIN}/*")
|
||||||
list(FILTER files EXCLUDE REGEX ".*libqwebp\\.dylib$")
|
|
||||||
foreach(file ${files})
|
foreach(file ${files})
|
||||||
file(GET_RUNTIME_DEPENDENCIES
|
file(GET_RUNTIME_DEPENDENCIES
|
||||||
EXECUTABLES ${file}
|
EXECUTABLES ${file}
|
||||||
@ -61,6 +61,7 @@ macro(DeployMacOS TARGET)
|
|||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
|
||||||
TYPE SHARED_LIBRARY
|
TYPE SHARED_LIBRARY
|
||||||
FILES ${DEPENDENCY}
|
FILES ${DEPENDENCY}
|
||||||
|
FOLLOW_SYMLINK_CHAIN
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@ -76,25 +77,27 @@ macro(DeployMacOS TARGET)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
include(BundleUtilities)
|
include(BundleUtilities)
|
||||||
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
|
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
|
||||||
|
|
||||||
if(ENABLE_EFFECTENGINE)
|
if(ENABLE_EFFECTENGINE)
|
||||||
|
|
||||||
# Detect the Python version and modules directory
|
# Detect the Python version and modules directory
|
||||||
find_package(Python3 3.5 REQUIRED)
|
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
|
||||||
execute_process(
|
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
|
||||||
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
|
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
|
||||||
OUTPUT_VARIABLE PYTHON_MODULES_DIR
|
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
else()
|
||||||
)
|
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||||
|
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
||||||
|
set(PYTHON_MODULES_DIR ${Python_STDLIB})
|
||||||
|
endif()
|
||||||
|
|
||||||
MESSAGE("Add Python ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} to bundle")
|
MESSAGE("Add Python ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} to bundle")
|
||||||
MESSAGE("PYTHON_MODULES_DIR: ${PYTHON_MODULES_DIR}")
|
MESSAGE("PYTHON_MODULES_DIR: ${PYTHON_MODULES_DIR}")
|
||||||
|
|
||||||
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
|
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
|
||||||
if (PYTHON_MODULES_DIR)
|
if (PYTHON_MODULES_DIR)
|
||||||
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
|
|
||||||
file(
|
file(
|
||||||
COPY ${PYTHON_MODULES_DIR}/
|
COPY ${PYTHON_MODULES_DIR}/
|
||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
|
||||||
@ -167,9 +170,9 @@ macro(DeployLinux TARGET)
|
|||||||
|
|
||||||
# Extract dependencies ignoring the system ones
|
# Extract dependencies ignoring the system ones
|
||||||
get_prerequisites(${TARGET_FILE} DEPENDENCIES 0 1 "" "")
|
get_prerequisites(${TARGET_FILE} DEPENDENCIES 0 1 "" "")
|
||||||
|
|
||||||
message(STATUS "Dependencies for target file: ${DEPENDENCIES}")
|
message(STATUS "Dependencies for target file: ${DEPENDENCIES}")
|
||||||
|
|
||||||
# Append symlink and non-symlink dependencies to the list
|
# Append symlink and non-symlink dependencies to the list
|
||||||
set(PREREQUISITE_LIBS "")
|
set(PREREQUISITE_LIBS "")
|
||||||
foreach(DEPENDENCY ${DEPENDENCIES})
|
foreach(DEPENDENCY ${DEPENDENCIES})
|
||||||
@ -276,15 +279,13 @@ macro(DeployLinux TARGET)
|
|||||||
if(ENABLE_EFFECTENGINE)
|
if(ENABLE_EFFECTENGINE)
|
||||||
# Detect the Python version and modules directory
|
# Detect the Python version and modules directory
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
||||||
|
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
|
||||||
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
|
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
|
||||||
set(PYTHON_MODULES_DIR "${Python3_STDLIB}")
|
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
|
||||||
else()
|
else()
|
||||||
|
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
|
||||||
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
||||||
execute_process(
|
set(PYTHON_MODULES_DIR ${Python_STDLIB})
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
|
|
||||||
OUTPUT_VARIABLE PYTHON_MODULES_DIR
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
|
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
|
||||||
@ -381,19 +382,25 @@ macro(DeployWindows TARGET)
|
|||||||
list(GET openssl_versions 0 openssl_version_major)
|
list(GET openssl_versions 0 openssl_version_major)
|
||||||
list(GET openssl_versions 1 openssl_version_minor)
|
list(GET openssl_versions 1 openssl_version_minor)
|
||||||
|
|
||||||
set(library_suffix "-${openssl_version_major}_${openssl_version_minor}")
|
set(open_ssl_version_suffix)
|
||||||
|
if (openssl_version_major VERSION_EQUAL 1 AND openssl_version_minor VERSION_EQUAL 1)
|
||||||
|
set(open_ssl_version_suffix "-1_1")
|
||||||
|
else()
|
||||||
|
set(open_ssl_version_suffix "-3")
|
||||||
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
string(APPEND library_suffix "-x64")
|
string(APPEND open_ssl_version_suffix "-x64")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_file(OPENSSL_SSL
|
find_file(OPENSSL_SSL
|
||||||
NAMES "libssl${library_suffix}.dll"
|
NAMES "libssl${open_ssl_version_suffix}.dll"
|
||||||
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
|
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
find_file(OPENSSL_CRYPTO
|
find_file(OPENSSL_CRYPTO
|
||||||
NAMES "libcrypto${library_suffix}.dll"
|
NAMES "libcrypto${open_ssl_version_suffix}.dll"
|
||||||
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
|
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
@ -19,4 +19,10 @@ find_package_handle_standard_args(qmdnsengine
|
|||||||
REQUIRED_VARS QMDNS_INCLUDE_DIR QMDNS_LIBRARIES
|
REQUIRED_VARS QMDNS_INCLUDE_DIR QMDNS_LIBRARIES
|
||||||
)
|
)
|
||||||
|
|
||||||
mark_as_advanced(QMDNS_INCLUDE_DIR QMDNS_LIBRARIES)
|
if(QMDNSENGINE_FOUND)
|
||||||
|
add_library(qmdnsengine STATIC IMPORTED GLOBAL)
|
||||||
|
set_target_properties(qmdnsengine PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${QMDNS_LIBRARIES}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${QMDNS_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
# process a .rc file for windows
|
|
||||||
# Provides (BINARY_NAME)_WIN_RC_PATH with path to generated file
|
|
||||||
function(generate_win_rc_file BINARY_NAME)
|
|
||||||
# target path to store generated files
|
|
||||||
set(TARGET_PATH ${CMAKE_BINARY_DIR}/win_rc_file/${BINARY_NAME})
|
|
||||||
# assets
|
|
||||||
string(REPLACE "/" "\\\\" WIN_RC_ICON_PATH ${CMAKE_SOURCE_DIR}/cmake/nsis/installer.ico)
|
|
||||||
# configure the rc file
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_SOURCE_DIR}/cmake/win/win.rc.in
|
|
||||||
${TARGET_PATH}/win.rc
|
|
||||||
)
|
|
||||||
# provide var for parent scope
|
|
||||||
set(${BINARY_NAME}_WIN_RC_PATH ${TARGET_PATH}/win.rc PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
11
debian/control.in
vendored
11
debian/control.in
vendored
@ -1,11 +0,0 @@
|
|||||||
Source: hyperion
|
|
||||||
Section: devel
|
|
||||||
Priority: optional
|
|
||||||
Standards-Version: @STANDARDS_VERSION@
|
|
||||||
Maintainer: Hyperion Project <admin@hyperion-project.org>
|
|
||||||
Homepage: https://hyperion-project.org/
|
|
||||||
|
|
||||||
Package: hyperion
|
|
||||||
Architecture: @ARCHITECTURE@
|
|
||||||
Depends: ${dist:Depends}
|
|
||||||
Description: Hyperion is an opensource Bias or Ambient Lighting implementation which you might know from TV manufactures. It supports many LED devices and video grabbers.
|
|
67
debian/distributions
vendored
67
debian/distributions
vendored
@ -1,67 +0,0 @@
|
|||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Codename: focal
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Codename: jammy
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Codename: lunar
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Codename: mantic
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Suite: oldstable
|
|
||||||
Codename: buster
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Suite: stable
|
|
||||||
Codename: bullseye
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Suite: unstable
|
|
||||||
Codename: bookworm
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
||||||
|
|
||||||
Origin: Hyperion-Project
|
|
||||||
Label: apt.hyperion-project.org
|
|
||||||
Suite: testing
|
|
||||||
Codename: trixie
|
|
||||||
Architectures: amd64 armhf arm64
|
|
||||||
Components: main
|
|
||||||
Description: Official APT Repository by Hyperion Project
|
|
||||||
SignWith: yes
|
|
58
debian/rules
vendored
58
debian/rules
vendored
@ -1,58 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
SHELL := /bin/bash
|
|
||||||
|
|
||||||
BUILDDIR := build
|
|
||||||
TARGET := debian/tmp
|
|
||||||
|
|
||||||
# libcec currently not linked in hyperion therefore not recognizable but hardcoded in FIND_DEPENDS
|
|
||||||
REQUIRED_DEPS := libusb libasound libmbedtls libturbojpeg libcec
|
|
||||||
QT5_DEPS := libqt5widgets5,libqt5x11extras5,libqt5sql5,libqt5serialport5,libqt5sql5-sqlite,
|
|
||||||
|
|
||||||
FIND_DEPENDS = $(shell \
|
|
||||||
PACKAGES=(); \
|
|
||||||
PACKAGES+=("$$(dpkg -S "libcec.so" 2>/dev/null | cut -d : -f 1 | sed '/-dev/d' | head -1)"); \
|
|
||||||
for SHARED_LIB in $$(objdump -p $(BUILDDIR)/bin/hyperiond | awk '/NEEDED/{ print $$2 }'); do \
|
|
||||||
PACKAGES+=("$$(dpkg -S $$(basename "$$SHARED_LIB") 2>/dev/null | cut -d : -f 1 | sed '/-dev/d' | head -1)"); \
|
|
||||||
done; \
|
|
||||||
RESULT=(); \
|
|
||||||
for LIB in $(REQUIRED_DEPS); do \
|
|
||||||
for i in "$${PACKAGES[@]}"; do \
|
|
||||||
if [[ $$i = *"$$LIB"* ]]; then \
|
|
||||||
RESULT+=("$$i"); \
|
|
||||||
break; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
done; \
|
|
||||||
printf '%s,' "$${RESULT[@]}" \
|
|
||||||
)
|
|
||||||
|
|
||||||
CMAKE_ENVIRONMENT := -DUSE_SYSTEM_MBEDTLS_LIBS=ON -DENABLE_DEPLOY_DEPENDENCIES=OFF -DCMAKE_BUILD_TYPE=Release
|
|
||||||
|
|
||||||
ifeq ($(shell dpkg-vendor --query Vendor),Ubuntu)
|
|
||||||
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),arm64)
|
|
||||||
CMAKE_ENVIRONMENT+= -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON
|
|
||||||
else ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),armhf)
|
|
||||||
CMAKE_ENVIRONMENT+= -DENABLE_DISPMANX=OFF -DENABLE_X11=ON -DENABLE_XCB=ON
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
build:
|
|
||||||
[ -d $(BUILDDIR) ] || mkdir -p $(BUILDDIR)
|
|
||||||
cd $(BUILDDIR); cmake $(CMAKE_ENVIRONMENT) -DCMAKE_INSTALL_PREFIX=../$(TARGET)/usr ..
|
|
||||||
make -j$(shell nproc) -C $(BUILDDIR)
|
|
||||||
|
|
||||||
binary:
|
|
||||||
$(eval DETERMINED_DEPS=$(FIND_DEPENDS))
|
|
||||||
cd $(BUILDDIR); cmake -P cmake_install.cmake
|
|
||||||
rm -rf $(TARGET)/usr/include $(TARGET)/usr/lib $(TARGET)/usr/bin/flatc
|
|
||||||
[ -d $(TARGET)/DEBIAN ] || mkdir -p $(TARGET)/DEBIAN
|
|
||||||
cp -rf cmake/package-scripts/* $(TARGET)/DEBIAN/
|
|
||||||
chmod 0775 $(TARGET)/DEBIAN/*
|
|
||||||
dpkg-gencontrol -phyperion "-Vdist:Depends=$(QT5_DEPS)$(DETERMINED_DEPS)"
|
|
||||||
dpkg-deb --build $(TARGET) ..
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(TARGET) $(BUILDDIR)
|
|
||||||
|
|
||||||
.PHONY: build binary clean
|
|
26
dependencies/CMakeLists-qmdnsengine.txt.in
vendored
26
dependencies/CMakeLists-qmdnsengine.txt.in
vendored
@ -1,26 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
|
|
||||||
project(qmdnsengine)
|
|
||||||
|
|
||||||
set(WORK_DIR "@QMDNS_WORK_DIR@")
|
|
||||||
set(SOURCE_DIR "@QMDNS_SOURCE_DIR@")
|
|
||||||
set(INSTALL_DIR "@QMDNS_INSTALL_DIR@")
|
|
||||||
set(CMAKE_ARGS "@QMDNS_CMAKE_ARGS@")
|
|
||||||
set(QMDNS_LOGGING "@QMDNS_LOGGING@")
|
|
||||||
|
|
||||||
include(ExternalProject)
|
|
||||||
|
|
||||||
ExternalProject_Add(qmdnsengine
|
|
||||||
PREFIX ${WORK_DIR}
|
|
||||||
BUILD_ALWAYS OFF
|
|
||||||
DOWNLOAD_COMMAND ""
|
|
||||||
SOURCE_DIR ${SOURCE_DIR}
|
|
||||||
INSTALL_DIR ${INSTALL_DIR}
|
|
||||||
CMAKE_ARGS ${CMAKE_ARGS}
|
|
||||||
LOG_DOWNLOAD ${QMDNS_LOGGING}
|
|
||||||
LOG_UPDATE ${QMDNS_LOGGING}
|
|
||||||
LOG_CONFIGURE ${QMDNS_LOGGING}
|
|
||||||
LOG_BUILD ${QMDNS_LOGGING}
|
|
||||||
LOG_INSTALL ${QMDNS_LOGGING}
|
|
||||||
LOG_TEST ${QMDNS_LOGGING}
|
|
||||||
)
|
|
72
dependencies/CMakeLists.txt
vendored
72
dependencies/CMakeLists.txt
vendored
@ -24,46 +24,46 @@ if (ENABLE_MDNS)
|
|||||||
if (USE_SYSTEM_QMDNS_LIBS)
|
if (USE_SYSTEM_QMDNS_LIBS)
|
||||||
find_package(qmdnsengine REQUIRED)
|
find_package(qmdnsengine REQUIRED)
|
||||||
else ()
|
else ()
|
||||||
if (NOT DEFINED BUILD_QMDNS_ONCE)
|
|
||||||
set(BUILD_QMDNS_ONCE CACHE INTERNAL "Done")
|
|
||||||
set(QMDNS_WORK_DIR "${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine")
|
|
||||||
set(QMDNS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/qmdnsengine")
|
|
||||||
set(QMDNS_INSTALL_DIR ${CMAKE_BINARY_DIR})
|
|
||||||
set(QMDNS_CMAKE_ARGS
|
|
||||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
|
|
||||||
-DBIN_INSTALL_DIR:STRING=lib
|
|
||||||
-DLIB_INSTALL_DIR:STRING=lib
|
|
||||||
-DINCLUDE_INSTALL_DIR:STRING=include
|
|
||||||
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
|
|
||||||
-Wno-dev
|
|
||||||
)
|
|
||||||
|
|
||||||
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} EQUAL "Debug")
|
|
||||||
set(QMDNS_LOGGING 1)
|
|
||||||
else ()
|
|
||||||
set(QMDNS_LOGGING 0)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/dependencies/CMakeLists-qmdnsengine.txt.in ${QMDNS_WORK_DIR}/CMakeLists.txt @ONLY)
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . WORKING_DIRECTORY ${QMDNS_WORK_DIR})
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} --build . --config "${CMAKE_BUILD_TYPE}" WORKING_DIRECTORY ${QMDNS_WORK_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(QMDNS_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include")
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
|
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
else()
|
else()
|
||||||
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
|
set(QMDNS_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}qmdnsengine${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced (QMDNS_INCLUDE_DIR QMDNS_LIBRARIES)
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
endif ()
|
set(QMDNS_CMAKE_ARGS
|
||||||
|
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||||
|
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}
|
||||||
|
-DBIN_INSTALL_DIR:STRING=lib
|
||||||
|
-DLIB_INSTALL_DIR:STRING=lib
|
||||||
|
-DINCLUDE_INSTALL_DIR:STRING=include
|
||||||
|
-DCMAKE_PREFIX_PATH:PATH=${CMAKE_PREFIX_PATH}
|
||||||
|
$<$<NOT:$<BOOL:${isMultiConfig}>>:-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}>
|
||||||
|
-Wno-dev
|
||||||
|
)
|
||||||
|
|
||||||
set(QMDNS_INCLUDE_DIR ${QMDNS_INCLUDE_DIR} PARENT_SCOPE)
|
include(ExternalProject)
|
||||||
set(QMDNS_LIBRARIES ${QMDNS_LIBRARIES} PARENT_SCOPE)
|
ExternalProject_Add(qmdns
|
||||||
include_directories(${QMDNS_INCLUDE_DIR})
|
PREFIX ${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine
|
||||||
|
BUILD_ALWAYS OFF
|
||||||
|
DOWNLOAD_COMMAND ""
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/qmdnsengine
|
||||||
|
BINARY_DIR ${CMAKE_BINARY_DIR}/dependencies/external/qmdnsengine/build
|
||||||
|
CMAKE_ARGS ${QMDNS_CMAKE_ARGS}
|
||||||
|
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S <SOURCE_DIR> -B <BINARY_DIR> ${QMDNS_CMAKE_ARGS} -G ${CMAKE_GENERATOR}
|
||||||
|
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG>
|
||||||
|
INSTALL_DIR ${CMAKE_BINARY_DIR}
|
||||||
|
BUILD_BYPRODUCTS ${QMDNS_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(qmdnsengine STATIC IMPORTED GLOBAL)
|
||||||
|
set_target_properties(qmdnsengine PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${QMDNS_LIBRARIES}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(qmdnsengine qmdns)
|
||||||
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@ -143,9 +143,9 @@ endif()
|
|||||||
|
|
||||||
if(ENABLE_PROTOBUF_SERVER)
|
if(ENABLE_PROTOBUF_SERVER)
|
||||||
set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")
|
set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")
|
||||||
|
|
||||||
# defines for 3rd party sub-modules
|
# defines for 3rd party sub-modules
|
||||||
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Build abseil-cpp with C++ version requirements propagated")
|
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "Build abseil-cpp with C++ version requirements propagated")
|
||||||
|
|
||||||
if (USE_SYSTEM_PROTO_LIBS)
|
if (USE_SYSTEM_PROTO_LIBS)
|
||||||
find_package(Protobuf REQUIRED)
|
find_package(Protobuf REQUIRED)
|
||||||
@ -173,7 +173,7 @@ if(ENABLE_PROTOBUF_SERVER)
|
|||||||
|
|
||||||
# define the protobuf library
|
# define the protobuf library
|
||||||
set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
|
set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# redefine at parent scope
|
# redefine at parent scope
|
||||||
|
2
dependencies/external/mbedtls
vendored
2
dependencies/external/mbedtls
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 1873d3bfc2da771672bd8e7e8f41f57e0af77f33
|
Subproject commit edb8fec9882084344a314368ac7fd957a187519c
|
2
dependencies/external/rpi_ws281x
vendored
2
dependencies/external/rpi_ws281x
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 1f47b59ed603223d1376d36c788c89af67ae2fdc
|
Subproject commit 49086d3913367d2fb014a615f9d958a47867bc39
|
@ -1,93 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#ifndef __APPLE__
|
|
||||||
|
|
||||||
/*
|
|
||||||
* this is a mock up for compiling and testing osx wrapper on no osx platform.
|
|
||||||
* this will show a test image and rotate the colors.
|
|
||||||
*
|
|
||||||
* see https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.8.sdk/System/Library/Frameworks/CoreGraphics.framework/Versions/A/Headers
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <utils/Image.h>
|
|
||||||
#include <utils/ColorRgb.h>
|
|
||||||
|
|
||||||
enum _CGError {
|
|
||||||
kCGErrorSuccess = 0,
|
|
||||||
kCGErrorFailure = 1000,
|
|
||||||
kCGErrorIllegalArgument = 1001,
|
|
||||||
kCGErrorInvalidConnection = 1002,
|
|
||||||
kCGErrorInvalidContext = 1003,
|
|
||||||
kCGErrorCannotComplete = 1004,
|
|
||||||
kCGErrorNotImplemented = 1006,
|
|
||||||
kCGErrorRangeCheck = 1007,
|
|
||||||
kCGErrorTypeCheck = 1008,
|
|
||||||
kCGErrorInvalidOperation = 1010,
|
|
||||||
kCGErrorNoneAvailable = 1011,
|
|
||||||
|
|
||||||
/* Obsolete errors. */
|
|
||||||
kCGErrorNameTooLong = 1005,
|
|
||||||
kCGErrorNoCurrentPoint = 1009,
|
|
||||||
kCGErrorApplicationRequiresNewerSystem = 1015,
|
|
||||||
kCGErrorApplicationNotPermittedToExecute = 1016,
|
|
||||||
kCGErrorApplicationIncorrectExecutableFormatFound = 1023,
|
|
||||||
kCGErrorApplicationIsLaunching = 1024,
|
|
||||||
kCGErrorApplicationAlreadyRunning = 1025,
|
|
||||||
kCGErrorApplicationCanOnlyBeRunInOneSessionAtATime = 1026,
|
|
||||||
kCGErrorClassicApplicationsMustBeLaunchedByClassic = 1027,
|
|
||||||
kCGErrorForkFailed = 1028,
|
|
||||||
kCGErrorRetryRegistration = 1029,
|
|
||||||
kCGErrorFirst = 1000,
|
|
||||||
kCGErrorLast = 1029
|
|
||||||
};
|
|
||||||
typedef int32_t CGError;
|
|
||||||
typedef double CGFloat;
|
|
||||||
|
|
||||||
struct CGSize {
|
|
||||||
CGFloat width;
|
|
||||||
CGFloat height;
|
|
||||||
};
|
|
||||||
typedef struct CGSize CGSize;
|
|
||||||
|
|
||||||
struct CGPoint {
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
};
|
|
||||||
typedef struct CGPoint CGPoint;
|
|
||||||
|
|
||||||
struct CGRect {
|
|
||||||
CGPoint origin;
|
|
||||||
CGSize size;
|
|
||||||
};
|
|
||||||
typedef struct CGRect CGRect;
|
|
||||||
|
|
||||||
typedef CGError CGDisplayErr;
|
|
||||||
typedef uint32_t CGDirectDisplayID;
|
|
||||||
typedef uint32_t CGDisplayCount;;
|
|
||||||
typedef struct CGDisplayMode *CGDisplayModeRef;
|
|
||||||
|
|
||||||
typedef Image<ColorRgb> CGImage;
|
|
||||||
typedef CGImage* CGImageRef;
|
|
||||||
typedef unsigned char CFData;
|
|
||||||
typedef CFData* CFDataRef;
|
|
||||||
|
|
||||||
const int kCGDirectMainDisplay = 0;
|
|
||||||
|
|
||||||
CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount);
|
|
||||||
CGDisplayModeRef CGDisplayCopyDisplayMode(CGDirectDisplayID display);
|
|
||||||
CGRect CGDisplayBounds(CGDirectDisplayID display);
|
|
||||||
void CGDisplayModeRelease(CGDisplayModeRef mode);
|
|
||||||
|
|
||||||
CGImageRef CGDisplayCreateImage(CGDirectDisplayID display);
|
|
||||||
void CGImageRelease(CGImageRef image);
|
|
||||||
CGImageRef CGImageGetDataProvider(CGImageRef image);
|
|
||||||
CFDataRef CGDataProviderCopyData(CGImageRef image);
|
|
||||||
unsigned char* CFDataGetBytePtr(CFDataRef imgData);
|
|
||||||
unsigned CGImageGetWidth(CGImageRef image);
|
|
||||||
unsigned CGImageGetHeight(CGImageRef image);
|
|
||||||
unsigned CGImageGetBitsPerPixel(CGImageRef image);
|
|
||||||
unsigned CGImageGetBytesPerRow(CGImageRef image);
|
|
||||||
void CFRelease(CFDataRef imgData);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -4,7 +4,7 @@
|
|||||||
#include <utils/ColorBgr.h>
|
#include <utils/ColorBgr.h>
|
||||||
#include <utils/ColorRgba.h>
|
#include <utils/ColorRgba.h>
|
||||||
#include <hyperion/Grabber.h>
|
#include <hyperion/Grabber.h>
|
||||||
#include <grabber/FramebufferFrameGrabber.h>
|
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/AmlogicGrabber.h>
|
#include <grabber/amlogic/AmlogicGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The Amlogic uses an instance of the AmlogicGrabber to obtain ImageRgb's from the
|
/// The Amlogic uses an instance of the AmlogicGrabber to obtain ImageRgb's from the
|
@ -6,7 +6,7 @@
|
|||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
|
|
||||||
// Hyperion-utils includes
|
// Hyperion-utils includes
|
||||||
#include <grabber/AudioGrabber.h>
|
#include <grabber/audio/AudioGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// @brief The Linux Audio capture implementation
|
/// @brief The Linux Audio capture implementation
|
@ -2,7 +2,7 @@
|
|||||||
#define AUDIOGRABBERWINDOWS_H
|
#define AUDIOGRABBERWINDOWS_H
|
||||||
|
|
||||||
// Hyperion-utils includes
|
// Hyperion-utils includes
|
||||||
#include <grabber/AudioGrabber.h>
|
#include <grabber/audio/AudioGrabber.h>
|
||||||
#include <DSound.h>
|
#include <DSound.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -14,7 +14,7 @@ class AudioGrabberWindows : public AudioGrabber
|
|||||||
|
|
||||||
AudioGrabberWindows();
|
AudioGrabberWindows();
|
||||||
~AudioGrabberWindows() override;
|
~AudioGrabberWindows() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool start() override;
|
bool start() override;
|
||||||
void stop() override;
|
void stop() override;
|
@ -3,14 +3,14 @@
|
|||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <grabber/AudioGrabberWindows.h>
|
#include <grabber/audio/AudioGrabberWindows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <grabber/AudioGrabberLinux.h>
|
#include <grabber/audio/AudioGrabberLinux.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Audio Grabber wrapper
|
/// Audio Grabber wrapper
|
||||||
///
|
///
|
||||||
class AudioWrapper : public GrabberWrapper
|
class AudioWrapper : public GrabberWrapper
|
||||||
@ -32,7 +32,7 @@ class AudioWrapper : public GrabberWrapper
|
|||||||
///
|
///
|
||||||
~AudioWrapper() override;
|
~AudioWrapper() override;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Settings update handler
|
/// Settings update handler
|
||||||
///
|
///
|
||||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
|
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
|
||||||
@ -43,13 +43,13 @@ class AudioWrapper : public GrabberWrapper
|
|||||||
///
|
///
|
||||||
void action() override;
|
void action() override;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Start audio capturing session
|
/// Start audio capturing session
|
||||||
///
|
///
|
||||||
/// @returns true if successful
|
/// @returns true if successful
|
||||||
bool start() override;
|
bool start() override;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Stop audio capturing session
|
/// Stop audio capturing session
|
||||||
///
|
///
|
||||||
void stop() override;
|
void stop() override;
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/DirectXGrabber.h>
|
#include <grabber/directx/DirectXGrabber.h>
|
||||||
|
|
||||||
class DirectXWrapper: public GrabberWrapper
|
class DirectXWrapper: public GrabberWrapper
|
||||||
{
|
{
|
@ -3,7 +3,7 @@
|
|||||||
// Utils includes
|
// Utils includes
|
||||||
#include <utils/ColorRgba.h>
|
#include <utils/ColorRgba.h>
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/DispmanxFrameGrabber.h>
|
#include <grabber/dispmanx/DispmanxFrameGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain ImageRgb's from the
|
/// The DispmanxWrapper uses an instance of the DispmanxFrameGrabber to obtain ImageRgb's from the
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/FramebufferFrameGrabber.h>
|
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The FramebufferWrapper uses an instance of the FramebufferFrameGrabber to obtain ImageRgb's from the
|
/// The FramebufferWrapper uses an instance of the FramebufferFrameGrabber to obtain ImageRgb's from the
|
@ -1,11 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// OSX includes
|
// OSX includes
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <CoreGraphics/CoreGraphics.h>
|
#include <CoreGraphics/CoreGraphics.h>
|
||||||
#else
|
|
||||||
#include <grabber/OsxFrameGrabberMock.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Utils includes
|
// Utils includes
|
||||||
#include <utils/ColorRgb.h>
|
#include <utils/ColorRgb.h>
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/OsxFrameGrabber.h>
|
#include <grabber/osx/OsxFrameGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The OsxWrapper uses an instance of the OsxFrameGrabber to obtain ImageRgb's from the displayed content.
|
/// The OsxWrapper uses an instance of the OsxFrameGrabber to obtain ImageRgb's from the displayed content.
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/QtGrabber.h>
|
#include <grabber/qt/QtGrabber.h>
|
||||||
|
|
||||||
///
|
///
|
||||||
/// The QtWrapper uses QtFramework API's to get a picture from system
|
/// The QtWrapper uses QtFramework API's to get a picture from system
|
@ -4,9 +4,9 @@
|
|||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
|
|
||||||
#if defined(ENABLE_MF)
|
#if defined(ENABLE_MF)
|
||||||
#include <grabber/MFGrabber.h>
|
#include <grabber/video/mediafoundation/MFGrabber.h>
|
||||||
#elif defined(ENABLE_V4L2)
|
#elif defined(ENABLE_V4L2)
|
||||||
#include <grabber/V4L2Grabber.h>
|
#include <grabber/video/v4l2/V4L2Grabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_CEC)
|
#if defined(ENABLE_CEC)
|
@ -21,7 +21,7 @@
|
|||||||
#include <hyperion/Grabber.h>
|
#include <hyperion/Grabber.h>
|
||||||
|
|
||||||
// decoder thread includes
|
// decoder thread includes
|
||||||
#include <grabber/EncoderThread.h>
|
#include <grabber/video/EncoderThread.h>
|
||||||
|
|
||||||
/// Forward class declaration
|
/// Forward class declaration
|
||||||
class SourceReaderCB;
|
class SourceReaderCB;
|
@ -19,7 +19,7 @@
|
|||||||
#include <utils/Components.h>
|
#include <utils/Components.h>
|
||||||
|
|
||||||
// decoder thread includes
|
// decoder thread includes
|
||||||
#include <grabber/EncoderThread.h>
|
#include <grabber/video/EncoderThread.h>
|
||||||
|
|
||||||
// Determine the cmake options
|
// Determine the cmake options
|
||||||
#include <HyperionConfig.h>
|
#include <HyperionConfig.h>
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/X11Grabber.h>
|
#include <grabber/x11/X11Grabber.h>
|
||||||
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
||||||
#ifdef None
|
#ifdef None
|
||||||
#undef None
|
#undef None
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/XcbGrabber.h>
|
#include <grabber/xcb/XcbGrabber.h>
|
||||||
|
|
||||||
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
||||||
#ifdef None
|
#ifdef None
|
@ -3,9 +3,8 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
namespace Process {
|
namespace Process
|
||||||
|
{
|
||||||
void restartHyperion(int exitCode = 0);
|
void restartHyperion(int exitCode = 0);
|
||||||
QByteArray command_exec(const QString& cmd, const QByteArray& data = {});
|
QByteArray command_exec(const QString& cmd, const QByteArray& data = {});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
# Define the current source locations
|
# Define the current source locations
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
|
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
|
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
|
||||||
|
|
||||||
add_subdirectory(hyperion)
|
add_subdirectory(hyperion)
|
||||||
add_subdirectory(commandline)
|
add_subdirectory(commandline)
|
||||||
@ -34,7 +34,7 @@ add_subdirectory(ssdp)
|
|||||||
|
|
||||||
if(ENABLE_MDNS)
|
if(ENABLE_MDNS)
|
||||||
add_subdirectory(mdns)
|
add_subdirectory(mdns)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_EFFECTENGINE)
|
if(ENABLE_EFFECTENGINE)
|
||||||
add_subdirectory(effectengine)
|
add_subdirectory(effectengine)
|
||||||
|
@ -1,26 +1,20 @@
|
|||||||
# Define the current source locations
|
|
||||||
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/api)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/api)
|
|
||||||
|
|
||||||
FILE ( GLOB_RECURSE Api_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
set(Api_RESOURCES ${CURRENT_SOURCE_DIR}/JSONRPC_schemas.qrc )
|
|
||||||
|
|
||||||
add_library(hyperion-api
|
add_library(hyperion-api
|
||||||
${Api_SOURCES}
|
${CMAKE_SOURCE_DIR}/include/api/apiStructs.h
|
||||||
${Api_RESOURCES}
|
${CMAKE_SOURCE_DIR}/include/api/API.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/api/JsonAPI.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/api/JsonCB.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/api/JsonAPI.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/api/API.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/api/JsonCB.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/api/JSONRPC_schemas.qrc
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_DX)
|
|
||||||
include_directories(${DIRECTX9_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(hyperion-api ${DIRECTX9_LIBRARIES})
|
|
||||||
endif(ENABLE_DX)
|
|
||||||
|
|
||||||
target_link_libraries(hyperion-api
|
target_link_libraries(hyperion-api
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
${DIRECTX9_LIBRARIES}
|
||||||
Qt${QT_VERSION_MAJOR}::Gui
|
)
|
||||||
Qt${QT_VERSION_MAJOR}::Network
|
|
||||||
|
target_include_directories(hyperion-api PRIVATE
|
||||||
|
${DIRECTX9_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
@ -19,54 +19,54 @@
|
|||||||
#include <HyperionConfig.h> // Required to determine the cmake options
|
#include <HyperionConfig.h> // Required to determine the cmake options
|
||||||
|
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <grabber/QtGrabber.h>
|
#include <grabber/qt/QtGrabber.h>
|
||||||
|
|
||||||
#include <utils/WeakConnect.h>
|
#include <utils/WeakConnect.h>
|
||||||
|
|
||||||
#if defined(ENABLE_MF)
|
#if defined(ENABLE_MF)
|
||||||
#include <grabber/MFGrabber.h>
|
#include <grabber/video/mediafoundation/MFGrabber.h>
|
||||||
#elif defined(ENABLE_V4L2)
|
#elif defined(ENABLE_V4L2)
|
||||||
#include <grabber/V4L2Grabber.h>
|
#include <grabber/video/v4l2/V4L2Grabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_AUDIO)
|
#if defined(ENABLE_AUDIO)
|
||||||
#include <grabber/AudioGrabber.h>
|
#include <grabber/audio/AudioGrabber.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <grabber/AudioGrabberWindows.h>
|
#include <grabber/audio/AudioGrabberWindows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <grabber/AudioGrabberLinux.h>
|
#include <grabber/audio/AudioGrabberLinux.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_X11)
|
#if defined(ENABLE_X11)
|
||||||
#include <grabber/X11Grabber.h>
|
#include <grabber/x11/X11Grabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_XCB)
|
#if defined(ENABLE_XCB)
|
||||||
#include <grabber/XcbGrabber.h>
|
#include <grabber/xcb/XcbGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_DX)
|
#if defined(ENABLE_DX)
|
||||||
#include <grabber/DirectXGrabber.h>
|
#include <grabber/directx/DirectXGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_FB)
|
#if defined(ENABLE_FB)
|
||||||
#include <grabber/FramebufferFrameGrabber.h>
|
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_DISPMANX)
|
#if defined(ENABLE_DISPMANX)
|
||||||
#include <grabber/DispmanxFrameGrabber.h>
|
#include <grabber/dispmanx/DispmanxFrameGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_AMLOGIC)
|
#if defined(ENABLE_AMLOGIC)
|
||||||
#include <grabber/AmlogicGrabber.h>
|
#include <grabber/amlogic/AmlogicGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_OSX)
|
#if defined(ENABLE_OSX)
|
||||||
#include <grabber/OsxFrameGrabber.h>
|
#include <grabber/osx/OsxFrameGrabber.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <utils/jsonschema/QJsonFactory.h>
|
#include <utils/jsonschema/QJsonFactory.h>
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
|
add_library(blackborder
|
||||||
# Define the current source locations
|
${CMAKE_SOURCE_DIR}/include/blackborder/BlackBorderDetector.h
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/blackborder)
|
${CMAKE_SOURCE_DIR}/include/blackborder/BlackBorderProcessor.h
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/blackborder)
|
${CMAKE_SOURCE_DIR}/libsrc/blackborder/BlackBorderDetector.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/blackborder/BlackBorderProcessor.cpp
|
||||||
FILE ( GLOB Blackborder_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
)
|
||||||
|
|
||||||
add_library(blackborder ${Blackborder_SOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(blackborder
|
target_link_libraries(blackborder
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
|
add_library(boblightserver
|
||||||
# Define the current source locations
|
${CMAKE_SOURCE_DIR}/include/boblightserver/BoblightServer.h
|
||||||
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/boblightserver)
|
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightServer.cpp
|
||||||
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/boblightserver)
|
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightClientConnection.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/boblightserver/BoblightClientConnection.cpp
|
||||||
FILE ( GLOB BoblightServer_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
)
|
||||||
|
|
||||||
add_library(boblightserver ${BoblightServer_SOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(boblightserver
|
target_link_libraries(boblightserver
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
${QT_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
@ -1,19 +1,18 @@
|
|||||||
# Define the current source locations
|
|
||||||
find_package(CEC REQUIRED)
|
find_package(CEC REQUIRED)
|
||||||
|
if(CEC_FOUND)
|
||||||
|
list(GET CEC_LIBRARIES 0 CEC_LIBRARIES)
|
||||||
|
add_definitions(-DCEC_LIBRARY="${CEC_LIBRARIES}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "libCEC not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/cec)
|
add_library(cechandler
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/cec)
|
${CMAKE_SOURCE_DIR}/include/cec/CECEvent.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/cec/CECHandler.h
|
||||||
FILE (GLOB CEC_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
|
${CMAKE_SOURCE_DIR}/libsrc/cec/CECHandler.cpp
|
||||||
|
)
|
||||||
add_library(cechandler ${CEC_SOURCES})
|
|
||||||
list(GET CEC_LIBRARIES 0 CEC_LIBRARIES)
|
|
||||||
add_definitions(-DCEC_LIBRARY="${CEC_LIBRARIES}")
|
|
||||||
|
|
||||||
include_directories(${CEC_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
target_link_libraries(cechandler
|
target_link_libraries(cechandler
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
Qt${QT_VERSION_MAJOR}::Core
|
||||||
${CMAKE_DL_LIBS}
|
${CMAKE_DL_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,10 +1,27 @@
|
|||||||
# Define the current source locations
|
add_library(commandline
|
||||||
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/commandline)
|
${CMAKE_SOURCE_DIR}/include/commandline/BooleanOption.h
|
||||||
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/commandline)
|
${CMAKE_SOURCE_DIR}/include/commandline/ColorOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/ColorsOption.h
|
||||||
FILE ( GLOB Parser_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/include/commandline/DoubleOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/ImageOption.h
|
||||||
add_library(commandline ${Parser_SOURCES} )
|
${CMAKE_SOURCE_DIR}/include/commandline/IntOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/Option.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/Parser.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/RegularExpressionOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/SwitchOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/commandline/ValidatorOption.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/BooleanOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/ColorOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/ColorsOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/DoubleOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/ImageOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/IntOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/Option.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/Parser.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/RegularExpressionOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/SwitchOption.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/commandline/ValidatorOption.cpp
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(commandline
|
target_link_libraries(commandline
|
||||||
hyperion
|
hyperion
|
||||||
|
@ -14,19 +14,22 @@ bool Parser::parse(const QStringList &arguments)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Option * option : _options)
|
for(Option * option : std::as_const(_options))
|
||||||
{
|
{
|
||||||
QString value = this->value(*option);
|
if (!option->valueName().isEmpty())
|
||||||
if (!option->validate(*this, value)) {
|
{
|
||||||
const QString error = option->getError();
|
QString value = this->value(*option);
|
||||||
if (!error.isEmpty()) {
|
if (!option->validate(*this, value)) {
|
||||||
_errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error);
|
const QString error = option->getError();
|
||||||
|
if (!error.isEmpty()) {
|
||||||
|
_errorText = tr("\"%1\" is not a valid option for %2, %3").arg(value, option->name(), error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_errorText = tr("\"%1\" is not a valid option for %2").arg(value, option->name());
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
# Define the current source locations
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/db)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/db)
|
|
||||||
|
|
||||||
FILE ( GLOB DB_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
add_library(database
|
add_library(database
|
||||||
${DB_SOURCES}
|
${CMAKE_SOURCE_DIR}/include/db/AuthTable.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/db/DBManager.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/db/InstanceTable.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/db/MetaTable.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/db/SettingsTable.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/db/DBManager.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(database
|
target_link_libraries(database
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
|
||||||
Qt${QT_VERSION_MAJOR}::Sql
|
Qt${QT_VERSION_MAJOR}::Sql
|
||||||
)
|
)
|
||||||
|
@ -1,47 +1,30 @@
|
|||||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
file(GLOB effectFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/effects/*)
|
||||||
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
|
set(HYPERION_EFFECTS_RES "")
|
||||||
else()
|
foreach(f ${effectFiles})
|
||||||
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake
|
get_filename_component(fname ${f} NAME)
|
||||||
endif()
|
set(HYPERION_EFFECTS_RES "${HYPERION_EFFECTS_RES}\n\t\t<file alias=\"/effects/${fname}\">${f}</file>")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Include the python directory. Also include the parent (which is for example /usr/include)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/EffectEngine.qrc.in ${CMAKE_BINARY_DIR}/EffectEngine.qrc)
|
||||||
# which may be required when it is not includes by the (cross-) compiler by default.
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
|
||||||
include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..)
|
|
||||||
else()
|
|
||||||
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Define the current source locations
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/effectengine)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/effectengine)
|
|
||||||
|
|
||||||
FILE ( GLOB EffectEngineSOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
FILE ( GLOB effectFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/effects/* )
|
|
||||||
|
|
||||||
SET ( HYPERION_EFFECTS_RES "")
|
|
||||||
FOREACH( f ${effectFiles} )
|
|
||||||
GET_FILENAME_COMPONENT(fname ${f} NAME)
|
|
||||||
SET(HYPERION_EFFECTS_RES "${HYPERION_EFFECTS_RES}\n\t\t<file alias=\"/effects/${fname}\">${f}</file>")
|
|
||||||
ENDFOREACH()
|
|
||||||
CONFIGURE_FILE(${CURRENT_SOURCE_DIR}/EffectEngine.qrc.in ${CMAKE_BINARY_DIR}/EffectEngine.qrc )
|
|
||||||
|
|
||||||
SET(EffectEngine_RESOURCES ${CMAKE_BINARY_DIR}/EffectEngine.qrc)
|
|
||||||
|
|
||||||
add_library(effectengine
|
add_library(effectengine
|
||||||
${EffectEngine_RESOURCES}
|
${CMAKE_BINARY_DIR}/EffectEngine.qrc
|
||||||
${EffectEngineSOURCES}
|
${CMAKE_SOURCE_DIR}/include/effectengine/ActiveEffectDefinition.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/Effect.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/EffectDefinition.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/EffectEngine.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/EffectFileHandler.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/EffectModule.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/effectengine/EffectSchema.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/effectengine/Effect.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectEngine.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectFileHandler.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/effectengine/EffectModule.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(effectengine
|
target_link_libraries(effectengine
|
||||||
hyperion
|
|
||||||
python
|
python
|
||||||
|
hyperion
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
Qt${QT_VERSION_MAJOR}::Core
|
||||||
Qt${QT_VERSION_MAJOR}::Gui
|
Qt${QT_VERSION_MAJOR}::Gui
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
|
|
||||||
target_link_libraries( effectengine ${Python3_LIBRARIES} )
|
|
||||||
else()
|
|
||||||
target_link_libraries( effectengine ${PYTHON_LIBRARIES} )
|
|
||||||
endif()
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file alias="effect-schema">${CURRENT_SOURCE_DIR}/EffectDefinition.schema.json</file>
|
<file alias="effect-schema">${CMAKE_CURRENT_SOURCE_DIR}/EffectDefinition.schema.json</file>
|
||||||
${HYPERION_EFFECTS_RES}
|
${HYPERION_EFFECTS_RES}
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -1,69 +1,54 @@
|
|||||||
|
# set (compiled) Flatbuffer schema names
|
||||||
|
set(FBS_Request "hyperion_request")
|
||||||
|
set(FBS_Reply "hyperion_reply")
|
||||||
|
|
||||||
# Define the current source locations
|
# define and compile flatbuffer schemas
|
||||||
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/flatbufserver)
|
list(APPEND Compiled_FBS ${FBS_Request}_generated.h)
|
||||||
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/flatbufserver)
|
list(APPEND Compiled_FBS ${FBS_Reply}_generated.h)
|
||||||
|
compile_flattbuffer_schema(${CMAKE_CURRENT_SOURCE_DIR}/${FBS_Request}.fbs ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
include_directories(
|
compile_flattbuffer_schema(${CMAKE_CURRENT_SOURCE_DIR}/${FBS_Reply}.fbs ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
${FLATBUFFERS_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
set(Flatbuffer_GENERATED_FBS
|
|
||||||
hyperion_reply_generated.h
|
|
||||||
hyperion_request_generated.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(Flatbuffer_FBS
|
|
||||||
${CURRENT_SOURCE_DIR}/hyperion_reply.fbs
|
|
||||||
${CURRENT_SOURCE_DIR}/hyperion_request.fbs
|
|
||||||
)
|
|
||||||
FOREACH(FBS_FILE ${Flatbuffer_FBS})
|
|
||||||
compile_flattbuffer_schema(${FBS_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
ENDFOREACH(FBS_FILE)
|
|
||||||
|
|
||||||
# let cmake know about new generated source files
|
# let cmake know about new generated source files
|
||||||
set_source_files_properties(
|
set_source_files_properties(${Compiled_FBS} PROPERTIES GENERATED TRUE)
|
||||||
${Flatbuffer_GENERATED_FBS} PROPERTIES GENERATED TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
### Split flatbufconnect from flatbufserver as flatbufserver relates to HyperionDaemon
|
|
||||||
|
|
||||||
|
# split flatbufconnect from flatbufserver as flatbufserver relates to HyperionDaemon
|
||||||
if(ENABLE_FLATBUF_CONNECT)
|
if(ENABLE_FLATBUF_CONNECT)
|
||||||
add_library(flatbufconnect
|
add_library(flatbufconnect
|
||||||
${CURRENT_HEADER_DIR}/FlatBufferConnection.h
|
${CMAKE_SOURCE_DIR}/include/flatbufserver/FlatBufferConnection.h
|
||||||
${CURRENT_SOURCE_DIR}/FlatBufferConnection.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferConnection.cpp
|
||||||
${FLATBUFSERVER_SOURCES}
|
${Compiled_FBS}
|
||||||
${Flatbuffer_GENERATED_FBS}
|
)
|
||||||
|
|
||||||
)
|
target_link_libraries(flatbufconnect
|
||||||
target_link_libraries(flatbufconnect
|
hyperion-utils
|
||||||
hyperion-utils
|
flatbuffers
|
||||||
flatbuffers
|
)
|
||||||
Qt${QT_VERSION_MAJOR}::Network
|
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
target_include_directories(flatbufconnect PUBLIC
|
||||||
)
|
${FLATBUFFERS_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_FLATBUF_SERVER)
|
if(ENABLE_FLATBUF_SERVER)
|
||||||
add_library(flatbufserver
|
add_library(flatbufserver
|
||||||
${CURRENT_HEADER_DIR}/FlatBufferServer.h
|
${CMAKE_SOURCE_DIR}/include/flatbufserver/FlatBufferServer.h
|
||||||
${CURRENT_SOURCE_DIR}/FlatBufferServer.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferServer.cpp
|
||||||
${CURRENT_SOURCE_DIR}/FlatBufferClient.h
|
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferClient.h
|
||||||
${CURRENT_SOURCE_DIR}/FlatBufferClient.cpp
|
${CMAKE_SOURCE_DIR}/libsrc/flatbufserver/FlatBufferClient.cpp
|
||||||
${FLATBUFSERVER_SOURCES}
|
${Compiled_FBS}
|
||||||
${Flatbuffer_GENERATED_FBS}
|
)
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(flatbufserver
|
target_link_libraries(flatbufserver
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
flatbuffers
|
flatbuffers
|
||||||
Qt${QT_VERSION_MAJOR}::Network
|
)
|
||||||
Qt${QT_VERSION_MAJOR}::Core
|
|
||||||
)
|
|
||||||
|
|
||||||
if(ENABLE_MDNS)
|
|
||||||
target_link_libraries(flatbufserver mdns)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
target_include_directories(flatbufserver PUBLIC
|
||||||
|
${FLATBUFFERS_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(ENABLE_MDNS)
|
||||||
|
target_link_libraries(flatbufserver mdns)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,22 +1,11 @@
|
|||||||
|
add_library(forwarder
|
||||||
# Define the current source locations
|
${CMAKE_SOURCE_DIR}/include/forwarder/MessageForwarder.h
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/forwarder)
|
${CMAKE_SOURCE_DIR}/libsrc/forwarder/MessageForwarder.cpp
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/forwarder)
|
|
||||||
|
|
||||||
if(ENABLE_FLATBUF_CONNECT)
|
|
||||||
include_directories(
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
|
|
||||||
FILE ( GLOB Forwarder_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
add_library(forwarder ${Forwarder_SOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(forwarder
|
target_link_libraries(forwarder
|
||||||
hyperion
|
hyperion
|
||||||
hyperion-utils
|
hyperion-utils
|
||||||
${QT_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_FLATBUF_CONNECT)
|
if(ENABLE_FLATBUF_CONNECT)
|
||||||
|
@ -1,39 +1,39 @@
|
|||||||
if (ENABLE_AMLOGIC)
|
if(ENABLE_AMLOGIC)
|
||||||
add_subdirectory(amlogic)
|
add_subdirectory(amlogic)
|
||||||
endif (ENABLE_AMLOGIC)
|
endif (ENABLE_AMLOGIC)
|
||||||
|
|
||||||
if (ENABLE_DISPMANX)
|
if(ENABLE_DISPMANX)
|
||||||
add_subdirectory(dispmanx)
|
add_subdirectory(dispmanx)
|
||||||
endif (ENABLE_DISPMANX)
|
endif (ENABLE_DISPMANX)
|
||||||
|
|
||||||
if (ENABLE_FB)
|
if(ENABLE_FB)
|
||||||
add_subdirectory(framebuffer)
|
add_subdirectory(framebuffer)
|
||||||
endif (ENABLE_FB)
|
endif (ENABLE_FB)
|
||||||
|
|
||||||
if (ENABLE_OSX)
|
if(ENABLE_OSX)
|
||||||
add_subdirectory(osx)
|
add_subdirectory(osx)
|
||||||
endif(ENABLE_OSX)
|
endif(ENABLE_OSX)
|
||||||
|
|
||||||
if (ENABLE_V4L2 OR ENABLE_MF)
|
if(ENABLE_V4L2 OR ENABLE_MF)
|
||||||
add_subdirectory(video)
|
add_subdirectory(video)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_X11)
|
if(ENABLE_X11)
|
||||||
add_subdirectory(x11)
|
add_subdirectory(x11)
|
||||||
endif(ENABLE_X11)
|
endif(ENABLE_X11)
|
||||||
|
|
||||||
if (ENABLE_XCB)
|
if(ENABLE_XCB)
|
||||||
add_subdirectory(xcb)
|
add_subdirectory(xcb)
|
||||||
endif(ENABLE_XCB)
|
endif(ENABLE_XCB)
|
||||||
|
|
||||||
if (ENABLE_QT)
|
if(ENABLE_QT)
|
||||||
add_subdirectory(qt)
|
add_subdirectory(qt)
|
||||||
endif(ENABLE_QT)
|
endif(ENABLE_QT)
|
||||||
|
|
||||||
if (ENABLE_DX)
|
if(ENABLE_DX)
|
||||||
add_subdirectory(directx)
|
add_subdirectory(directx)
|
||||||
endif(ENABLE_DX)
|
endif(ENABLE_DX)
|
||||||
|
|
||||||
if (ENABLE_AUDIO)
|
if(ENABLE_AUDIO)
|
||||||
add_subdirectory(audio)
|
add_subdirectory(audio)
|
||||||
endif()
|
endif()
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
// Local includes
|
// Local includes
|
||||||
#include <utils/Logger.h>
|
#include <utils/Logger.h>
|
||||||
#include <grabber/AmlogicGrabber.h>
|
#include <grabber/amlogic/AmlogicGrabber.h>
|
||||||
#include "Amvideocap.h"
|
#include "Amvideocap.h"
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/AmlogicWrapper.h>
|
#include <grabber/amlogic/AmlogicWrapper.h>
|
||||||
|
|
||||||
AmlogicWrapper::AmlogicWrapper(int pixelDecimation, int updateRate_Hz)
|
AmlogicWrapper::AmlogicWrapper(int pixelDecimation, int updateRate_Hz)
|
||||||
: GrabberWrapper("Amlogic", &_grabber, updateRate_Hz)
|
: GrabberWrapper("Amlogic", &_grabber, updateRate_Hz)
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
INCLUDE (CheckIncludeFiles)
|
add_library(amlogic-grabber
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/amlogic/AmlogicGrabber.h
|
||||||
# Define the current source locations
|
${CMAKE_SOURCE_DIR}/include/grabber/amlogic/AmlogicWrapper.h
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/AmlogicGrabber.cpp
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic)
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/AmlogicWrapper.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/Amvideocap.h
|
||||||
FILE ( GLOB AmlogicSOURCES "${CURRENT_HEADER_DIR}/Amlogic*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/ion.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/meson_ion.h
|
||||||
add_library(amlogic-grabber ${AmlogicSOURCES} )
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/IonBuffer.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/amlogic/IonBuffer.cpp
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(amlogic-grabber
|
target_link_libraries(amlogic-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES})
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/AudioGrabber.h>
|
#include <grabber/audio/AudioGrabber.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/AudioGrabberLinux.h>
|
#include <grabber/audio/AudioGrabberLinux.h>
|
||||||
|
|
||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/AudioGrabberWindows.h>
|
#include <grabber/audio/AudioGrabberWindows.h>
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
notificationSize -= notificationSize % audioFormat.nBlockAlign;
|
notificationSize -= notificationSize % audioFormat.nBlockAlign;
|
||||||
|
|
||||||
bufferCaptureSize = notificationSize * AUDIO_NOTIFICATION_COUNT;
|
bufferCaptureSize = notificationSize * AUDIO_NOTIFICATION_COUNT;
|
||||||
|
|
||||||
DSCBUFFERDESC bufferDesc;
|
DSCBUFFERDESC bufferDesc;
|
||||||
bufferDesc.dwSize = sizeof(DSCBUFFERDESC);
|
bufferDesc.dwSize = sizeof(DSCBUFFERDESC);
|
||||||
bufferDesc.dwFlags = 0;
|
bufferDesc.dwFlags = 0;
|
||||||
@ -80,7 +80,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
bufferDesc.lpwfxFormat = &audioFormat;
|
bufferDesc.lpwfxFormat = &audioFormat;
|
||||||
bufferDesc.dwFXCount = 0;
|
bufferDesc.dwFXCount = 0;
|
||||||
bufferDesc.lpDSCFXDesc = NULL;
|
bufferDesc.lpDSCFXDesc = NULL;
|
||||||
|
|
||||||
// Create Capture Device's Buffer
|
// Create Capture Device's Buffer
|
||||||
LPDIRECTSOUNDCAPTUREBUFFER preBuffer;
|
LPDIRECTSOUNDCAPTUREBUFFER preBuffer;
|
||||||
if (FAILED(recordingDevice->CreateCaptureBuffer(&bufferDesc, &preBuffer, NULL)))
|
if (FAILED(recordingDevice->CreateCaptureBuffer(&bufferDesc, &preBuffer, NULL)))
|
||||||
@ -101,7 +101,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
}
|
}
|
||||||
|
|
||||||
preBuffer->Release();
|
preBuffer->Release();
|
||||||
|
|
||||||
// Create Notifications
|
// Create Notifications
|
||||||
LPDIRECTSOUNDNOTIFY8 notify;
|
LPDIRECTSOUNDNOTIFY8 notify;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
recordingBuffer->Release();
|
recordingBuffer->Release();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Events
|
// Create Events
|
||||||
notificationEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
notificationEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
@ -133,11 +133,11 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
positionNotify[i].dwOffset = (notificationSize * i) + notificationSize - 1;
|
positionNotify[i].dwOffset = (notificationSize * i) + notificationSize - 1;
|
||||||
positionNotify[i].hEventNotify = notificationEvent;
|
positionNotify[i].hEventNotify = notificationEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Notifications
|
// Set Notifications
|
||||||
notify->SetNotificationPositions(AUDIO_NOTIFICATION_COUNT, positionNotify);
|
notify->SetNotificationPositions(AUDIO_NOTIFICATION_COUNT, positionNotify);
|
||||||
notify->Release();
|
notify->Release();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,12 +162,12 @@ bool AudioGrabberWindows::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Info(_log, "Capture audio from %s", QSTRING_CSTR(getDeviceName(_device)));
|
Info(_log, "Capture audio from %s", QSTRING_CSTR(getDeviceName(_device)));
|
||||||
|
|
||||||
if (!this->configureCaptureInterface())
|
if (!this->configureCaptureInterface())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(recordingBuffer->Start(DSCBSTART_LOOPING)))
|
if (FAILED(recordingBuffer->Start(DSCBSTART_LOOPING)))
|
||||||
{
|
{
|
||||||
Error(_log, "Failed starting audio capture from '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
Error(_log, "Failed starting audio capture from '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
||||||
@ -214,7 +214,7 @@ void AudioGrabberWindows::stop()
|
|||||||
{
|
{
|
||||||
Error(_log, "Audio capture failed to stop: '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
Error(_log, "Audio capture failed to stop: '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(recordingBuffer->Release()))
|
if (FAILED(recordingBuffer->Release()))
|
||||||
{
|
{
|
||||||
Error(_log, "Failed to release recording buffer: '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
Error(_log, "Failed to release recording buffer: '%s'", QSTRING_CSTR(getDeviceName(_device)));
|
||||||
@ -306,7 +306,7 @@ void AudioGrabberWindows::processAudioBuffer()
|
|||||||
|
|
||||||
// Buffer wrapped around, read second position
|
// Buffer wrapped around, read second position
|
||||||
if (capturedAudio2 != NULL)
|
if (capturedAudio2 != NULL)
|
||||||
{
|
{
|
||||||
bufferCapturePosition += capturedAudio2Length;
|
bufferCapturePosition += capturedAudio2Length;
|
||||||
bufferCapturePosition %= bufferCaptureSize; // Circular Buffer
|
bufferCapturePosition %= bufferCaptureSize; // Circular Buffer
|
||||||
}
|
}
|
||||||
@ -318,13 +318,13 @@ void AudioGrabberWindows::processAudioBuffer()
|
|||||||
{
|
{
|
||||||
CopyMemory(readBuffer + capturedAudioLength, capturedAudio2, capturedAudio2Length);
|
CopyMemory(readBuffer + capturedAudioLength, capturedAudio2, capturedAudio2Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Release Buffer Lock
|
// Release Buffer Lock
|
||||||
recordingBuffer->Unlock(capturedAudio, capturedAudioLength, capturedAudio2, capturedAudio2Length);
|
recordingBuffer->Unlock(capturedAudio, capturedAudioLength, capturedAudio2, capturedAudio2Length);
|
||||||
|
|
||||||
// Process Audio Frame
|
// Process Audio Frame
|
||||||
this->processAudioFrame(readBuffer, frameSize);
|
this->processAudioFrame(readBuffer, frameSize);
|
||||||
|
|
||||||
delete[] readBuffer;
|
delete[] readBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/AudioWrapper.h>
|
#include <grabber/audio/AudioWrapper.h>
|
||||||
#include <hyperion/GrabberWrapper.h>
|
#include <hyperion/GrabberWrapper.h>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
@ -1,35 +1,38 @@
|
|||||||
# Define the current source locations
|
if(WIN32)
|
||||||
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
|
add_definitions(-DUNICODE -D_UNICODE)
|
||||||
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/audio )
|
set(AUDIO_GRABBER_SOURCES
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabberWindows.h
|
||||||
if (WIN32)
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabberWindows.cpp
|
||||||
add_definitions(-DUNICODE -D_UNICODE)
|
)
|
||||||
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Windows.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Windows.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
elseif(CMAKE_HOST_UNIX AND NOT APPLE)
|
||||||
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
|
set(AUDIO_GRABBER_SOURCES
|
||||||
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Linux.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Linux.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabberLinux.h
|
||||||
elseif (APPLE)
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabberLinux.cpp
|
||||||
#TODO
|
)
|
||||||
#FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Apple.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Apple.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library( audio-grabber ${AUDIO_GRABBER_SOURCES} )
|
add_library(audio-grabber
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioGrabber.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/audio/AudioWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioGrabber.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/audio/AudioWrapper.cpp
|
||||||
|
${AUDIO_GRABBER_SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
set(AUDIO_LIBS hyperion)
|
if(WIN32)
|
||||||
|
set(AUDIO_LIBS DSound)
|
||||||
|
elseif(CMAKE_HOST_UNIX AND NOT APPLE)
|
||||||
if (WIN32)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
set(AUDIO_LIBS ${AUDIO_LIBS} DSound)
|
find_package(ALSA REQUIRED)
|
||||||
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
|
find_package(Threads REQUIRED)
|
||||||
find_package(ALSA REQUIRED)
|
set(AUDIO_LIBS ${ALSA_LIBRARIES} Threads::Threads)
|
||||||
if (ALSA_FOUND)
|
|
||||||
include_directories(${ALSA_INCLUDE_DIRS})
|
|
||||||
set(AUDIO_LIBS ${AUDIO_LIBS} ${ALSA_LIBRARIES})
|
|
||||||
endif(ALSA_FOUND)
|
|
||||||
|
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
set(AUDIO_LIBS ${AUDIO_LIBS} Threads::Threads) # PRIVATE
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(audio-grabber
|
||||||
|
hyperion
|
||||||
|
${AUDIO_LIBS}
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(audio-grabber ${AUDIO_LIBS} ${QT_LIBRARIES})
|
if(CMAKE_HOST_UNIX AND NOT APPLE)
|
||||||
|
target_include_directories(audio-grabber PUBLIC ${ALSA_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
# Define the current source locations
|
find_package(DirectX9 REQUIRED)
|
||||||
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
|
|
||||||
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/directx )
|
|
||||||
|
|
||||||
include_directories(${DIRECTX9_INCLUDE_DIRS})
|
add_library(directx-grabber
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/directx/DirectXGrabber.h
|
||||||
FILE ( GLOB DIRECTX_GRAB_SOURCES "${CURRENT_HEADER_DIR}/DirectX*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/include/grabber/directx/DirectXWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/directx/DirectXGrabber.cpp
|
||||||
add_library( directx-grabber ${DIRECTX_GRAB_SOURCES} )
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/directx/DirectXWrapper.cpp
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(directx-grabber
|
target_link_libraries(directx-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${DIRECTX9_LIBRARIES}
|
${DIRECTX9_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(directx-grabber PUBLIC
|
||||||
|
${DIRECTX9_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <grabber/DirectXGrabber.h>
|
#include <grabber/directx/DirectXGrabber.h>
|
||||||
|
|
||||||
#pragma comment(lib, "d3d9.lib")
|
#pragma comment(lib, "d3d9.lib")
|
||||||
#pragma comment(lib,"d3dx9.lib")
|
#pragma comment(lib,"d3dx9.lib")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/DirectXWrapper.h>
|
#include <grabber/directx/DirectXWrapper.h>
|
||||||
|
|
||||||
DirectXWrapper::DirectXWrapper( int updateRate_Hz,
|
DirectXWrapper::DirectXWrapper( int updateRate_Hz,
|
||||||
int display,
|
int display,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Find the BCM-package (VC control)
|
# Find the BCM-package (VC control)
|
||||||
if( "${PLATFORM}" MATCHES rpi)
|
if("${PLATFORM}" MATCHES rpi)
|
||||||
find_package(BCM)
|
find_package(BCM)
|
||||||
if(BCM_FOUND)
|
if(BCM_FOUND)
|
||||||
add_definitions(-DBCM_FOUND)
|
add_definitions(-DBCM_FOUND)
|
||||||
@ -9,21 +9,20 @@ else()
|
|||||||
set(BCM_LIBRARY "")
|
set(BCM_LIBRARY "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Define the current source locations
|
add_library(dispmanx-grabber
|
||||||
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
${CMAKE_SOURCE_DIR}/include/grabber/dispmanx/DispmanxFrameGrabber.h
|
||||||
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx)
|
${CMAKE_SOURCE_DIR}/include/grabber/dispmanx/DispmanxWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx/DispmanxFrameGrabber.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx/DispmanxWrapper.cpp
|
||||||
|
)
|
||||||
|
|
||||||
FILE ( GLOB DispmanxGrabberSOURCES "${CURRENT_HEADER_DIR}/Dispmanx*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
add_library(dispmanx-grabber ${DispmanxGrabberSOURCES})
|
|
||||||
add_definitions(-DBCM_LIBRARY="${BCM_LIBRARY}")
|
add_definitions(-DBCM_LIBRARY="${BCM_LIBRARY}")
|
||||||
|
|
||||||
|
target_link_libraries(dispmanx-grabber
|
||||||
|
hyperion
|
||||||
|
${CMAKE_DL_LIBS}
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(dispmanx-grabber PUBLIC
|
target_include_directories(dispmanx-grabber PUBLIC
|
||||||
${BCM_INCLUDE_DIR}
|
${BCM_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(dispmanx-grabber
|
|
||||||
hyperion
|
|
||||||
${QT_LIBRARIES}
|
|
||||||
${CMAKE_DL_LIBS}
|
|
||||||
)
|
|
||||||
|
@ -16,7 +16,7 @@ namespace {
|
|||||||
} //End of constants
|
} //End of constants
|
||||||
|
|
||||||
// Local includes
|
// Local includes
|
||||||
#include "grabber/DispmanxFrameGrabber.h"
|
#include "grabber/dispmanx/DispmanxFrameGrabber.h"
|
||||||
|
|
||||||
DispmanxFrameGrabber::DispmanxFrameGrabber()
|
DispmanxFrameGrabber::DispmanxFrameGrabber()
|
||||||
: Grabber("DISPMANXGRABBER")
|
: Grabber("DISPMANXGRABBER")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/DispmanxWrapper.h>
|
#include <grabber/dispmanx/DispmanxWrapper.h>
|
||||||
|
|
||||||
DispmanxWrapper::DispmanxWrapper( int updateRate_Hz,
|
DispmanxWrapper::DispmanxWrapper( int updateRate_Hz,
|
||||||
int pixelDecimation
|
int pixelDecimation
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
# Define the current source locations
|
add_library(framebuffer-grabber
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
${CMAKE_SOURCE_DIR}/include/grabber/framebuffer/FramebufferFrameGrabber.h
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer)
|
${CMAKE_SOURCE_DIR}/include/grabber/framebuffer/FramebufferWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer/FramebufferFrameGrabber.cpp
|
||||||
FILE ( GLOB FramebufferGrabberSOURCES "${CURRENT_HEADER_DIR}/Framebuffer*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/framebuffer/FramebufferWrapper.cpp
|
||||||
|
)
|
||||||
add_library(framebuffer-grabber ${FramebufferGrabberSOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(framebuffer-grabber
|
target_link_libraries(framebuffer-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES})
|
)
|
||||||
|
@ -28,7 +28,7 @@ const char DISCOVERY_FILEPATTERN[] = "fb?";
|
|||||||
} //End of constants
|
} //End of constants
|
||||||
|
|
||||||
// Local includes
|
// Local includes
|
||||||
#include <grabber/FramebufferFrameGrabber.h>
|
#include <grabber/framebuffer/FramebufferFrameGrabber.h>
|
||||||
|
|
||||||
FramebufferFrameGrabber::FramebufferFrameGrabber(const QString & device)
|
FramebufferFrameGrabber::FramebufferFrameGrabber(const QString & device)
|
||||||
: Grabber("FRAMEBUFFERGRABBER")
|
: Grabber("FRAMEBUFFERGRABBER")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/FramebufferWrapper.h>
|
#include <grabber/framebuffer/FramebufferWrapper.h>
|
||||||
|
|
||||||
FramebufferWrapper::FramebufferWrapper( int updateRate_Hz,
|
FramebufferWrapper::FramebufferWrapper( int updateRate_Hz,
|
||||||
const QString & device,
|
const QString & device,
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
# Define the current source locations
|
add_library(osx-grabber
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
${CMAKE_SOURCE_DIR}/include/grabber/osx/OsxFrameGrabber.h
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/osx)
|
${CMAKE_SOURCE_DIR}/include/grabber/osx/OsxWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/osx/OsxFrameGrabber.cpp
|
||||||
FILE ( GLOB OsxGrabberSOURCES "${CURRENT_HEADER_DIR}/Osx*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/osx/OsxWrapper.cpp
|
||||||
|
)
|
||||||
add_library(osx-grabber ${OsxGrabberSOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(osx-grabber
|
target_link_libraries(osx-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES})
|
)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Local includes
|
// Local includes
|
||||||
#include <grabber/OsxFrameGrabber.h>
|
#include <grabber/osx/OsxFrameGrabber.h>
|
||||||
|
|
||||||
//Qt
|
//Qt
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
@ -1,159 +0,0 @@
|
|||||||
#ifndef __APPLE__
|
|
||||||
#include <grabber/OsxFrameGrabberMock.h>
|
|
||||||
|
|
||||||
unsigned __osx_frame_counter = 0;
|
|
||||||
const int __screenWidth = 800;
|
|
||||||
const int __screenHeight = 600;
|
|
||||||
|
|
||||||
CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID *activeDisplays, uint32_t *displayCount)
|
|
||||||
{
|
|
||||||
if (maxDisplays == 0 || activeDisplays == nullptr)
|
|
||||||
{
|
|
||||||
*displayCount = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
displayCount = &maxDisplays;
|
|
||||||
if (activeDisplays != nullptr)
|
|
||||||
{
|
|
||||||
for (CGDirectDisplayID i = 0; i < maxDisplays; ++i)
|
|
||||||
{
|
|
||||||
activeDisplays[i] = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return kCGErrorFailure;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return kCGErrorSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGImageRef CGDisplayCreateImage(CGDirectDisplayID display)
|
|
||||||
{
|
|
||||||
CGImageRef image = new CGImage(__screenWidth / (display+1), __screenHeight / (display+1));
|
|
||||||
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGImageRelease(CGImageRef image)
|
|
||||||
{
|
|
||||||
delete image;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGImageRef CGImageGetDataProvider(CGImageRef image)
|
|
||||||
{
|
|
||||||
__osx_frame_counter++;
|
|
||||||
if (__osx_frame_counter > 100)
|
|
||||||
{
|
|
||||||
__osx_frame_counter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ColorRgb color[4] = {ColorRgb::RED, ColorRgb::BLUE, ColorRgb::GREEN, ColorRgb::WHITE};
|
|
||||||
if (__osx_frame_counter < 25)
|
|
||||||
{
|
|
||||||
color[0] = ColorRgb::WHITE;
|
|
||||||
color[1] = ColorRgb::RED;
|
|
||||||
color[2] = ColorRgb::BLUE;
|
|
||||||
color[3] = ColorRgb::GREEN;
|
|
||||||
}
|
|
||||||
else if(__osx_frame_counter < 50)
|
|
||||||
{
|
|
||||||
color[1] = ColorRgb::WHITE;
|
|
||||||
color[2] = ColorRgb::RED;
|
|
||||||
color[3] = ColorRgb::BLUE;
|
|
||||||
color[0] = ColorRgb::GREEN;
|
|
||||||
}
|
|
||||||
else if(__osx_frame_counter < 75)
|
|
||||||
{
|
|
||||||
color[2] = ColorRgb::WHITE;
|
|
||||||
color[3] = ColorRgb::RED;
|
|
||||||
color[0] = ColorRgb::BLUE;
|
|
||||||
color[1] = ColorRgb::GREEN;
|
|
||||||
}
|
|
||||||
unsigned w = image->width();
|
|
||||||
unsigned h = image->height();
|
|
||||||
|
|
||||||
for (unsigned y=0; y<h; y++)
|
|
||||||
{
|
|
||||||
for (unsigned x=0; x<w; x++)
|
|
||||||
{
|
|
||||||
unsigned id = 0;
|
|
||||||
if (x < w/2 && y < h/2) id = 1;
|
|
||||||
if (x < w/2 && y >= h/2) id = 2;
|
|
||||||
if (x >= w/2 && y < h/2) id = 3;
|
|
||||||
|
|
||||||
image->memptr()[y*w + x] = color[id];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
CFDataRef CGDataProviderCopyData(CGImageRef image)
|
|
||||||
{
|
|
||||||
const unsigned indexMax = image->width() * image->height() * CGImageGetBitsPerPixel(image);
|
|
||||||
CFDataRef data = new CFData[indexMax];
|
|
||||||
int lineLength = CGImageGetBytesPerRow(image);
|
|
||||||
|
|
||||||
for (unsigned y=0; y<image->height(); y++)
|
|
||||||
{
|
|
||||||
for (unsigned x=0; x<image->width(); x++)
|
|
||||||
{
|
|
||||||
int index = lineLength * y + x * CGImageGetBitsPerPixel(image);
|
|
||||||
|
|
||||||
data[index ] = (*image)(x,y).blue;
|
|
||||||
data[index+1] = (*image)(x,y).green;
|
|
||||||
data[index+2] = (*image)(x,y).red;
|
|
||||||
data[index+3] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char* CFDataGetBytePtr(CFDataRef imgData)
|
|
||||||
{
|
|
||||||
return imgData;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned CGImageGetWidth(CGImageRef image)
|
|
||||||
{
|
|
||||||
return image->width();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned CGImageGetHeight(CGImageRef image)
|
|
||||||
{
|
|
||||||
return image->height();
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned CGImageGetBytesPerRow(CGImageRef image)
|
|
||||||
{
|
|
||||||
return image->width()*CGImageGetBitsPerPixel(image);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned CGImageGetBitsPerPixel(CGImageRef)
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CFRelease(CFDataRef imgData)
|
|
||||||
{
|
|
||||||
delete imgData;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGDisplayModeRef CGDisplayCopyDisplayMode(CGDirectDisplayID display)
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
CGRect CGDisplayBounds(CGDirectDisplayID display)
|
|
||||||
{
|
|
||||||
CGRect rect;
|
|
||||||
rect.size.width = __screenWidth / (display+1);
|
|
||||||
rect.size.height = __screenHeight / (display+1);
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
void CGDisplayModeRelease(CGDisplayModeRef mode)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/OsxWrapper.h>
|
#include <grabber/osx/OsxWrapper.h>
|
||||||
|
|
||||||
OsxWrapper::OsxWrapper( int updateRate_Hz,
|
OsxWrapper::OsxWrapper( int updateRate_Hz,
|
||||||
int display,
|
int display,
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
# Define the current source locations
|
add_library(qt-grabber
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
${CMAKE_SOURCE_DIR}/include/grabber/qt/QtGrabber.h
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/qt)
|
${CMAKE_SOURCE_DIR}/include/grabber/qt/QtWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/qt/QtGrabber.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/qt/QtWrapper.cpp
|
||||||
FILE ( GLOB QT_GRAB_SOURCES "${CURRENT_HEADER_DIR}/Qt*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
)
|
||||||
|
|
||||||
add_library(qt-grabber ${QT_GRAB_SOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(qt-grabber
|
target_link_libraries(qt-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${QT_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// proj
|
// proj
|
||||||
#include <grabber/QtGrabber.h>
|
#include <grabber/qt/QtGrabber.h>
|
||||||
|
|
||||||
// qt
|
// qt
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
@ -226,7 +226,7 @@ int QtGrabber::grabFrame(Image<ColorRgb>& image)
|
|||||||
QPixmap originalPixmap = grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
|
QPixmap originalPixmap = grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
|
||||||
#else
|
#else
|
||||||
QPixmap originalPixmap = _screen->grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
|
QPixmap originalPixmap = _screen->grabWindow(0, _src_x, _src_y, _src_x_max, _src_y_max);
|
||||||
#endif
|
#endif
|
||||||
if (originalPixmap.isNull())
|
if (originalPixmap.isNull())
|
||||||
{
|
{
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/QtWrapper.h>
|
#include <grabber/qt/QtWrapper.h>
|
||||||
|
|
||||||
QtWrapper::QtWrapper( int updateRate_Hz,
|
QtWrapper::QtWrapper( int updateRate_Hz,
|
||||||
int display,
|
int display,
|
||||||
|
@ -1,33 +1,38 @@
|
|||||||
# Common cmake definition for external video grabber
|
# Common cmake definition for external video grabber
|
||||||
|
|
||||||
# Add Turbo JPEG library
|
set(MF-grabber mediafoundation)
|
||||||
if (ENABLE_V4L2 OR ENABLE_MF)
|
set(V4L2-grabber v4l2)
|
||||||
find_package(TurboJPEG)
|
|
||||||
if (TURBOJPEG_FOUND)
|
|
||||||
add_definitions(-DHAVE_TURBO_JPEG)
|
|
||||||
message( STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
|
|
||||||
include_directories(${TurboJPEG_INCLUDE_DIRS})
|
|
||||||
else ()
|
|
||||||
message( STATUS "Turbo JPEG library not found, MJPEG camera format won't work.")
|
|
||||||
endif ()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Define the wrapper/header/source locations and collect them
|
if(ENABLE_MF)
|
||||||
SET(WRAPPER_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video)
|
|
||||||
SET(HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
|
||||||
if (ENABLE_MF)
|
|
||||||
project(mf-grabber)
|
project(mf-grabber)
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/mediafoundation)
|
set(grabber_project MF)
|
||||||
FILE (GLOB SOURCES "${WRAPPER_DIR}/*.cpp" "${HEADER_DIR}/Video*.h" "${HEADER_DIR}/MF*.h" "${HEADER_DIR}/Encoder*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
|
set(MediaFoundationSourceReaderCallBack ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/mediafoundation/MFSourceReaderCB.h)
|
||||||
elseif(ENABLE_V4L2)
|
elseif(ENABLE_V4L2)
|
||||||
project(v4l2-grabber)
|
project(v4l2-grabber)
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/video/v4l2)
|
set(grabber_project V4L2)
|
||||||
FILE (GLOB SOURCES "${WRAPPER_DIR}/*.cpp" "${HEADER_DIR}/Video*.h" "${HEADER_DIR}/V4L2*.h" "${HEADER_DIR}/Encoder*.h" "${CURRENT_SOURCE_DIR}/*.cpp")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} ${SOURCES})
|
add_library(${PROJECT_NAME}
|
||||||
target_link_libraries(${PROJECT_NAME} hyperion ${QT_LIBRARIES})
|
${CMAKE_SOURCE_DIR}/include/grabber/video/EncoderThread.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/video/VideoWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/EncoderThread.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/VideoWrapper.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/video/${${grabber_project}-grabber}/${grabber_project}Grabber.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/video/${${grabber_project}-grabber}/${grabber_project}Grabber.cpp
|
||||||
|
${MediaFoundationSourceReaderCallBack}
|
||||||
|
)
|
||||||
|
|
||||||
if(TURBOJPEG_FOUND)
|
target_link_libraries(${PROJECT_NAME} hyperion)
|
||||||
target_link_libraries(${PROJECT_NAME} ${TurboJPEG_LIBRARY})
|
|
||||||
|
# Add Turbo JPEG library
|
||||||
|
if(ENABLE_V4L2 OR ENABLE_MF)
|
||||||
|
find_package(TurboJPEG)
|
||||||
|
if(TURBOJPEG_FOUND)
|
||||||
|
add_definitions(-DHAVE_TURBO_JPEG)
|
||||||
|
message(STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${TurboJPEG_LIBRARY})
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC ${TurboJPEG_INCLUDE_DIRS})
|
||||||
|
else ()
|
||||||
|
message(STATUS "Turbo JPEG library not found, MJPEG camera format won't work.")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "grabber/EncoderThread.h"
|
#include "grabber/video/EncoderThread.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
|
||||||
#include <grabber/VideoWrapper.h>
|
#include <grabber/video/VideoWrapper.h>
|
||||||
|
|
||||||
// qt includes
|
// qt includes
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "MFSourceReaderCB.h"
|
#include "MFSourceReaderCB.h"
|
||||||
#include "grabber/MFGrabber.h"
|
#include "grabber/video/mediafoundation/MFGrabber.h"
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
namespace { const bool verbose = false; }
|
namespace { const bool verbose = false; }
|
||||||
@ -537,7 +537,7 @@ void MFGrabber::process_image(const void *frameImageBuffer, int size)
|
|||||||
Error(_log, "Frame too small: %d != %d", size, _frameByteSize);
|
Error(_log, "Frame too small: %d != %d", size, _frameByteSize);
|
||||||
else if (_threadManager != nullptr)
|
else if (_threadManager != nullptr)
|
||||||
{
|
{
|
||||||
for (unsigned long i = 0; i < _threadManager->_threadCount; i++)
|
for (int i = 0; i < _threadManager->_threadCount; i++)
|
||||||
{
|
{
|
||||||
if (!_threadManager->_threads[i]->isBusy())
|
if (!_threadManager->_threads[i]->isBusy())
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#pragma comment (lib, "strmiids.lib")
|
#pragma comment (lib, "strmiids.lib")
|
||||||
#pragma comment (lib, "wmcodecdspuuid.lib")
|
#pragma comment (lib, "wmcodecdspuuid.lib")
|
||||||
|
|
||||||
#include <grabber/MFGrabber.h>
|
#include <grabber/video/mediafoundation/MFGrabber.h>
|
||||||
|
|
||||||
#define SAFE_RELEASE(x) if(x) { x->Release(); x = nullptr; }
|
#define SAFE_RELEASE(x) if(x) { x->Release(); x = nullptr; }
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
|
||||||
#include "grabber/V4L2Grabber.h"
|
#include "grabber/video/v4l2/V4L2Grabber.h"
|
||||||
|
|
||||||
#define CLEAR(x) memset(&(x), 0, sizeof(x))
|
#define CLEAR(x) memset(&(x), 0, sizeof(x))
|
||||||
|
|
||||||
|
@ -1,24 +1,23 @@
|
|||||||
# Define the current source locations
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/x11)
|
|
||||||
|
|
||||||
# Find X11
|
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
|
|
||||||
include_directories( ${X11_INCLUDES} )
|
add_library(x11-grabber
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/x11/X11Grabber.h
|
||||||
if(APPLE)
|
${CMAKE_SOURCE_DIR}/include/grabber/x11/X11Wrapper.h
|
||||||
include_directories("/opt/X11/include")
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/x11/X11Grabber.cpp
|
||||||
endif(APPLE)
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/x11/X11Wrapper.cpp
|
||||||
|
)
|
||||||
FILE ( GLOB X11_SOURCES "${CURRENT_HEADER_DIR}/X11*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
add_library(x11-grabber ${X11_SOURCES} )
|
|
||||||
|
|
||||||
target_link_libraries(x11-grabber
|
target_link_libraries(x11-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${X11_LIBRARIES}
|
${X11_LIBRARIES}
|
||||||
${X11_Xrandr_LIB}
|
${X11_Xrandr_LIB}
|
||||||
${X11_Xrender_LIB}
|
${X11_Xrender_LIB}
|
||||||
${QT_LIBRARIES}
|
)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
list(APPEND X11_INCLUDES "/opt/X11/include")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(x11-grabber PUBLIC
|
||||||
|
${X11_INCLUDES}
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <utils/Logger.h>
|
#include <utils/Logger.h>
|
||||||
#include <grabber/X11Grabber.h>
|
#include <grabber/x11/X11Grabber.h>
|
||||||
|
|
||||||
#include <xcb/randr.h>
|
#include <xcb/randr.h>
|
||||||
#include <xcb/xcb_event.h>
|
#include <xcb/xcb_event.h>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/X11Wrapper.h>
|
#include <grabber/x11/X11Wrapper.h>
|
||||||
|
|
||||||
X11Wrapper::X11Wrapper( int updateRate_Hz,
|
X11Wrapper::X11Wrapper( int updateRate_Hz,
|
||||||
int pixelDecimation,
|
int pixelDecimation,
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
# Define the current source locations
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb)
|
|
||||||
|
|
||||||
find_package(XCB COMPONENTS SHM IMAGE RENDER RANDR REQUIRED)
|
find_package(XCB COMPONENTS SHM IMAGE RENDER RANDR REQUIRED)
|
||||||
|
|
||||||
include_directories(${XCB_INCLUDE_DIRS})
|
add_library(xcb-grabber
|
||||||
|
${CMAKE_SOURCE_DIR}/include/grabber/xcb/XcbGrabber.h
|
||||||
FILE (GLOB XCB_SOURCES "${CURRENT_HEADER_DIR}/Xcb*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
${CMAKE_SOURCE_DIR}/include/grabber/xcb/XcbWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbCommandExecutor.h
|
||||||
add_library(xcb-grabber ${XCB_SOURCES})
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbCommands.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbGrabber.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/grabber/xcb/XcbWrapper.cpp
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(xcb-grabber
|
target_link_libraries(xcb-grabber
|
||||||
hyperion
|
hyperion
|
||||||
${XCB_LIBRARIES}
|
${XCB_LIBRARIES}
|
||||||
${QT_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT APPLE)
|
target_include_directories(xcb-grabber PUBLIC
|
||||||
target_link_libraries(
|
${XCB_INCLUDE_DIRS}
|
||||||
xcb-grabber
|
)
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <utils/Logger.h>
|
#include <utils/Logger.h>
|
||||||
#include <grabber/XcbGrabber.h>
|
#include <grabber/xcb/XcbGrabber.h>
|
||||||
|
|
||||||
#include "XcbCommands.h"
|
#include "XcbCommands.h"
|
||||||
#include "XcbCommandExecutor.h"
|
#include "XcbCommandExecutor.h"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <grabber/XcbWrapper.h>
|
#include <grabber/xcb/XcbWrapper.h>
|
||||||
|
|
||||||
XcbWrapper::XcbWrapper( int updateRate_Hz,
|
XcbWrapper::XcbWrapper( int updateRate_Hz,
|
||||||
int pixelDecimation,
|
int pixelDecimation,
|
||||||
|
@ -1,21 +1,50 @@
|
|||||||
|
|
||||||
# Define the current source locations
|
|
||||||
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/hyperion)
|
|
||||||
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion)
|
|
||||||
|
|
||||||
if(ENABLE_FLATBUF_SERVER)
|
|
||||||
include_directories(
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
FILE ( GLOB Hyperion_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
|
|
||||||
|
|
||||||
SET(Hyperion_RESOURCES ${CURRENT_SOURCE_DIR}/resource.qrc)
|
|
||||||
|
|
||||||
add_library(hyperion
|
add_library(hyperion
|
||||||
${Hyperion_SOURCES}
|
# Authorization Manager
|
||||||
${Hyperion_RESOURCES}
|
${CMAKE_SOURCE_DIR}/include/hyperion/AuthManager.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/AuthManager.cpp
|
||||||
|
# Background Effect Handler
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/BGEffectHandler.h
|
||||||
|
# Capture Control class
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/CaptureCont.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/CaptureCont.cpp
|
||||||
|
# Color Adjustment
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/ColorAdjustment.h
|
||||||
|
# Component Register
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/ComponentRegister.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ComponentRegister.cpp
|
||||||
|
# Grabber/Wrapper classes
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/Grabber.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/Grabber.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/GrabberWrapper.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/GrabberWrapper.cpp
|
||||||
|
# Hyperion + Resources
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/Hyperion.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/Hyperion.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/resource.qrc
|
||||||
|
# Instance Manager
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/HyperionIManager.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/HyperionIManager.cpp
|
||||||
|
# Image Processor
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/ImageProcessor.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ImageProcessor.cpp
|
||||||
|
# ImageToLedsMap class
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/ImageToLedsMap.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/ImageToLedsMap.cpp
|
||||||
|
# Led String
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/LedString.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/LedString.cpp
|
||||||
|
# Linear Color Smoothing
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/LinearColorSmoothing.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/LinearColorSmoothing.cpp
|
||||||
|
# Led Color Transform
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/MultiColorAdjustment.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/MultiColorAdjustment.cpp
|
||||||
|
# Priority Muxer
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/PriorityMuxer.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/PriorityMuxer.cpp
|
||||||
|
# Settings Manager
|
||||||
|
${CMAKE_SOURCE_DIR}/include/hyperion/SettingsManager.h
|
||||||
|
${CMAKE_SOURCE_DIR}/libsrc/hyperion/SettingsManager.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(hyperion
|
target_link_libraries(hyperion
|
||||||
@ -23,7 +52,6 @@ target_link_libraries(hyperion
|
|||||||
hyperion-utils
|
hyperion-utils
|
||||||
leddevice
|
leddevice
|
||||||
database
|
database
|
||||||
${QT_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_BOBLIGHT_SERVER)
|
if(ENABLE_BOBLIGHT_SERVER)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user