Compare commits
4 Commits
master
...
stable-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7700916eae | ||
|
|
d87917cdc9 | ||
|
|
dd70bab7e5 | ||
|
|
afaceadce6 |
11
.circleci/config.yml
Normal file
11
.circleci/config.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
# Dummy CircleCI Config File
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
machine: true
|
||||
branches:
|
||||
ignore: stable-1.2
|
||||
steps:
|
||||
- run:
|
||||
name: Dummy
|
||||
command: echo "Dummy command to prevent error"
|
||||
@@ -1,84 +0,0 @@
|
||||
---
|
||||
# Language
|
||||
Language: Cpp
|
||||
Standard: c++20
|
||||
|
||||
# Indentation
|
||||
TabWidth: 4
|
||||
UseTab: Always
|
||||
IndentWidth: 4
|
||||
ColumnLimit: 120
|
||||
|
||||
# Indentation detail
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
ContinuationIndentWidth: 4
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
BinPackParameters: true
|
||||
BinPackArguments: true
|
||||
AlignOperands: false
|
||||
|
||||
# Alignment
|
||||
AlignEscapedNewlines: DontAlign
|
||||
AccessModifierOffset: -4
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortIfStatementsOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
BreakBeforeBinaryOperators: All
|
||||
|
||||
# Includes
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
# windows.h must go before everything else
|
||||
# otherwise, you will get errors
|
||||
- Regex: '^<windows.h>$'
|
||||
Priority: -99
|
||||
# the "main header" implicitly gets priority 0
|
||||
# system headers
|
||||
- Regex: '^<[^>]+>$'
|
||||
Priority: 1
|
||||
# non-system headers
|
||||
- Regex: '.*'
|
||||
Priority: 2
|
||||
SortIncludes: true
|
||||
|
||||
# Spaces
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
|
||||
# Brace wrapping
|
||||
# Not directly mentioned in the coding conventions,
|
||||
# but required to avoid tons of auto reformatting
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BeforeWhile: false
|
||||
BeforeLambdaBody: false
|
||||
|
||||
# Do not break doxygen comments
|
||||
CommentPragmas: '^[[:space:]]*\\.+'
|
||||
|
||||
# Pointers
|
||||
# Use pointer close to type: `const char* const* function()`
|
||||
PointerAlignment: Left
|
||||
|
||||
...
|
||||
|
||||
50
.clang-tidy
50
.clang-tidy
@@ -1,50 +0,0 @@
|
||||
---
|
||||
Checks: >
|
||||
bugprone-macro-parentheses,
|
||||
bugprone-macro-repeated-side-effects,
|
||||
modernize-avoid-c-arrays,
|
||||
modernize-loop-convert,
|
||||
modernize-redundant-void-arg,
|
||||
modernize-use-auto,
|
||||
modernize-use-bool-literals,
|
||||
modernize-use-emplace,
|
||||
modernize-use-equals-default,
|
||||
modernize-use-equals-delete,
|
||||
modernize-use-override,
|
||||
modernize-use-using,
|
||||
performance-trivially-destructible,
|
||||
readability-braces-around-statements,
|
||||
readability-const-return-type,
|
||||
readability-identifier-naming,
|
||||
readability-misleading-indentation,
|
||||
readability-simplify-boolean-expr
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: '' # don't show errors from headers
|
||||
FormatStyle: none
|
||||
User: user
|
||||
CheckOptions:
|
||||
- key: readability-identifier-naming.ClassCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.EnumCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.TypedefCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.UnionCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.StructCase
|
||||
value: CamelCase
|
||||
- key: readability-identifier-naming.UnionCase
|
||||
value: CamelCase
|
||||
# not yet working, as it currently applies both for static and object members
|
||||
# - key: readability-identifier-naming.MemberPrefix
|
||||
# value: 'm_'
|
||||
# currently only working for local static variables:
|
||||
- key: readability-identifier-naming.StaticVariablePrefix
|
||||
value: 's_'
|
||||
# not yet working
|
||||
# - key: readability-identifier-naming.VariableCase
|
||||
# value: camelBack
|
||||
- key: readability-identifier-naming.FunctionCase
|
||||
value: camelBack
|
||||
...
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,5 +1,3 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
data/locale/* linguist-documentation
|
||||
* text=auto eol=lf
|
||||
*.{bin,bmp,flac,icns,ico,mmpz,ogg,png,xiz,xmz,wav} binary
|
||||
|
||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +0,0 @@
|
||||
---
|
||||
custom: https://lmms.io/get-involved/#donate
|
||||
91
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
91
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,91 +0,0 @@
|
||||
# yamllint disable-file rule:line-length
|
||||
name: Bug Report
|
||||
description: File a bug report to help us improve
|
||||
labels:
|
||||
- bug
|
||||
body:
|
||||
- type: input
|
||||
id: system-information
|
||||
attributes:
|
||||
label: System Information
|
||||
description: |
|
||||
- The operating system you use to run LMMS.
|
||||
- When relevant, also include your hardware information.
|
||||
placeholder: ex. Fedora Linux 39, KDE Plasma 5.27.10 - 13th Gen Intel® Core™ i9-13950HX, 32GB RAM
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: affected-version
|
||||
attributes:
|
||||
label: LMMS Version(s)
|
||||
description: |
|
||||
- The version of LMMS affected by the bug.
|
||||
- Can be an official version number, nightly release identifier, or commit hash.
|
||||
- The version number can be found under the Help > About menu.
|
||||
placeholder: ex. 1.2.2, 1.3.0-alpha.1.518+gdd53bec31, 2d185df
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: working-version
|
||||
attributes:
|
||||
label: Most Recent Working Version
|
||||
description: |
|
||||
- If there is a previous version of LMMS that did not exhibit the bug, include it here.
|
||||
placeholder: ex. 1.2.2, 1.3.0-alpha.1.518+gdd53bec31, 2d185df
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: bug-summary
|
||||
attributes:
|
||||
label: Bug Summary
|
||||
description: Briefly describe the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected-behaviour
|
||||
attributes:
|
||||
label: Expected Behaviour
|
||||
description: Describe what should have happened.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps-to-reproduce
|
||||
attributes:
|
||||
label: Steps To Reproduce
|
||||
description: |
|
||||
- Describe the minimum set of steps required to reproduce this bug.
|
||||
- If you included a minimum reproducible project below, you can describe here how it should be used.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs
|
||||
description: |
|
||||
- Copy and paste any relevant log output here.
|
||||
value: |
|
||||
<details>
|
||||
<summary>Click to expand</summary>
|
||||
<pre>
|
||||
<!-- paste logs here -->
|
||||
</pre>
|
||||
</details>
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: supporting-files
|
||||
attributes:
|
||||
label: Screenshots / Minimum Reproducible Project
|
||||
description: |
|
||||
- Upload any screenshots showing the bug in action.
|
||||
- If possible, also include a .mmp/.mmpz project containing the simplest possible
|
||||
setup needed to reproduce the bug.
|
||||
|
||||
***Note:** To upload a project file to GitHub, it will need to be placed in a .zip archive.*
|
||||
- type: checkboxes
|
||||
id: search-for-existing
|
||||
attributes:
|
||||
label: Please search the issue tracker for existing bug reports before submitting your own.
|
||||
options:
|
||||
- label: I have searched all existing issues and confirmed that this is not a duplicate.
|
||||
required: true
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
||||
---
|
||||
contact_links:
|
||||
- name: Get help on Discord
|
||||
url: https://lmms.io/chat/
|
||||
about: Need help? Have a question? Reach out to other LMMS users on our Discord server!
|
||||
32
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
32
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,32 +0,0 @@
|
||||
# yamllint disable-file rule:line-length
|
||||
name: Feature Request
|
||||
description: Suggest an idea for the project
|
||||
labels:
|
||||
- "enhancement"
|
||||
body:
|
||||
- type: textarea
|
||||
id: enhancement-summary
|
||||
attributes:
|
||||
label: Enhancement Summary
|
||||
description: |
|
||||
- Briefly describe the enhancement.
|
||||
- Explain why you believe the proposed enhancement to be a good idea, and (if applicable) how it helps
|
||||
overcome a limitation of LMMS you are currently facing.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: mockup
|
||||
attributes:
|
||||
label: Implementation Details / Mockup
|
||||
description: |
|
||||
- Explain how you believe this enhancement should be implemented.
|
||||
- If your proposal encompasses changes to the user interface, include diagrams displaying your intent.
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: search-for-existing
|
||||
attributes:
|
||||
label: Please search the issue tracker for existing feature requests before submitting your own.
|
||||
options:
|
||||
- label: I have searched all existing issues and confirmed that this is not a duplicate.
|
||||
required: true
|
||||
1
.github/no-response.yml
vendored
1
.github/no-response.yml
vendored
@@ -1,3 +1,2 @@
|
||||
---
|
||||
# Label requiring a response
|
||||
responseRequiredLabel: "response required"
|
||||
|
||||
490
.github/workflows/build.yml
vendored
490
.github/workflows/build.yml
vendored
@@ -1,490 +0,0 @@
|
||||
---
|
||||
name: build
|
||||
'on': [push, pull_request]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
linux-x86_64:
|
||||
name: linux-x86_64
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-DUSE_WERROR=ON
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=ON
|
||||
-DWANT_DEBUG_CPACK=ON
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
MAKEFLAGS: -j2
|
||||
steps:
|
||||
- name: Configure git
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Clone fltk
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: fltk/fltk
|
||||
path: fltk
|
||||
ref: 27d991f046bdebb12bfd58f7c05a19f135979c29
|
||||
fetch-depth: 1
|
||||
- name: Configure winehq
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo mkdir -pm755 /etc/apt/keyrings
|
||||
wget -O - https://dl.winehq.org/wine-builds/winehq.key | \
|
||||
sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
|
||||
sudo wget -NP /etc/apt/sources.list.d/ \
|
||||
https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
$(xargs < .github/workflows/deps-ubuntu-24.04-gcc.txt)
|
||||
sudo apt-get install -y --install-recommends g++-multilib gcc-multilib winehq-devel wine-devel-dev
|
||||
sudo apt-get install -y --install-recommends \
|
||||
$(xargs < .github/workflows/deps-ubuntu-24.04-fltk.txt)
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-
|
||||
path: ~/.ccache
|
||||
- name: Configure fltk
|
||||
run: |
|
||||
cmake -S fltk -B fltk/build -DFLTK_BUILD_SHARED_LIBS=ON -DFLTK_BACKEND_WAYLAND=ON \
|
||||
-DFLTK_USE_LIBDECOR_GTK=OFF -DFLTK_BUILD_TEST=OFF -DFLTK_BUILD_GL=OFF
|
||||
- name: Install fltk
|
||||
run: |
|
||||
cmake --build fltk/build
|
||||
sudo cmake --install fltk/build --prefix /usr
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
source /opt/qt5*/bin/qt5*-env.sh || true
|
||||
cmake -S . \
|
||||
-B build \
|
||||
$CMAKE_OPTS
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd build/tests
|
||||
ctest --output-on-failure -j2
|
||||
- name: Package
|
||||
run: |
|
||||
cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux
|
||||
path: build/lmms-*.AppImage
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
ccache --cleanup
|
||||
echo "[ccache config]"
|
||||
ccache --show-config
|
||||
echo "[ccache stats]"
|
||||
ccache --show-stats
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500M
|
||||
linux-arm64:
|
||||
name: linux-arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-DUSE_WERROR=ON
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=ON
|
||||
-DWANT_DEBUG_CPACK=ON
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
MAKEFLAGS: -j2
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
steps:
|
||||
- name: Configure git
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Clone fltk
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: fltk/fltk
|
||||
path: fltk
|
||||
ref: 27d991f046bdebb12bfd58f7c05a19f135979c29
|
||||
fetch-depth: 1
|
||||
- name: Install system packages
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
$(xargs < .github/workflows/deps-ubuntu-24.04-gcc.txt)
|
||||
sudo apt-get install -y --install-recommends \
|
||||
$(xargs < .github/workflows/deps-ubuntu-24.04-fltk.txt)
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-
|
||||
path: ~/.ccache
|
||||
- name: Configure fltk
|
||||
run: |
|
||||
cmake -S fltk -B fltk/build -DFLTK_BUILD_SHARED_LIBS=ON -DFLTK_BACKEND_WAYLAND=ON \
|
||||
-DFLTK_USE_LIBDECOR_GTK=OFF -DFLTK_BUILD_TEST=OFF -DFLTK_BUILD_GL=OFF
|
||||
- name: Install fltk
|
||||
run: |
|
||||
cmake --build fltk/build
|
||||
sudo cmake --install fltk/build --prefix /usr
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
cmake -S . \
|
||||
-B build \
|
||||
$CMAKE_OPTS
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd build/tests
|
||||
ctest --output-on-failure -j2
|
||||
- name: Package
|
||||
run: |
|
||||
cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-arm64
|
||||
path: build/lmms-*.AppImage
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
ccache --cleanup
|
||||
echo "[ccache config]"
|
||||
ccache --show-config
|
||||
echo "[ccache stats]"
|
||||
ccache --show-stats
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500M
|
||||
macos:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [ x86_64, arm64 ]
|
||||
include:
|
||||
- arch: x86_64
|
||||
os: macos-15-intel
|
||||
xcode: "16.4"
|
||||
- arch: arm64
|
||||
os: macos-15
|
||||
xcode: "16.4"
|
||||
name: macos-${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-Werror=dev
|
||||
-DUSE_WERROR=ON
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=ON
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
MAKEFLAGS: -j3
|
||||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Clean up Homebrew download cache
|
||||
run: rm -rf ~/Library/Caches/Homebrew/downloads
|
||||
- name: Restore Homebrew download cache
|
||||
id: cache-homebrew
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
key: n/a - only restore from restore-keys
|
||||
restore-keys: |
|
||||
homebrew-${{ matrix.arch }}-
|
||||
path: ~/Library/Caches/Homebrew/downloads
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
|
||||
-${{ github.run_id }}"
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-${{ matrix.arch }}-
|
||||
path: ~/Library/Caches/ccache
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew bundle install --verbose
|
||||
npm update -g npm
|
||||
npm install --location=global appdmg
|
||||
env:
|
||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||
HOMEBREW_NO_INSTALL_UPGRADE: 1
|
||||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
source .github/workflows/macos-env.sh
|
||||
mkdir build
|
||||
cmake -S . \
|
||||
-B build \
|
||||
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
|
||||
$CMAKE_OPTS \
|
||||
-DUSE_WERROR=OFF
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd build/tests
|
||||
ctest --output-on-failure -j3
|
||||
- name: Package
|
||||
run: |
|
||||
cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macos-${{ matrix.arch }}
|
||||
path: build/lmms-*.dmg
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
ccache --cleanup
|
||||
echo "[ccache config]"
|
||||
ccache --show-config
|
||||
echo "[ccache stats]"
|
||||
ccache --show-stats --verbose
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500MB
|
||||
- name: Save Homebrew download cache
|
||||
if: ${{ steps.cache-homebrew.outputs.cache-matched-key != env.key }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
key: ${{ env.key }}
|
||||
path: ~/Library/Caches/Homebrew/downloads
|
||||
env:
|
||||
key: "homebrew-${{ matrix.arch }}\
|
||||
-${{ hashFiles('Brewfile.lock.json') }}"
|
||||
mingw:
|
||||
name: mingw64
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-Werror=dev
|
||||
-DUSE_WERROR=ON
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=ON
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
MAKEFLAGS: -j2
|
||||
steps:
|
||||
- name: Configure apt
|
||||
run: |
|
||||
sudo sh -c 'echo "deb http://ppa.launchpad.net/tobydox/mingw-w64/ubuntu focal main" > \
|
||||
/etc/apt/sources.list.d/tobydox-mingw-w64.list'
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 72931B477E22FEFD47F8DECE02FE5F12ADDE29B2
|
||||
sudo apt-get update -y
|
||||
- name: Configure git
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: "ccache-${{ github.job }}-64-${{ github.ref }}\
|
||||
-${{ github.run_id }}"
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-64-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-64-
|
||||
path: ~/.ccache
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
$(xargs < .github/workflows/deps-ubuntu-24.04-mingw.txt)
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
cmake -S . \
|
||||
-B build \
|
||||
-DCMAKE_TOOLCHAIN_FILE="./cmake/toolchains/MinGW-W64-64.cmake" \
|
||||
$CMAKE_OPTS
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Package
|
||||
run: cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mingw64
|
||||
path: build/lmms-*.exe
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
ccache --cleanup
|
||||
echo "[ccache config]"
|
||||
ccache --show-config
|
||||
echo "[ccache stats]"
|
||||
ccache --show-stats
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500M
|
||||
msvc:
|
||||
name: msvc-x64
|
||||
runs-on: windows-2022
|
||||
env:
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Cache vcpkg dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: vcpkg-msvc-x86_64-${{ hashFiles('vcpkg.json') }}
|
||||
restore-keys: |
|
||||
vcpkg-msvc-x86_64-
|
||||
path: build\vcpkg_installed
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# yamllint disable rule:line-length
|
||||
key: "ccache-${{ github.job }}-x64-${{ github.ref }}\
|
||||
-${{ github.run_id }}"
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-x64-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-x64-
|
||||
path: ~\AppData\Local\ccache
|
||||
# yamllint enable rule:line-length
|
||||
- name: Install tools
|
||||
run: choco install ccache
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
||||
with:
|
||||
version: '6.8.*'
|
||||
arch: "win64_msvc2022_64"
|
||||
archives: qtbase qtsvg qttools
|
||||
cache: true
|
||||
- name: Set up build environment
|
||||
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
|
||||
with:
|
||||
arch: x64
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
mkdir build -Force
|
||||
cmake -S . `
|
||||
-B build `
|
||||
-G Ninja `
|
||||
--toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
|
||||
-Werror=dev `
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
-DWANT_QT6=ON `
|
||||
-DUSE_COMPILE_CACHE=ON `
|
||||
-DUSE_WERROR=ON `
|
||||
-DVCPKG_TARGET_TRIPLET="x64-windows" `
|
||||
-DVCPKG_HOST_TRIPLET="x64-windows" `
|
||||
-DVCPKG_MANIFEST_INSTALL="${{ env.should_install_manifest }}"
|
||||
env:
|
||||
should_install_manifest:
|
||||
${{ steps.cache-deps.outputs.cache-hit == 'true' && 'NO' || 'YES' }}
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd build/tests
|
||||
ctest --output-on-failure -j2
|
||||
- name: Package
|
||||
run: cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: msvc-x64
|
||||
path: build\lmms-*.exe
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
ccache --cleanup
|
||||
echo "[ccache config]"
|
||||
ccache --show-config
|
||||
echo "[ccache stats]"
|
||||
ccache --show-stats --verbose
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500MB
|
||||
msys2:
|
||||
name: windows-arm64
|
||||
runs-on: windows-11-arm
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=ON
|
||||
-DCPACK_NSIS_EXECUTABLE=/clang64/bin/makensis.exe
|
||||
CCACHE_MAXSIZE: 0
|
||||
CCACHE_NOCOMPRESS: 1
|
||||
MAKEFLAGS: -j2
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Cache msys2 dependencies
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: windows-arm64-${{ hashFiles('.github/workflows/deps-msys2-clangarm64.txt') }}
|
||||
restore-keys: |
|
||||
windows-arm64-
|
||||
path: \msys64\var\cache\pacman\pkg
|
||||
- name: Install msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: CLANGARM64
|
||||
update: true
|
||||
- name: Install dependencies
|
||||
run: pacman --needed --noconfirm -S - < .github/workflows/deps-msys2-clangarm64.txt
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-
|
||||
path: ~\AppData\Local\ccache
|
||||
- name: Configure
|
||||
run: |
|
||||
/clang64/bin/ccache.exe --zero-stats
|
||||
cmake -B build $CMAKE_OPTS
|
||||
- name: Build
|
||||
run: cmake --build build
|
||||
- name: Package
|
||||
run: cmake --build build --target package
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-arm64
|
||||
path: build\lmms-*.exe
|
||||
- name: Trim ccache and print statistics
|
||||
run: |
|
||||
/clang64/bin/ccache.exe --cleanup
|
||||
echo "[ccache config]"
|
||||
/clang64/bin/ccache.exe --show-config
|
||||
echo "[ccache stats]"
|
||||
/clang64/bin/ccache.exe --show-stats --verbose
|
||||
env:
|
||||
CCACHE_MAXSIZE: 500MB
|
||||
40
.github/workflows/checks.yml
vendored
40
.github/workflows/checks.yml
vendored
@@ -1,40 +0,0 @@
|
||||
---
|
||||
name: checks
|
||||
'on': [push, pull_request]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
scripted-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install python-tinycss2
|
||||
run: sudo apt-get install -y python3-tinycss2
|
||||
- name: Update submodules
|
||||
run: git submodule update --init --recursive
|
||||
- name: Verify scripted tests
|
||||
run: tests/scripted/verify
|
||||
- name: Run check-strings
|
||||
run: tests/scripted/check-strings
|
||||
- name: Run check-namespace
|
||||
run: tests/scripted/check-namespace
|
||||
shellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
container: koalaman/shellcheck-alpine:v0.9.0
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
- name: Run shellcheck
|
||||
run: |
|
||||
shellcheck \
|
||||
$(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") \
|
||||
doc/bash-completion/lmms \
|
||||
buildtools/update_locales
|
||||
yamllint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out
|
||||
uses: actions/checkout@v3
|
||||
- name: Run yamllint
|
||||
run: for i in $(git ls-files '*.yml'); do yamllint $i; done
|
||||
25
.github/workflows/deps-msys2-clangarm64.txt
vendored
25
.github/workflows/deps-msys2-clangarm64.txt
vendored
@@ -1,25 +0,0 @@
|
||||
base
|
||||
base-devel
|
||||
filesystem
|
||||
git
|
||||
mingw-w64-clang-aarch64-SDL2
|
||||
mingw-w64-clang-aarch64-ccache
|
||||
mingw-w64-clang-aarch64-clang
|
||||
mingw-w64-clang-aarch64-cmake
|
||||
mingw-w64-clang-aarch64-fftw
|
||||
mingw-w64-clang-aarch64-fltk
|
||||
mingw-w64-clang-aarch64-fluidsynth
|
||||
mingw-w64-clang-aarch64-libgig
|
||||
mingw-w64-clang-aarch64-libsamplerate
|
||||
mingw-w64-clang-aarch64-libsndfile
|
||||
mingw-w64-clang-aarch64-lilv
|
||||
mingw-w64-clang-aarch64-lv2
|
||||
mingw-w64-clang-aarch64-qt5-base
|
||||
mingw-w64-clang-aarch64-qt5-svg
|
||||
mingw-w64-clang-aarch64-suil
|
||||
mingw-w64-clang-aarch64-stk
|
||||
mingw-w64-clang-x86_64-nsis
|
||||
mingw-w64-clang-x86_64-ccache
|
||||
msys2-runtime
|
||||
perl-List-MoreUtils
|
||||
perl-XML-Parser
|
||||
3
.github/workflows/deps-ubuntu-24.04-fltk.txt
vendored
3
.github/workflows/deps-ubuntu-24.04-fltk.txt
vendored
@@ -1,3 +0,0 @@
|
||||
libcairo2-dev
|
||||
libpango1.0-dev
|
||||
wayland-protocols
|
||||
52
.github/workflows/deps-ubuntu-24.04-gcc.txt
vendored
52
.github/workflows/deps-ubuntu-24.04-gcc.txt
vendored
@@ -1,52 +0,0 @@
|
||||
binutils
|
||||
ca-certificates
|
||||
ccache
|
||||
cmake
|
||||
file
|
||||
fluid
|
||||
gcc
|
||||
git
|
||||
gpg
|
||||
g++
|
||||
libasound2-dev
|
||||
libc6-dev
|
||||
libfftw3-dev
|
||||
libfluidsynth-dev
|
||||
libgig-dev
|
||||
libgtk2.0-0
|
||||
libjack-jackd2-dev
|
||||
liblilv-dev
|
||||
liblist-moreutils-perl
|
||||
libmp3lame-dev
|
||||
libogg-dev
|
||||
libqt5svg5-dev
|
||||
libqt5x11extras5-dev
|
||||
libsamplerate0-dev
|
||||
libsdl2-dev
|
||||
libsndfile1-dev
|
||||
libsoundio-dev
|
||||
libstk-dev
|
||||
libsuil-dev
|
||||
libvorbis-dev
|
||||
libx11-xcb-dev
|
||||
libxcb-keysyms1-dev
|
||||
libxcb-util0-dev
|
||||
libxft-dev
|
||||
libxinerama-dev
|
||||
libxml2-utils
|
||||
libxml-perl
|
||||
lsb-release
|
||||
lv2-dev
|
||||
make
|
||||
perl
|
||||
portaudio19-dev
|
||||
qt5-qmake
|
||||
qtbase5-dev
|
||||
qtbase5-dev-tools
|
||||
qtbase5-private-dev
|
||||
qttools5-dev-tools
|
||||
qtwayland5
|
||||
software-properties-common
|
||||
ssh-client
|
||||
stk
|
||||
wget
|
||||
32
.github/workflows/deps-ubuntu-24.04-mingw.txt
vendored
32
.github/workflows/deps-ubuntu-24.04-mingw.txt
vendored
@@ -1,32 +0,0 @@
|
||||
binutils-mingw-w64
|
||||
ccache
|
||||
cmake
|
||||
fftw-mingw-w64
|
||||
file
|
||||
flac-mingw-w64
|
||||
fltk-mingw-w64
|
||||
fluidsynth-mingw-w64
|
||||
g++-mingw-w64-i686
|
||||
g++-mingw-w64-x86-64
|
||||
gcc-mingw-w64
|
||||
gcc-mingw-w64-i686
|
||||
gcc-mingw-w64-x86-64
|
||||
git
|
||||
glib2-mingw-w64
|
||||
lame-mingw-w64
|
||||
libgig-mingw-w64
|
||||
liblist-moreutils-perl
|
||||
libsamplerate-mingw-w64
|
||||
libsndfile-mingw-w64
|
||||
libsoundio-mingw-w64
|
||||
libvorbis-mingw-w64
|
||||
libxml-parser-perl
|
||||
libz-mingw-w64-dev
|
||||
mingw-w64-tools
|
||||
nsis
|
||||
portaudio-mingw-w64
|
||||
qt5base-mingw-w64
|
||||
qt5svg-mingw-w64
|
||||
qttools5-dev-tools
|
||||
sdl2-mingw-w64
|
||||
stk-mingw-w64
|
||||
121
.github/workflows/macos-env.sh
vendored
121
.github/workflows/macos-env.sh
vendored
@@ -1,121 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Calculate macOS-specific environment variables
|
||||
# 1. Sets the value of MACOSX_DEPLOYMENT_TARGET by matching another binary on the system.
|
||||
#
|
||||
# Usage:
|
||||
# source macos-env.sh [package_manager] [package_name] [package_version]
|
||||
#
|
||||
# Example:
|
||||
# source macos-env.sh brew qt 5
|
||||
# source macos-env.sh port wget
|
||||
|
||||
set -e
|
||||
|
||||
unset package_manager package_name package_version
|
||||
|
||||
# Obtain the package manager
|
||||
if [ -n "$1" ]; then
|
||||
# Set package manager to first parameter
|
||||
package_manager="$1"
|
||||
case "$package_manager" in
|
||||
"homebrew")
|
||||
package_manager="brew"
|
||||
;;
|
||||
"macports")
|
||||
package_manager="port"
|
||||
;;
|
||||
esac
|
||||
# Test the command
|
||||
if ! command -v "$package_manager" &> /dev/null; then
|
||||
echo "ERROR: Command '$package_manager' was not found, aborting." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# Try to guess the package manager
|
||||
if command -v brew &> /dev/null; then
|
||||
package_manager="brew"
|
||||
elif command -v port &> /dev/null; then
|
||||
package_manager="port"
|
||||
else
|
||||
echo "WARNING: A compatible package manager wasn't found, we'll search for '$package_name' on \$PATH instead" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Obtain the package name
|
||||
if [ -n "$2" ]; then
|
||||
package_name="$2"
|
||||
else
|
||||
package_name="qt"
|
||||
fi
|
||||
|
||||
# Special fallback handling for when package_name != binary_name, adjust as needed
|
||||
if [ "$package_name" = "qt" ]; then
|
||||
binary_name="qmake"
|
||||
elif [ "$package_name" = "fltk" ]; then
|
||||
binary_name="fluid"
|
||||
else
|
||||
# Assume the binary_name is the package_name
|
||||
binary_name="$package_name"
|
||||
fi
|
||||
|
||||
# Obtain the package version
|
||||
if [ -n "$3" ]; then
|
||||
package_version="$3"
|
||||
else
|
||||
if [ "$package_name" = "qt" ]; then
|
||||
# Sane fallback for qt, adjust as needed
|
||||
package_version="5"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Format $package_name to include $package_version
|
||||
if [ -n "$package_version" ]; then
|
||||
# Specify qt version in package name
|
||||
case "$package_manager" in
|
||||
"port")
|
||||
case "$package_name" in
|
||||
"qt")
|
||||
# Special handling for "qt5-qtbase"
|
||||
package_name="$package_name${package_version}-${package_name}base"
|
||||
;;
|
||||
*)
|
||||
package_name="$package_name$package_version"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"brew" | *)
|
||||
package_name="$package_name@$package_version"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Determine MACOSX_DEPLOYMENT_TARGET
|
||||
if [ -n "$package_manager" ]; then
|
||||
# Specify qt version in package name
|
||||
case "$package_manager" in
|
||||
"port")
|
||||
binary_path="$(port contents "$package_name" |grep "bin/${binary_name}\$" |head -1 |sed -e 's/^[[:space:]]*//')"
|
||||
;;
|
||||
"brew" | *)
|
||||
binary_path="$("$package_manager" --prefix "$package_name")/bin/$binary_name"
|
||||
;;
|
||||
esac
|
||||
otool_out="$(otool -l "$binary_path")"
|
||||
|
||||
else
|
||||
otool_out="$(otool -l "$(which "$binary_name")")"
|
||||
fi
|
||||
|
||||
echo "Using '$binary_name' (from $package_manager) to calculate the macOS deployment target..."
|
||||
|
||||
min_ver="$(echo "$otool_out" |grep "minos" || echo "$otool_out" |grep -A 2 "LC_VERSION_MIN_MACOS"|grep "version")"
|
||||
MACOSX_DEPLOYMENT_TARGET="$(echo "$min_ver"|awk '{print $2}')"
|
||||
|
||||
# Echo the lowest target macOS version supported by this SDK
|
||||
sdk_settings="$(xcrun --sdk macosx --show-sdk-path)/SDKSettings.plist"
|
||||
sdk_min="$(plutil -extract SupportedTargets.macosx.MinimumDeploymentTarget raw "$sdk_settings")"
|
||||
echo "- Lowest SDK supported by this environment is '$sdk_min' based on $sdk_settings"
|
||||
|
||||
# Echo the sane target macOS version based on another build dependency
|
||||
export MACOSX_DEPLOYMENT_TARGET
|
||||
echo "- Exporting 'MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' based on $binary_name"
|
||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -1,14 +1,11 @@
|
||||
/build/
|
||||
/target/
|
||||
/build
|
||||
/target
|
||||
.*.sw?
|
||||
.DS_Store
|
||||
*~
|
||||
/CMakeLists.txt.user
|
||||
/plugins/ZynAddSubFx/zynaddsubfx/ExternalPrograms/Controller/Makefile
|
||||
/plugins/ZynAddSubFx/zynaddsubfx/ExternalPrograms/Spliter/Makefile
|
||||
/plugins/ZynAddSubFx/zynaddsubfx/doc/Makefile
|
||||
/plugins/ZynAddSubFx/zynaddsubfx/doc/gen/Makefile
|
||||
/plugins/zynaddsubfx/zynaddsubfx/ExternalPrograms/Controller/Makefile
|
||||
/plugins/zynaddsubfx/zynaddsubfx/ExternalPrograms/Spliter/Makefile
|
||||
/plugins/zynaddsubfx/zynaddsubfx/doc/Makefile
|
||||
/plugins/zynaddsubfx/zynaddsubfx/doc/gen/Makefile
|
||||
/data/locale/*.qm
|
||||
Brewfile.lock.json
|
||||
/.cache/
|
||||
compile_commands.json
|
||||
|
||||
53
.gitmodules
vendored
53
.gitmodules
vendored
@@ -1,52 +1,9 @@
|
||||
[submodule "src/3rdparty/qt5-x11embed"]
|
||||
path = src/3rdparty/qt5-x11embed
|
||||
url = https://github.com/Lukas-W/qt5-x11embed.git
|
||||
[submodule "plugins/ZynAddSubFx/zynaddsubfx"]
|
||||
path = plugins/ZynAddSubFx/zynaddsubfx
|
||||
url = https://github.com/lmms/zynaddsubfx.git
|
||||
[submodule "plugins/FreeBoy/game-music-emu"]
|
||||
path = plugins/FreeBoy/game-music-emu
|
||||
url = https://github.com/libgme/game-music-emu.git
|
||||
[submodule "plugins/OpulenZ/adplug"]
|
||||
path = plugins/OpulenZ/adplug
|
||||
url = https://github.com/adplug/adplug.git
|
||||
[submodule "plugins/LadspaEffect/calf/veal"]
|
||||
path = plugins/LadspaEffect/calf/veal
|
||||
url = https://github.com/lmms/veal
|
||||
[submodule "plugins/Xpressive/exprtk"]
|
||||
path = plugins/Xpressive/exprtk
|
||||
url = https://github.com/ArashPartow/exprtk
|
||||
branch = release
|
||||
[submodule "plugins/LadspaEffect/swh/ladspa"]
|
||||
path = plugins/LadspaEffect/swh/ladspa
|
||||
url = https://github.com/swh/ladspa
|
||||
[submodule "plugins/LadspaEffect/tap/tap-plugins"]
|
||||
path = plugins/LadspaEffect/tap/tap-plugins
|
||||
url = https://github.com/lmms/tap-plugins
|
||||
[submodule "src/3rdparty/weakjack/weakjack"]
|
||||
path = src/3rdparty/weakjack/weakjack
|
||||
url = https://github.com/x42/weakjack.git
|
||||
[submodule "doc/wiki"]
|
||||
path = doc/wiki
|
||||
url = https://github.com/lmms/lmms.wiki.git
|
||||
[submodule "src/3rdparty/ringbuffer"]
|
||||
path = src/3rdparty/ringbuffer
|
||||
url = https://github.com/JohannesLorenz/ringbuffer.git
|
||||
[submodule "plugins/CarlaBase/carla"]
|
||||
path = plugins/CarlaBase/carla
|
||||
[submodule "src/3rdparty/rpmalloc/rpmalloc"]
|
||||
path = src/3rdparty/rpmalloc/rpmalloc
|
||||
url = https://github.com/rampantpixels/rpmalloc.git
|
||||
[submodule "plugins/carlabase/carla"]
|
||||
path = plugins/carlabase/carla
|
||||
url = https://github.com/falktx/carla
|
||||
[submodule "plugins/Sid/resid/resid"]
|
||||
path = plugins/Sid/resid/resid
|
||||
url = https://github.com/libsidplayfp/resid
|
||||
[submodule "src/3rdparty/jack2"]
|
||||
path = src/3rdparty/jack2
|
||||
url = https://github.com/jackaudio/jack2
|
||||
[submodule "plugins/LadspaEffect/cmt/cmt"]
|
||||
path = plugins/LadspaEffect/cmt/cmt
|
||||
url = https://github.com/lmms/cmt
|
||||
[submodule "src/3rdparty/hiir/hiir"]
|
||||
path = src/3rdparty/hiir/hiir
|
||||
url = https://github.com/LostRobotMusic/hiir
|
||||
[submodule "plugins/MidiImport/portsmf"]
|
||||
path = plugins/MidiImport/portsmf
|
||||
url = https://github.com/portsmf/portsmf
|
||||
|
||||
3
.mailmap
3
.mailmap
@@ -1,4 +1,4 @@
|
||||
Alexandre Almeida <wilsalx@gmail.com>
|
||||
Alexandre Almeida <wilsalx@gmail.com> <meta.lx@hotmail.com>
|
||||
Tobias Junghans <tobias.doerffel@gmail.com>
|
||||
Dave French <dave.french3@googlemail.com>
|
||||
Paul Giblock <drfaygo@gmail.com> <pgib@users.sf.net>
|
||||
@@ -30,4 +30,3 @@ Johannes Lorenz <j.git@lorenz-ho.me> <johannes89@mailueberfall.de>
|
||||
Johannes Lorenz <j.git@lorenz-ho.me> <1042576+JohannesLorenz@users.noreply.github.com>
|
||||
Noah Brecht <noahb2713@gmail.com>
|
||||
Olivier Humbert <trebmuh@tuxfamily.org> <trebmuh@users.noreply.github.com>
|
||||
Hussam al-Homsi <sawuare@gmail.com> Hussam Eddin Alhomsi <hussameddin.alhomsi@gmail.com>
|
||||
|
||||
54
.travis.yml
Normal file
54
.travis.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: xenial
|
||||
sudo: required
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/apt_mingw_cache
|
||||
- $HOME/.ccache
|
||||
- $HOME/pbuilder-bases
|
||||
matrix:
|
||||
include:
|
||||
- env: TARGET_OS=win32
|
||||
dist: trusty
|
||||
- env: TARGET_OS=win64
|
||||
dist: trusty
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
- env: QT5=
|
||||
- env: QT5=True
|
||||
- env: QT5=True TARGET_OS=win32 TARGET_DEPLOY=True
|
||||
dist: trusty
|
||||
- env: QT5=True TARGET_OS=win64 TARGET_DEPLOY=True
|
||||
dist: trusty
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
env: QT5=True
|
||||
- env: TARGET_OS=debian-sid TARGET_DEPLOY=True
|
||||
git:
|
||||
depth: false
|
||||
- env: TARGET_OS=debian-sid TARGET_ARCH=i386
|
||||
git:
|
||||
depth: false
|
||||
- compiler: clang
|
||||
env: TARGET_OS=debian-sid
|
||||
git:
|
||||
depth: false
|
||||
before_install:
|
||||
- . ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.before_install.sh
|
||||
install:
|
||||
- . ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.install.sh
|
||||
before_script:
|
||||
- export CMAKE_FLAGS="-DWANT_QT5=$QT5 -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUNDLE_QT_TRANSLATIONS=ON"
|
||||
- if [ -z "$TRAVIS_TAG" ]; then export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"; fi
|
||||
script:
|
||||
- . ${TRAVIS_BUILD_DIR}/.travis/${TRAVIS_OS_NAME}.${TARGET_OS}.script.sh
|
||||
after_script:
|
||||
- ccache -s
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/1ac7fc698195981a9227
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
on_start: never # options: [always|never|change] default: always
|
||||
1
.travis/ccache.sha256
Normal file
1
.travis/ccache.sha256
Normal file
@@ -0,0 +1 @@
|
||||
0de866bc0ee26de392e037104b174474989a830e2249280a136144baa44557aa ccache_3.2.4-1_amd64.deb
|
||||
3
.travis/debian_pkgs.sha256
Normal file
3
.travis/debian_pkgs.sha256
Normal file
@@ -0,0 +1,3 @@
|
||||
314ef4af137903dfb13e8c3ef1e6ea56cfdb23808d52ec4f5f50e288c73610c5 pbuilder_0.229.1_all.deb
|
||||
fa82aa8ed3055c6f6330104deedf080b26778295e589426d4c4dd0f2c2a5defa debootstrap_1.0.95_all.deb
|
||||
2ef4c09f7841b72f93412803ddd142f72658536dbfabe00e449eb548f432f3f8 debian-archive-keyring_2017.7ubuntu1_all.deb
|
||||
3
.travis/linux..before_install.sh
Normal file
3
.travis/linux..before_install.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update -qq || true
|
||||
19
.travis/linux..install.sh
Normal file
19
.travis/linux..install.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev
|
||||
libasound2-dev libjack-jackd2-dev libsdl-dev libsamplerate0-dev libstk0-dev stk
|
||||
libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev fluid
|
||||
libgig-dev libsoundio-dev"
|
||||
|
||||
VST_PACKAGES="wine-dev libqt5x11extras5-dev qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"
|
||||
|
||||
# Help with unmet dependencies
|
||||
PACKAGES="$PACKAGES $VST_PACKAGES libjack-jackd2-0"
|
||||
|
||||
if [ $QT5 ]; then
|
||||
PACKAGES="$PACKAGES qttools5-dev-tools"
|
||||
else
|
||||
PACKAGES="$PACKAGES libqt4-dev"
|
||||
fi
|
||||
|
||||
sudo apt-get install -y $PACKAGES
|
||||
17
.travis/linux..script.sh
Normal file
17
.travis/linux..script.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if [ $QT5 ]; then
|
||||
unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
|
||||
source /opt/qt59/bin/qt59-env.sh
|
||||
fi
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=../target/ -DUSE_WERROR=ON $CMAKE_FLAGS ..
|
||||
|
||||
make -j4
|
||||
make tests
|
||||
./tests/tests
|
||||
|
||||
make install
|
||||
make appimage
|
||||
2
.travis/linux.debian-sid.before_install.sh
Executable file
2
.travis/linux.debian-sid.before_install.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
sudo apt-get update -qq
|
||||
17
.travis/linux.debian-sid.install.sh
Executable file
17
.travis/linux.debian-sid.install.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
sudo apt-get install -y \
|
||||
dpkg \
|
||||
pbuilder
|
||||
|
||||
# work around a pbuilder bug which breaks ccache
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666525
|
||||
# and also missing signing keys in Trusty's debian-archive-keyring
|
||||
cd /tmp
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/p/pbuilder/pbuilder_0.229.1_all.deb
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.95_all.deb
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/debian-archive-keyring/debian-archive-keyring_2017.7ubuntu1_all.deb
|
||||
sha256sum -c "$TRAVIS_BUILD_DIR/.travis/debian_pkgs.sha256"
|
||||
sudo dpkg -i pbuilder_0.229.1_all.deb debootstrap_1.0.95_all.deb debian-archive-keyring_2017.7ubuntu1_all.deb
|
||||
cd "$OLDPWD"
|
||||
72
.travis/linux.debian-sid.script.sh
Executable file
72
.travis/linux.debian-sid.script.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
: ${TARGET_ARCH:=amd64}
|
||||
|
||||
BASETGZ="$HOME/pbuilder-bases/debian-sid-$TARGET_ARCH.tgz"
|
||||
MIRROR=http://cdn-fastly.deb.debian.org/debian
|
||||
KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg
|
||||
|
||||
if [ -z "$TRAVIS_TAG" ]
|
||||
then
|
||||
sudo \
|
||||
sh -c "echo CCACHEDIR=$HOME/.ccache >> /etc/pbuilderrc"
|
||||
fi
|
||||
|
||||
if [ "$CC" = clang ]
|
||||
then
|
||||
sudo sh -c "echo EXTRAPACKAGES=clang >> /etc/pbuilderrc"
|
||||
fi
|
||||
|
||||
if [ ! -e "$BASETGZ.stamp" ]
|
||||
then
|
||||
mkdir -p "$HOME/pbuilder-bases"
|
||||
sudo pbuilder --create --basetgz "$BASETGZ" --mirror $MIRROR \
|
||||
--distribution sid --architecture $TARGET_ARCH \
|
||||
--debootstrapopts --variant=buildd \
|
||||
--debootstrapopts --keyring=$KEYRING \
|
||||
--debootstrapopts --include=perl
|
||||
touch "$BASETGZ.stamp"
|
||||
else
|
||||
sudo pbuilder --update --basetgz "$BASETGZ"
|
||||
fi
|
||||
|
||||
sync_version() {
|
||||
local VERSION
|
||||
local MMR
|
||||
local STAGE
|
||||
local EXTRA
|
||||
|
||||
VERSION=$(git describe --tags --match v[0-9].[0-9].[0-9]*)
|
||||
VERSION=${VERSION#v}
|
||||
MMR=${VERSION%%-*}
|
||||
case $VERSION in
|
||||
*-*-*-*)
|
||||
VERSION=${VERSION%-*}
|
||||
STAGE=${VERSION#*-}
|
||||
STAGE=${STAGE%-*}
|
||||
EXTRA=${VERSION##*-}
|
||||
VERSION=$MMR~$STAGE.$EXTRA
|
||||
;;
|
||||
*-*-*)
|
||||
VERSION=${VERSION%-*}
|
||||
EXTRA=${VERSION##*-}
|
||||
VERSION=$MMR.$EXTRA
|
||||
;;
|
||||
*-*)
|
||||
STAGE=${VERSION#*-}
|
||||
VERSION=$MMR~$STAGE
|
||||
;;
|
||||
esac
|
||||
|
||||
sed "1 s/@VERSION@/$VERSION/" -i debian/changelog
|
||||
echo Set Debian version to $VERSION
|
||||
}
|
||||
|
||||
sync_version
|
||||
|
||||
DIR="$PWD"
|
||||
cd ..
|
||||
dpkg-source -b "$DIR"
|
||||
env -i CC="$CC" CXX="$CXX" sudo pbuilder --build --debbuildopts "--jobs=auto" \
|
||||
--basetgz "$BASETGZ" ./*.dsc
|
||||
14
.travis/linux.win.download.sh
Normal file
14
.travis/linux.win.download.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
CACHE_DIR=$HOME/apt_mingw_cache/$1
|
||||
mkdir -p $CACHE_DIR
|
||||
|
||||
pushd $CACHE_DIR
|
||||
|
||||
apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list
|
||||
wget -N --input-file downloads.list
|
||||
|
||||
sudo cp ./*.deb /var/cache/apt/archives/
|
||||
|
||||
popd
|
||||
4
.travis/linux.win32.before_install.sh
Normal file
4
.travis/linux.win32.before_install.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y
|
||||
sudo apt-get update -qq
|
||||
31
.travis/linux.win32.install.sh
Normal file
31
.travis/linux.win32.install.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ $QT5 ]; then
|
||||
MINGW_PACKAGES="mingw32-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw32-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk
|
||||
mingw32-x-glib2 mingw32-x-portaudio mingw32-x-libsndfile mingw32-x-fftw
|
||||
mingw32-x-flac mingw32-x-fltk mingw32-x-libsamplerate
|
||||
mingw32-x-pkgconfig mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime
|
||||
mingw32-x-libgig mingw32-x-libsoundio mingw32-x-lame $MINGW_PACKAGES"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win.download.sh win32
|
||||
|
||||
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES"
|
||||
|
||||
sudo apt-get install -y $PACKAGES
|
||||
|
||||
# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake
|
||||
# to use @file command line passing, which in turn ccache 3.1.9 doesn't support
|
||||
pushd /tmp
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.2.4-1_amd64.deb
|
||||
sha256sum -c $TRAVIS_BUILD_DIR/.travis/ccache.sha256
|
||||
sudo dpkg -i ccache_3.2.4-1_amd64.deb
|
||||
popd
|
||||
10
.travis/linux.win32.script.sh
Normal file
10
.travis/linux.win32.script.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw32.sh
|
||||
|
||||
make -j4
|
||||
|
||||
make package
|
||||
3
.travis/linux.win64.before_install.sh
Normal file
3
.travis/linux.win64.before_install.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. .travis/linux.win32.before_install.sh
|
||||
26
.travis/linux.win64.install.sh
Normal file
26
.travis/linux.win64.install.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# First, install 32-bit deps
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win32.install.sh
|
||||
|
||||
|
||||
if [ $QT5 ]; then
|
||||
MINGW_PACKAGES="mingw64-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw64-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk
|
||||
mingw64-x-glib2 mingw64-x-portaudio mingw64-x-libsndfile
|
||||
mingw64-x-fftw mingw64-x-flac mingw64-x-fltk mingw64-x-libsamplerate
|
||||
mingw64-x-pkgconfig mingw64-x-binutils mingw64-x-gcc mingw64-x-runtime
|
||||
mingw64-x-libgig mingw64-x-libsoundio mingw64-x-lame $MINGW_PACKAGES"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
. $DIR/linux.win.download.sh win64
|
||||
|
||||
sudo apt-get install -y $MINGW_PACKAGES
|
||||
10
.travis/linux.win64.script.sh
Normal file
10
.travis/linux.win64.script.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw64.sh
|
||||
|
||||
make -j4
|
||||
|
||||
make package
|
||||
6
.travis/osx..before_install.sh
Normal file
6
.travis/osx..before_install.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
brew update
|
||||
|
||||
# appdmg doesn't work with old versions of Node.js
|
||||
nvm install --lts
|
||||
17
.travis/osx..install.sh
Normal file
17
.travis/osx..install.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PACKAGES="cmake pkgconfig fftw libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk fluid-synth portaudio node fltk carla"
|
||||
|
||||
if [ $QT5 ]; then
|
||||
PACKAGES="$PACKAGES qt5"
|
||||
fi
|
||||
|
||||
brew install $PACKAGES ccache
|
||||
|
||||
if [ -z "$QT5" ]; then
|
||||
brew tap cartr/qt4
|
||||
brew tap-pin cartr/qt4
|
||||
brew install qt@4
|
||||
fi
|
||||
|
||||
npm install -g appdmg
|
||||
17
.travis/osx..script.sh
Normal file
17
.travis/osx..script.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
if [ $QT5 ]; then
|
||||
# Workaround; No FindQt5.cmake module exists
|
||||
export CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
|
||||
fi
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=../target/ $CMAKE_FLAGS -DUSE_WERROR=OFF ..
|
||||
|
||||
make -j4
|
||||
make tests
|
||||
./tests/tests
|
||||
|
||||
make install
|
||||
make dmg
|
||||
@@ -1,10 +1,11 @@
|
||||
[main]
|
||||
host = https://app.transifex.com
|
||||
host = https://www.transifex.com
|
||||
minimum_perc = 51
|
||||
#Need to finish at least 51% before merging back
|
||||
|
||||
[o:lmms:p:lmms:r:lmms]
|
||||
[lmms.lmms]
|
||||
file_filter = data/locale/<lang>.ts
|
||||
source_file = data/locale/en.ts
|
||||
source_lang = en
|
||||
type = QT
|
||||
type = QT
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
rules:
|
||||
line-length:
|
||||
max: 120 # be conforming to LMMS coding rules
|
||||
20
Brewfile
20
Brewfile
@@ -1,20 +0,0 @@
|
||||
brew "carla"
|
||||
brew "ccache"
|
||||
brew "fftw"
|
||||
brew "fltk"
|
||||
brew "fluid-synth"
|
||||
brew "jack"
|
||||
brew "lame"
|
||||
brew "libgig"
|
||||
brew "libogg"
|
||||
brew "libsamplerate"
|
||||
brew "libsndfile"
|
||||
brew "libsoundio"
|
||||
brew "libvorbis"
|
||||
brew "lilv"
|
||||
brew "lv2"
|
||||
brew "pkgconf"
|
||||
brew "portaudio"
|
||||
brew "qt@5"
|
||||
brew "sdl2"
|
||||
brew "stk"
|
||||
696
CMakeLists.txt
696
CMakeLists.txt
@@ -1,53 +1,26 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
|
||||
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# Set the given policy to NEW. If it does not exist, it will not be set. If it
|
||||
# is already set to NEW (most likely due to predating the minimum required CMake
|
||||
# version), a developer warning is emitted indicating that the policy need no
|
||||
# longer be explicitly set.
|
||||
function(enable_policy_if_exists id)
|
||||
if(POLICY "${id}")
|
||||
cmake_policy(GET "${id}" current_value)
|
||||
if(current_value STREQUAL "NEW")
|
||||
message(AUTHOR_WARNING "${id} is now set to NEW by default, and no longer needs to be explicitly set.")
|
||||
else()
|
||||
cmake_policy(SET "${id}" NEW)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
enable_policy_if_exists(CMP0092) # MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.
|
||||
# Needed for ccache support with MSVC
|
||||
enable_policy_if_exists(CMP0141) # MSVC debug information format flags are selected by an abstraction.
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
|
||||
|
||||
PROJECT(lmms)
|
||||
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
|
||||
SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
|
||||
# Import of windows.h breaks min()/max()
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0005 NEW)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
IF (CMAKE_MAJOR_VERSION GREATER 2)
|
||||
CMAKE_POLICY(SET CMP0026 OLD)
|
||||
CMAKE_POLICY(SET CMP0045 NEW)
|
||||
CMAKE_POLICY(SET CMP0050 OLD)
|
||||
ENDIF()
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
# CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is not set correctly for MinGW until
|
||||
# CMake 3.14.1, so avoid specifying system include directories on affected
|
||||
# versions. Normal include directories are safe, since GCC ignores them if they
|
||||
# are already in the built-in search path.
|
||||
if(MINGW AND CMAKE_VERSION VERSION_LESS "3.14.1")
|
||||
set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE)
|
||||
endif()
|
||||
|
||||
INCLUDE(PluginList)
|
||||
INCLUDE(CheckSubmodules)
|
||||
INCLUDE(AddFileDependencies)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(FindPkgConfig)
|
||||
INCLUDE(GenerateExportHeader)
|
||||
include(StaticDependencies)
|
||||
|
||||
STRING(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE)
|
||||
|
||||
SET(PROJECT_YEAR 2026)
|
||||
SET(PROJECT_YEAR 2020)
|
||||
|
||||
SET(PROJECT_AUTHOR "LMMS Developers")
|
||||
SET(PROJECT_URL "https://lmms.io")
|
||||
@@ -55,32 +28,30 @@ SET(PROJECT_EMAIL "lmms-devel@lists.sourceforge.net")
|
||||
SET(PROJECT_DESCRIPTION "${PROJECT_NAME_UCASE} - Free music production software")
|
||||
SET(PROJECT_COPYRIGHT "2008-${PROJECT_YEAR} ${PROJECT_AUTHOR}")
|
||||
SET(VERSION_MAJOR "1")
|
||||
SET(VERSION_MINOR "3")
|
||||
SET(VERSION_RELEASE "0")
|
||||
SET(VERSION_STAGE "alpha")
|
||||
SET(VERSION_BUILD "")
|
||||
SET(VERSION_MINOR "2")
|
||||
SET(VERSION_RELEASE "2")
|
||||
SET(VERSION_STAGE "")
|
||||
SET(VERSION_BUILD "0")
|
||||
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}")
|
||||
IF(VERSION_STAGE)
|
||||
SET(VERSION "${VERSION}-${VERSION_STAGE}")
|
||||
ENDIF()
|
||||
IF(VERSION_BUILD)
|
||||
SET(VERSION "${VERSION}-${VERSION_BUILD}")
|
||||
SET(VERSION "${VERSION}.${VERSION_BUILD}")
|
||||
ENDIF()
|
||||
|
||||
# Override version information for non-base builds
|
||||
INCLUDE(VersionInfo)
|
||||
INCLUDE(DetectMachine)
|
||||
|
||||
|
||||
OPTION(WANT_ALSA "Include ALSA (Advanced Linux Sound Architecture) support" ON)
|
||||
OPTION(WANT_OSS "Include Open Sound System support" ON)
|
||||
OPTION(WANT_CALF "Include CALF LADSPA plugins" ON)
|
||||
OPTION(WANT_CAPS "Include C* Audio Plugin Suite (LADSPA plugins)" ON)
|
||||
OPTION(WANT_CARLA "Include Carla plugin" ON)
|
||||
OPTION(WANT_CMT "Include Computer Music Toolkit LADSPA plugins" ON)
|
||||
OPTION(WANT_JACK "Include JACK (Jack Audio Connection Kit) support" ON)
|
||||
OPTION(WANT_WEAKJACK "Loosely link JACK libraries" ON)
|
||||
OPTION(WANT_LV2 "Include Lv2 plugins" ON)
|
||||
OPTION(WANT_SUIL "Include SUIL for LV2 plugin UIs" ON)
|
||||
OPTION(WANT_MP3LAME "Include MP3/Lame support" ON)
|
||||
OPTION(WANT_OGGVORBIS "Include OGG/Vorbis support" ON)
|
||||
OPTION(WANT_PULSEAUDIO "Include PulseAudio support" ON)
|
||||
@@ -90,36 +61,24 @@ OPTION(WANT_SOUNDIO "Include libsoundio support" ON)
|
||||
OPTION(WANT_SDL "Include SDL (Simple DirectMedia Layer) support" ON)
|
||||
OPTION(WANT_SF2 "Include SoundFont2 player plugin" ON)
|
||||
OPTION(WANT_GIG "Include GIG player plugin" ON)
|
||||
option(WANT_SID "Include Sid instrument" ON)
|
||||
OPTION(WANT_STK "Include Stk (Synthesis Toolkit) support" ON)
|
||||
OPTION(WANT_SWH "Include Steve Harris's LADSPA plugins" ON)
|
||||
OPTION(WANT_TAP "Include Tom's Audio Processing LADSPA plugins" ON)
|
||||
OPTION(WANT_VST "Include VST support" ON)
|
||||
OPTION(WANT_VST_32 "Include 32-bit Windows VST support" ON)
|
||||
OPTION(WANT_VST_64 "Include 64-bit Windows VST support" ON)
|
||||
OPTION(WANT_VST_NOWINE "Include partial VST support (without wine)" OFF)
|
||||
OPTION(WANT_WINMM "Include WinMM MIDI support" OFF)
|
||||
OPTION(WANT_DEBUG_FPE "Debug floating point exceptions" OFF)
|
||||
option(WANT_DEBUG_ASAN "Enable AddressSanitizer" OFF)
|
||||
option(WANT_DEBUG_TSAN "Enable ThreadSanitizer" OFF)
|
||||
option(WANT_DEBUG_MSAN "Enable MemorySanitizer" OFF)
|
||||
option(WANT_DEBUG_UBSAN "Enable UndefinedBehaviorSanitizer" OFF)
|
||||
option(WANT_DEBUG_GPROF "Enable gprof profiler" OFF)
|
||||
OPTION(WANT_QT5 "Build with Qt5" OFF)
|
||||
OPTION(BUNDLE_QT_TRANSLATIONS "Install Qt translation files for LMMS" OFF)
|
||||
option(WANT_DEBUG_CPACK "Show detailed logs for packaging commands" OFF)
|
||||
option(WANT_CPACK_TARBALL "Request CPack to create a tarball instead of an installer" OFF)
|
||||
option(WANT_QT6 "Build with experimental Qt6 support" OFF)
|
||||
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
# Fix linking on 10.14+. See issue #4762 on github
|
||||
LINK_DIRECTORIES("${APPLE_PREFIX}/lib")
|
||||
LINK_DIRECTORIES(/usr/local/lib)
|
||||
SET(WANT_SOUNDIO OFF)
|
||||
SET(WANT_ALSA OFF)
|
||||
SET(WANT_OSS OFF)
|
||||
SET(WANT_PULSEAUDIO OFF)
|
||||
SET(WANT_VST OFF)
|
||||
SET(STATUS_ALSA "<not supported on this platform>")
|
||||
SET(STATUS_OSS "<not supported on this platform>")
|
||||
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
|
||||
SET(STATUS_APPLEMIDI "OK")
|
||||
ELSE(LMMS_BUILD_APPLE)
|
||||
@@ -129,37 +88,43 @@ ENDIF(LMMS_BUILD_APPLE)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(WANT_ALSA OFF)
|
||||
SET(WANT_OSS OFF)
|
||||
SET(WANT_JACK OFF)
|
||||
SET(WANT_PULSEAUDIO OFF)
|
||||
SET(WANT_SNDIO OFF)
|
||||
SET(WANT_SOUNDIO OFF)
|
||||
SET(WANT_WINMM ON)
|
||||
SET(BUNDLE_QT_TRANSLATIONS ON)
|
||||
SET(LMMS_HAVE_WINMM TRUE)
|
||||
if(NOT LMMS_BUILD_WIN64)
|
||||
set(WANT_VST_64 OFF)
|
||||
endif()
|
||||
SET(STATUS_ALSA "<not supported on this platform>")
|
||||
SET(STATUS_OSS "<not supported on this platform>")
|
||||
SET(STATUS_JACK "<not supported on this platform>")
|
||||
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
|
||||
SET(STATUS_SOUNDIO "<disabled in this release>")
|
||||
SET(STATUS_SNDIO "<not supported on this platform>")
|
||||
SET(STATUS_WINMM "OK")
|
||||
SET(STATUS_APPLEMIDI "<not supported on this platform>")
|
||||
ELSE(LMMS_BUILD_WIN32)
|
||||
SET(STATUS_WINMM "<not supported on this platform>")
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# TODO: Fix linking issues with msys debug builds
|
||||
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
SET(WANT_GIG OFF)
|
||||
SET(WANT_STK OFF)
|
||||
SET(WANT_SWH OFF)
|
||||
SET(STATUS_GIG "not built as requested")
|
||||
SET(STATUS_STK "not built as requested")
|
||||
ENDIF()
|
||||
|
||||
|
||||
CHECK_INCLUDE_FILES(stdint.h LMMS_HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILES(stdlib.h LMMS_HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILES(pthread.h LMMS_HAVE_PTHREAD_H)
|
||||
CHECK_INCLUDE_FILES(semaphore.h LMMS_HAVE_SEMAPHORE_H)
|
||||
CHECK_INCLUDE_FILES(unistd.h LMMS_HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILES(sys/types.h LMMS_HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILES(sys/ipc.h LMMS_HAVE_SYS_IPC_H)
|
||||
CHECK_INCLUDE_FILES(sys/shm.h LMMS_HAVE_SYS_SHM_H)
|
||||
CHECK_INCLUDE_FILES(sys/time.h LMMS_HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILES(sys/times.h LMMS_HAVE_SYS_TIMES_H)
|
||||
CHECK_INCLUDE_FILES(sys/prctl.h LMMS_HAVE_SYS_PRCTL_H)
|
||||
CHECK_INCLUDE_FILES(sched.h LMMS_HAVE_SCHED_H)
|
||||
CHECK_INCLUDE_FILES(sys/soundcard.h LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
CHECK_INCLUDE_FILES(soundcard.h LMMS_HAVE_SOUNDCARD_H)
|
||||
@@ -170,131 +135,75 @@ CHECK_INCLUDE_FILES(string.h LMMS_HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILES(process.h LMMS_HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(rt shm_open "" LMMS_HAVE_LIBRT)
|
||||
|
||||
LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if(WANT_QT6)
|
||||
set(QT_VERSION_MAJOR 6)
|
||||
if(MSVC)
|
||||
set(LMMS_QT_MIN_VERSION 6.8.0)
|
||||
else()
|
||||
set(LMMS_QT_MIN_VERSION 6.0.0)
|
||||
endif()
|
||||
set(STATUS_QT6 "Enabled")
|
||||
else()
|
||||
set(QT_VERSION_MAJOR 5)
|
||||
set(LMMS_QT_MIN_VERSION 5.15.0)
|
||||
set(STATUS_QT6 "Disabled")
|
||||
endif()
|
||||
IF(WANT_QT5)
|
||||
SET(QT5 TRUE)
|
||||
|
||||
find_package(Qt${QT_VERSION_MAJOR} ${LMMS_QT_MIN_VERSION} COMPONENTS Core Gui Widgets Xml Svg REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools QUIET)
|
||||
FIND_PACKAGE(Qt5Core REQUIRED)
|
||||
FIND_PACKAGE(Qt5Gui REQUIRED)
|
||||
FIND_PACKAGE(Qt5LinguistTools)
|
||||
FIND_PACKAGE(Qt5Widgets REQUIRED)
|
||||
FIND_PACKAGE(Qt5Xml REQUIRED)
|
||||
|
||||
include_directories(SYSTEM
|
||||
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
|
||||
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
|
||||
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
|
||||
${Qt${QT_VERSION_MAJOR}Xml_INCLUDE_DIRS}
|
||||
)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${Qt5Core_INCLUDE_DIRS}
|
||||
${Qt5Gui_INCLUDE_DIRS}
|
||||
${Qt5Widgets_INCLUDE_DIRS}
|
||||
${Qt5Xml_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(QT_LIBRARIES
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Xml
|
||||
Qt${QT_VERSION_MAJOR}::Svg
|
||||
)
|
||||
SET(QT_LIBRARIES
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Widgets
|
||||
Qt5::Xml
|
||||
)
|
||||
|
||||
IF(LMMS_BUILD_LINUX AND WANT_VST AND NOT WANT_QT6)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
|
||||
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
|
||||
IF(LMMS_BUILD_LINUX AND WANT_VST)
|
||||
FIND_PACKAGE(Qt5X11Extras REQUIRED)
|
||||
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
|
||||
ENDIF()
|
||||
|
||||
# Resolve Qt5::qmake to full path for use in packaging scripts
|
||||
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)
|
||||
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
|
||||
OUTPUT_VARIABLE QT_TRANSLATIONS_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
IF(EXISTS "${QT_TRANSLATIONS_DIR}")
|
||||
MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
|
||||
ADD_DEFINITIONS(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt5Test)
|
||||
SET(QT_QTTEST_LIBRARY Qt5::Test)
|
||||
ELSE()
|
||||
SET(QT5 FALSE)
|
||||
|
||||
# check for Qt4
|
||||
SET(QT_MIN_VERSION "4.6.0" COMPONENTS QtCore QtGui QtXml)
|
||||
FIND_PACKAGE(Qt4 REQUIRED)
|
||||
SET(QT_USE_QTXML 1)
|
||||
IF(WIN32)
|
||||
SET(QT_TRANSLATIONS_DIR "${MINGW_PREFIX}/share/qt4/translations/")
|
||||
ENDIF(WIN32)
|
||||
IF(EXISTS "${QT_TRANSLATIONS_DIR}")
|
||||
MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
|
||||
ADD_DEFINITIONS(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
|
||||
ENDIF()
|
||||
IF(NOT WIN32)
|
||||
STRING(REPLACE "-DQT_DLL" "" QT_DEFINITIONS "${QT_DEFINITIONS}")
|
||||
ENDIF()
|
||||
INCLUDE("${QT_USE_FILE}")
|
||||
ENDIF()
|
||||
|
||||
# Resolve qmake to full path for use in packaging scripts
|
||||
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
|
||||
|
||||
# Find the location of Qt translation files
|
||||
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
|
||||
OUTPUT_VARIABLE QT_TRANSLATIONS_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
IF(EXISTS "${QT_TRANSLATIONS_DIR}")
|
||||
MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
|
||||
ADD_DEFINITIONS("-DQT_TRANSLATIONS_DIR=\"${QT_TRANSLATIONS_DIR}\"")
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt${QT_VERSION_MAJOR}Test)
|
||||
SET(QT_QTTEST_LIBRARY Qt${QT_VERSION_MAJOR}::Test)
|
||||
|
||||
# check for libsndfile
|
||||
FIND_PACKAGE(SndFile REQUIRED)
|
||||
IF(SNDFILE_FOUND)
|
||||
IF(SndFile_VERSION VERSION_GREATER_EQUAL "1.1.0")
|
||||
SET(LMMS_HAVE_SNDFILE_MP3 TRUE)
|
||||
ELSE()
|
||||
MESSAGE("libsndfile version is < 1.1.0; MP3 import disabled")
|
||||
SET(LMMS_HAVE_SNDFILE_MP3 FALSE)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.18 - please install, remove CMakeCache.txt and try again!")
|
||||
ENDIF()
|
||||
# check if we can use SFC_SET_COMPRESSION_LEVEL
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
CHECK_CXX_SOURCE_COMPILES(
|
||||
"#include <sndfile.h>
|
||||
int main() {SFC_SET_COMPRESSION_LEVEL;}"
|
||||
LMMS_HAVE_SF_COMPLEVEL
|
||||
)
|
||||
|
||||
# check for perl
|
||||
if(LMMS_BUILD_APPLE)
|
||||
# Prefer system perl over Homebrew, MacPorts, etc
|
||||
set(Perl_ROOT "/usr/bin")
|
||||
endif()
|
||||
find_package(Perl)
|
||||
|
||||
if(WANT_LV2)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(LV2 lv2)
|
||||
endif()
|
||||
|
||||
find_package(Lilv)
|
||||
if(Lilv_FOUND)
|
||||
set(LILV_LIBRARIES Lilv::lilv)
|
||||
endif()
|
||||
|
||||
# Ensure both dependencies are found
|
||||
if(NOT LV2_FOUND)
|
||||
set(STATUS_LV2 "not found, install lv2 or set PKG_CONFIG_PATH appropriately")
|
||||
elseif(NOT Lilv_FOUND)
|
||||
set(STATUS_LV2 "not found, install lilv or set PKG_CONFIG_PATH appropriately")
|
||||
else()
|
||||
set(LMMS_HAVE_LV2 TRUE)
|
||||
set(STATUS_LV2 "OK")
|
||||
endif()
|
||||
else()
|
||||
set(STATUS_LV2 "not built as requested")
|
||||
endif()
|
||||
|
||||
IF(WANT_SUIL)
|
||||
IF(PKG_CONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(SUIL suil-0)
|
||||
IF(SUIL_FOUND)
|
||||
SET(LMMS_HAVE_SUIL TRUE)
|
||||
SET(STATUS_SUIL "OK")
|
||||
find_package(SuilModules)
|
||||
ELSE()
|
||||
SET(STATUS_SUIL "not found, install it or set PKG_CONFIG_PATH appropriately")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(STATUS_SUIL "not found, requires pkg-config")
|
||||
ENDIF()
|
||||
ELSE(WANT_SUIL)
|
||||
SET(STATUS_SUIL "not built as requested")
|
||||
ENDIF(WANT_SUIL)
|
||||
PKG_CHECK_MODULES(SNDFILE REQUIRED sndfile>=1.0.11)
|
||||
IF(NOT SNDFILE_FOUND)
|
||||
MESSAGE(FATAL_ERROR "LMMS requires libsndfile1 and libsndfile1-dev >= 1.0.11 - please install, remove CMakeCache.txt and try again!")
|
||||
ENDIF(NOT SNDFILE_FOUND)
|
||||
|
||||
IF(WANT_CALF)
|
||||
SET(LMMS_HAVE_CALF TRUE)
|
||||
@@ -318,12 +227,8 @@ ELSE(WANT_CMT)
|
||||
ENDIF(WANT_CMT)
|
||||
|
||||
IF(WANT_SWH)
|
||||
IF(PERL_FOUND)
|
||||
SET(LMMS_HAVE_SWH TRUE)
|
||||
SET(STATUS_SWH "OK")
|
||||
ELSE()
|
||||
SET(STATUS_SWH "Skipping, perl is missing")
|
||||
ENDIF()
|
||||
SET(LMMS_HAVE_SWH TRUE)
|
||||
SET(STATUS_SWH "OK")
|
||||
ELSE(WANT_SWH)
|
||||
SET(STATUS_SWH "not built as requested")
|
||||
ENDIF(WANT_SWH)
|
||||
@@ -353,28 +258,26 @@ IF(WANT_CARLA)
|
||||
ENDIF(WANT_CARLA)
|
||||
|
||||
|
||||
# check for SDL2
|
||||
# check for SDL
|
||||
IF(WANT_SDL)
|
||||
FIND_PACKAGE(SDL2)
|
||||
IF(SDL2_FOUND)
|
||||
SET(SDL_BUILDING_LIBRARY TRUE)
|
||||
FIND_PACKAGE(SDL)
|
||||
IF(SDL_FOUND)
|
||||
SET(LMMS_HAVE_SDL TRUE)
|
||||
SET(STATUS_SDL "OK")
|
||||
SET(SDL2_LIBRARY "SDL2::SDL2")
|
||||
ELSE()
|
||||
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) if you require SDL support")
|
||||
SET(SDL2_LIBRARY "")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ELSE(SDL_FOUND)
|
||||
SET(STATUS_SDL "not found, please install libsdl1.2-dev (or similar) "
|
||||
"if you require SDL support")
|
||||
ENDIF(SDL_FOUND)
|
||||
ENDIF(WANT_SDL)
|
||||
IF(NOT LMMS_HAVE_SDL)
|
||||
SET(SDL_INCLUDE_DIR "")
|
||||
ELSE(NOT LMMS_HAVE_SDL)
|
||||
IF(NOT SDL_INCLUDE_DIR)
|
||||
SET(SDL_INCLUDE_DIR "${CMAKE_FIND_ROOT_PATH}/include")
|
||||
ENDIF(NOT SDL_INCLUDE_DIR)
|
||||
ENDIF(NOT LMMS_HAVE_SDL)
|
||||
|
||||
# check for Sid
|
||||
if(WANT_SID)
|
||||
if(PERL_FOUND)
|
||||
set(LMMS_HAVE_SID TRUE)
|
||||
set(STATUS_SID "OK")
|
||||
else()
|
||||
set(STATUS_SID "not found, please install perl if you require the Sid instrument")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# check for Stk
|
||||
IF(WANT_STK)
|
||||
@@ -393,26 +296,26 @@ ENDIF(WANT_STK)
|
||||
# check for PortAudio
|
||||
IF(WANT_PORTAUDIO)
|
||||
FIND_PACKAGE(Portaudio)
|
||||
IF(Portaudio_FOUND)
|
||||
IF(PORTAUDIO_FOUND)
|
||||
SET(LMMS_HAVE_PORTAUDIO TRUE)
|
||||
SET(STATUS_PORTAUDIO "OK")
|
||||
ELSE()
|
||||
ELSE(PORTAUDIO_FOUND)
|
||||
SET(STATUS_PORTAUDIO "not found, please install portaudio19-dev (or similar, version >= 1.9) "
|
||||
"if you require PortAudio support")
|
||||
ENDIF()
|
||||
ENDIF(PORTAUDIO_FOUND)
|
||||
ENDIF(WANT_PORTAUDIO)
|
||||
|
||||
# check for libsoundio
|
||||
IF(WANT_SOUNDIO)
|
||||
FIND_PACKAGE(SoundIo)
|
||||
IF(SOUNDIO_FOUND)
|
||||
SET(LMMS_HAVE_SOUNDIO TRUE)
|
||||
SET(STATUS_SOUNDIO "OK")
|
||||
include_directories(SYSTEM "${SOUNDIO_INCLUDE_DIR}")
|
||||
SET(LMMS_HAVE_SOUNDIO TRUE)
|
||||
SET(STATUS_SOUNDIO "OK")
|
||||
INCLUDE_DIRECTORIES("${SOUNDIO_INCLUDE_DIR}")
|
||||
ELSE(SOUNDIO_FOUND)
|
||||
SET(SOUNDIO_INCLUDE_DIR "")
|
||||
SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support")
|
||||
SET(SOUNDIO_LIBRARY "")
|
||||
SET(SOUNDIO_INCLUDE_DIR "")
|
||||
SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support")
|
||||
SET(SOUNDIO_LIBRARY "")
|
||||
ENDIF(SOUNDIO_FOUND)
|
||||
ENDIF(WANT_SOUNDIO)
|
||||
|
||||
@@ -442,6 +345,8 @@ IF(WANT_MP3LAME)
|
||||
SET(STATUS_MP3LAME "OK")
|
||||
ELSE(LAME_FOUND)
|
||||
SET(STATUS_MP3LAME "not found, please install libmp3lame-dev (or similar)")
|
||||
SET(LAME_LIBRARIES "")
|
||||
SET(LAME_INCLUDE_DIRS "")
|
||||
ENDIF(LAME_FOUND)
|
||||
ELSE(WANT_MP3LAME)
|
||||
SET(STATUS_MP3LAME "Disabled for build")
|
||||
@@ -460,13 +365,13 @@ IF(WANT_OGGVORBIS)
|
||||
ENDIF(WANT_OGGVORBIS)
|
||||
|
||||
|
||||
# check for OSS
|
||||
IF(WANT_OSS AND (LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H))
|
||||
# check whether to enable OSS-support
|
||||
IF(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
SET(LMMS_HAVE_OSS TRUE)
|
||||
SET(STATUS_OSS "OK")
|
||||
ELSEIF(WANT_OSS)
|
||||
ELSE(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
SET(STATUS_OSS "<not found or not supported on this platform>")
|
||||
ENDIF()
|
||||
ENDIF(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
|
||||
|
||||
# check for ALSA
|
||||
@@ -487,65 +392,43 @@ ENDIF(NOT LMMS_HAVE_ALSA)
|
||||
|
||||
# check for JACK
|
||||
IF(WANT_JACK)
|
||||
IF(WANT_WEAKJACK)
|
||||
SET(LMMS_HAVE_WEAKJACK TRUE)
|
||||
SET(STATUS_JACK "OK (weak linking enabled)")
|
||||
set(JACK_INCLUDE_DIRS "")
|
||||
set(JACK_LIBRARIES weakjack)
|
||||
SET(LMMS_HAVE_JACK TRUE)
|
||||
SET(LMMS_HAVE_JACK_PRENAME TRUE)
|
||||
SET(JACK_FOUND TRUE)
|
||||
ELSE()
|
||||
PKG_CHECK_MODULES(JACK jack>=0.77)
|
||||
IF(JACK_FOUND)
|
||||
SET(LMMS_HAVE_JACK TRUE)
|
||||
PKG_CHECK_MODULES(JACK jack>=0.77)
|
||||
IF(JACK_FOUND)
|
||||
IF(WANT_WEAKJACK)
|
||||
SET(LMMS_HAVE_WEAKJACK TRUE)
|
||||
SET(STATUS_JACK "OK (weak linking enabled)")
|
||||
SET(JACK_INCLUDE_DIRS "")
|
||||
# use dlsym instead
|
||||
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
ELSE()
|
||||
SET(STATUS_JACK "OK")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES_BACKUP "${CMAKE_REQUIRED_LIBRARIES}")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${JACK_LIBRARIES}")
|
||||
CHECK_LIBRARY_EXISTS(jack jack_port_rename "" LMMS_HAVE_JACK_PRENAME)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_BACKUP}")
|
||||
UNSET(CMAKE_REQUIRED_LIBRARIES_BACKUP)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT JACK_FOUND)
|
||||
SET(JACK_INCLUDE_DIRS "")
|
||||
SET(STATUS_JACK "not found")
|
||||
ENDIF()
|
||||
SET(LMMS_HAVE_JACK TRUE)
|
||||
ELSE(JACK_FOUND)
|
||||
SET(STATUS_JACK "not found, please install libjack0.100.0-dev (or similar) "
|
||||
"if you require JACK support")
|
||||
ENDIF(JACK_FOUND)
|
||||
ENDIF(WANT_JACK)
|
||||
|
||||
|
||||
# check for FFTW3F-library
|
||||
FIND_PACKAGE(FFTW COMPONENTS fftw3f REQUIRED)
|
||||
PKG_CHECK_MODULES(FFTW3F REQUIRED fftw3f>=3.0.0)
|
||||
|
||||
|
||||
# check for FLTK
|
||||
set(FLTK_SKIP_OPENGL TRUE)
|
||||
set(FLTK_SKIP_FORMS TRUE)
|
||||
set(FLTK_SKIP_IMAGES TRUE)
|
||||
set(FLTK_SKIP_MATH TRUE)
|
||||
if(MINGW_PREFIX)
|
||||
set(FLTK_SKIP_FLUID TRUE)
|
||||
endif()
|
||||
FIND_PACKAGE(FLTK)
|
||||
IF(FLTK_FOUND)
|
||||
SET(STATUS_ZYN "OK")
|
||||
ELSE()
|
||||
SET(STATUS_ZYN "not found, please install fltk")
|
||||
ENDIF()
|
||||
|
||||
|
||||
# check for Fluidsynth
|
||||
IF(WANT_SF2)
|
||||
find_package(FluidSynth 1.1.7)
|
||||
if(FluidSynth_FOUND)
|
||||
PKG_CHECK_MODULES(FLUIDSYNTH fluidsynth>=1.0.7)
|
||||
IF(FLUIDSYNTH_FOUND)
|
||||
SET(LMMS_HAVE_FLUIDSYNTH TRUE)
|
||||
if(FluidSynth_VERSION_STRING VERSION_GREATER_EQUAL 2)
|
||||
set(STATUS_FLUIDSYNTH "OK")
|
||||
else()
|
||||
set(STATUS_FLUIDSYNTH "OK (FluidSynth version < 2: per-note panning unsupported)")
|
||||
endif()
|
||||
else()
|
||||
SET(STATUS_FLUIDSYNTH "OK")
|
||||
ELSE(FLUIDSYNTH_FOUND)
|
||||
SET(STATUS_FLUIDSYNTH "not found, libfluidsynth-dev (or similar)"
|
||||
"is highly recommended")
|
||||
endif()
|
||||
ENDIF(FLUIDSYNTH_FOUND)
|
||||
ENDIF(WANT_SF2)
|
||||
|
||||
# check for libgig
|
||||
@@ -560,11 +443,10 @@ If(WANT_GIG)
|
||||
ENDIF(WANT_GIG)
|
||||
|
||||
# check for pthreads
|
||||
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD OR LMMS_BUILD_HAIKU)
|
||||
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD)
|
||||
FIND_PACKAGE(Threads)
|
||||
ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD OR LMMS_BUILD_HAIKU)
|
||||
ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD)
|
||||
|
||||
# check for sndio (roaraudio won't work yet)
|
||||
IF(WANT_SNDIO)
|
||||
FIND_PACKAGE(Sndio)
|
||||
IF(SNDIO_FOUND)
|
||||
@@ -576,103 +458,56 @@ IF(WANT_SNDIO)
|
||||
ENDIF(WANT_SNDIO)
|
||||
|
||||
# check for WINE
|
||||
if(WANT_VST)
|
||||
if((WANT_VST_32 OR WANT_VST_64) AND NOT LMMS_BUILD_WIN32)
|
||||
find_package(Wine)
|
||||
include(CheckWineGcc)
|
||||
endif()
|
||||
macro(check_vst bits)
|
||||
if(NOT WANT_VST_${bits})
|
||||
set(STATUS_VST_${bits} "Not built, as requested")
|
||||
elseif(LMMS_BUILD_WIN32)
|
||||
set(STATUS_VST_${bits} "OK")
|
||||
set(LMMS_HAVE_VST_${bits} TRUE)
|
||||
elseif(NOT WINE_FOUND)
|
||||
set(STATUS_VST_${bits} "not found, please install (lib)wine-dev (or similar) - 64 bit systems additionally need gcc-multilib and g++-multilib")
|
||||
else()
|
||||
CheckWineGcc("${bits}" "${WINEGCC}" WINEGCC_WORKING)
|
||||
if(WINEGCC_WORKING)
|
||||
set(LMMS_HAVE_VST_${bits} TRUE)
|
||||
if(WINE_LIBRARY_FIX)
|
||||
set(STATUS_VST_${bits} "OK, with workaround linking ${WINE_LIBRARY_FIX}")
|
||||
else()
|
||||
set(STATUS_VST_${bits} "OK")
|
||||
endif()
|
||||
else()
|
||||
set(STATUS_VST_${bits} "winegcc fails to compile ${bits}-bit binaries, please make sure you have ${bits}-bit GCC libraries")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
check_vst(32)
|
||||
check_vst(64)
|
||||
if(LMMS_HAVE_VST_32 OR LMMS_HAVE_VST_64 OR LMMS_BUILD_LINUX)
|
||||
set(LMMS_HAVE_VST TRUE)
|
||||
set(STATUS_VST "OK")
|
||||
else()
|
||||
set(STATUS_VST "No hosts selected and available")
|
||||
endif()
|
||||
if(WINE_ASLR_ENABLED)
|
||||
set(STATUS_VST_64 "${STATUS_VST_64}\n\tWARNING: You are using wine ${WINE_VERSION} which cannot disable ASLR, please consider upgrading to wine 10.14 or higher. ASLR may cause crashes with older VSTs.")
|
||||
endif()
|
||||
endif()
|
||||
IF(WANT_VST)
|
||||
FIND_PACKAGE(Wine)
|
||||
IF(WINE_FOUND)
|
||||
SET(LMMS_SUPPORT_VST TRUE)
|
||||
IF(WINE_LIBRARY_FIX)
|
||||
SET(STATUS_VST "OK, with workaround linking ${WINE_LIBRARY_FIX}")
|
||||
ELSE()
|
||||
SET(STATUS_VST "OK")
|
||||
ENDIF()
|
||||
ELSEIF(WANT_VST_NOWINE)
|
||||
SET(LMMS_SUPPORT_VST TRUE)
|
||||
SET(STATUS_VST "OK")
|
||||
ELSE(WINE_FOUND)
|
||||
SET(STATUS_VST "not found, please install (lib)wine-dev (or similar) - 64 bit systems additionally need gcc-multilib and g++-multilib")
|
||||
ENDIF(WINE_FOUND)
|
||||
ENDIF(WANT_VST)
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(LMMS_SUPPORT_VST TRUE)
|
||||
SET(STATUS_VST "OK")
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
IF(WANT_DEBUG_FPE)
|
||||
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)
|
||||
SET(LMMS_DEBUG_FPE TRUE)
|
||||
SET (STATUS_DEBUG_FPE "Enabled")
|
||||
ELSE()
|
||||
SET (STATUS_DEBUG_FPE "Wanted but disabled due to unsupported platform")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET (STATUS_DEBUG_FPE "Disabled")
|
||||
ENDIF(WANT_DEBUG_FPE)
|
||||
|
||||
if(WANT_DEBUG_CPACK)
|
||||
if((LMMS_BUILD_WIN32 AND CMAKE_VERSION VERSION_LESS "3.19") OR WANT_CPACK_TARBALL)
|
||||
set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration")
|
||||
else()
|
||||
set(CPACK_DEBUG TRUE)
|
||||
set(STATUS_DEBUG_CPACK "Enabled")
|
||||
endif()
|
||||
else()
|
||||
set(STATUS_DEBUG_CPACK "Disabled")
|
||||
endif()
|
||||
|
||||
# check for libsamplerate
|
||||
FIND_PACKAGE(Samplerate 0.1.8 MODULE REQUIRED)
|
||||
PKG_CHECK_MODULES(SAMPLERATE REQUIRED samplerate>=0.1.8)
|
||||
|
||||
# set compiler flags
|
||||
SET(WERROR_FLAGS "-Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow")
|
||||
OPTION(USE_WERROR "Add -werror to the build flags. Stops the build on warnings" OFF)
|
||||
IF(${USE_WERROR})
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
|
||||
# Due to a regression in gcc-4.8.X, we need to disable array-bounds check
|
||||
IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32))
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds -Wno-attributes")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "Setting build type to 'Release' as none was specified.")
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
|
||||
# Set the possible values of build type for cmake-gui
|
||||
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
|
||||
"MinSizeRel" "RelWithDebInfo")
|
||||
"MinSizeRel" "RelWithDebInfo")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "-fno-exceptions ${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_definitions(NDEBUG)
|
||||
SET(STATUS_ASSERTIONS "Disabled")
|
||||
else()
|
||||
remove_definitions(-DNDEBUG)
|
||||
SET(STATUS_ASSERTIONS "Enabled")
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
|
||||
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "true")
|
||||
else()
|
||||
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "echo")
|
||||
endif()
|
||||
|
||||
if(STRIP)
|
||||
# TODO CMake 3.19: Now that CONFIG generator expressions support testing for
|
||||
# multiple configurations, combine the OR into a single CONFIG expression.
|
||||
set(STRIP_COMMAND "$<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>,${NOOP_COMMAND},${STRIP}>")
|
||||
else()
|
||||
set(STRIP_COMMAND "${NOOP_COMMAND}")
|
||||
endif()
|
||||
|
||||
# people simply updating git will still have this and mess up build with it
|
||||
FILE(REMOVE include/lmmsconfig.h)
|
||||
@@ -696,62 +531,38 @@ IF(GIT_FOUND AND NOT CONTRIBUTORS)
|
||||
TIMEOUT 1)
|
||||
ENDIF()
|
||||
|
||||
# embedded resources stuff
|
||||
IF(WIN32 OR WIN64)
|
||||
# compile buildtools native
|
||||
SET(BIN2RES_CPP "${CMAKE_SOURCE_DIR}/buildtools/bin2res.cpp")
|
||||
SET(BIN2RES "${CMAKE_BINARY_DIR}/bin2res")
|
||||
ADD_CUSTOM_TARGET(bin2res COMMAND g++ "\"${BIN2RES_CPP}\"" -o "\"${BIN2RES}\"" DEPENDS "${BIN2RES_CPP}")
|
||||
ELSE(WIN32 OR WIN64)
|
||||
ADD_EXECUTABLE(bin2res buildtools/bin2res.cpp)
|
||||
GET_TARGET_PROPERTY(BIN2RES bin2res LOCATION)
|
||||
ENDIF(WIN32 OR WIN64)
|
||||
|
||||
# we somehow have to make LMMS-binary depend on MOC-files
|
||||
ADD_FILE_DEPENDENCIES("${CMAKE_BINARY_DIR}/lmmsconfig.h")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
elseif(MSVC)
|
||||
# Use UTF-8 as the source and execution character set
|
||||
add_compile_options("/utf-8")
|
||||
ENDIF()
|
||||
|
||||
# gcc builds support gprof for profiling
|
||||
# clang too seems to support gprof, but i couldn't get it working.
|
||||
# if needed, change the if condition to "GNU|CLANG"
|
||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(STATUS_GPROF ", NOT SUPPORTED BY THIS COMPILER")
|
||||
set(WANT_DEBUG_GPROF OFF)
|
||||
endif()
|
||||
|
||||
if(WANT_DEBUG_GPROF)
|
||||
add_compile_options(-pg)
|
||||
add_link_options(-pg)
|
||||
set(STATUS_GPROF "OK")
|
||||
else()
|
||||
set(STATUS_GPROF "Disabled ${STATUS_GPROF}")
|
||||
endif()
|
||||
|
||||
# add enabled sanitizers
|
||||
function(add_sanitizer sanitizer supported_compilers want_flag status_flag)
|
||||
if(${want_flag})
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "${supported_compilers}")
|
||||
set("${status_flag}" "Enabled" PARENT_SCOPE)
|
||||
string(REPLACE ";" " " additional_flags "${ARGN}")
|
||||
# todo CMake 3.13: use add_compile_options/add_link_options instead
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=${sanitizer} ${additional_flags}" PARENT_SCOPE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=${sanitizer} ${additional_flags}" PARENT_SCOPE)
|
||||
else()
|
||||
set("${status_flag}" "Wanted but disabled due to unsupported compiler" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
set("${status_flag}" "Disabled" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_sanitizer(address "GNU|Clang|MSVC" WANT_DEBUG_ASAN STATUS_DEBUG_ASAN)
|
||||
add_sanitizer(thread "GNU|Clang" WANT_DEBUG_TSAN STATUS_DEBUG_TSAN)
|
||||
add_sanitizer(memory "Clang" WANT_DEBUG_MSAN STATUS_DEBUG_MSAN -fno-omit-frame-pointer)
|
||||
# UBSan does not link with vptr enabled due to a problem with references from PeakControllerEffect
|
||||
# not being found by PeakController
|
||||
add_sanitizer(undefined "GNU|Clang" WANT_DEBUG_UBSAN STATUS_DEBUG_UBSAN -fno-sanitize=vptr)
|
||||
|
||||
# Add warning and error flags
|
||||
include(ErrorFlags)
|
||||
IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# use ccache
|
||||
include(CompileCache)
|
||||
OPTION(USE_CCACHE "Use ccache for compilation" OFF)
|
||||
IF(USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE ccache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using ccache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE()
|
||||
MESSAGE(WARNING "USE_CCACHE enabled, but no ccache found")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# make sub-directories
|
||||
ADD_SUBDIRECTORY(cmake)
|
||||
@@ -761,23 +572,18 @@ ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(data)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
|
||||
# install tasks
|
||||
ADD_SUBDIRECTORY(cmake/install)
|
||||
# post-install tasks
|
||||
ADD_SUBDIRECTORY(cmake/postinstall)
|
||||
|
||||
FIND_PACKAGE(UnixCommands)
|
||||
IF(GZIP)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/lmms.1.gz"
|
||||
COMMAND ${GZIP} -c ${CMAKE_SOURCE_DIR}/doc/lmms.1 > ${CMAKE_BINARY_DIR}/lmms.1.gz
|
||||
DEPENDS "${CMAKE_SOURCE_DIR}/doc/lmms.1"
|
||||
COMMENT "Generating lmms.1.gz"
|
||||
VERBATIM)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/lmms.1.gz"
|
||||
COMMAND gzip -c ${CMAKE_SOURCE_DIR}/doc/lmms.1 > ${CMAKE_BINARY_DIR}/lmms.1.gz
|
||||
DEPENDS "${CMAKE_SOURCE_DIR}/doc/lmms.1"
|
||||
COMMENT "Generating lmms.1.gz"
|
||||
VERBATIM)
|
||||
|
||||
|
||||
ADD_CUSTOM_TARGET(manpage ALL
|
||||
DEPENDS "${CMAKE_BINARY_DIR}/lmms.1.gz")
|
||||
ELSEIF(UNIX)
|
||||
MESSAGE(FATAL_ERROR "Can't find gzip required for generating lmms.1.gz")
|
||||
ENDIF()
|
||||
ADD_CUSTOM_TARGET(manpage ALL
|
||||
DEPENDS "${CMAKE_BINARY_DIR}/lmms.1.gz")
|
||||
|
||||
# install headers
|
||||
|
||||
@@ -786,9 +592,21 @@ IF(LMMS_BUILD_LINUX)
|
||||
"${CMAKE_BINARY_DIR}/lmmsconfig.h"
|
||||
"${CMAKE_BINARY_DIR}/lmmsversion.h"
|
||||
"${CMAKE_SOURCE_DIR}/src/gui/embed.cpp"
|
||||
DESTINATION "include/lmms/")
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/lmms/")
|
||||
ENDIF(LMMS_BUILD_LINUX)
|
||||
|
||||
# package ZynAddSubFX into win32 build
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/extras")
|
||||
ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/extras/data/presets")
|
||||
FILE(GLOB ZASF_BINARIES
|
||||
"${CMAKE_SOURCE_DIR}/extras/plugins/zynaddsubfx/zynaddsubfx.dll"
|
||||
"${CMAKE_SOURCE_DIR}/extras/plugins/zynaddsubfx/remote_zynaddsubfx.exe")
|
||||
LIST(SORT ZASF_BINARIES)
|
||||
INSTALL(FILES "${ZASF_BINARIES}" DESTINATION "${PLUGIN_DIR}")
|
||||
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/extras")
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
#
|
||||
# add distclean-target
|
||||
#
|
||||
@@ -810,14 +628,6 @@ ADD_CUSTOM_TARGET(dist
|
||||
COMMAND tar cjf lmms-${VERSION}-src.tar.bz2 "${TMP}"
|
||||
COMMAND rm -rf "${TMP}")
|
||||
|
||||
|
||||
#
|
||||
# add uninstall-target
|
||||
#
|
||||
ADD_CUSTOM_TARGET(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake"
|
||||
)
|
||||
|
||||
#
|
||||
# display configuration information
|
||||
#
|
||||
@@ -856,7 +666,6 @@ MESSAGE(
|
||||
"Supported file formats for project export\n"
|
||||
"-----------------------------------------\n"
|
||||
"* WAVE : OK\n"
|
||||
"* FLAC : OK\n"
|
||||
"* OGG/VORBIS : ${STATUS_OGGVORBIS}\n"
|
||||
"* MP3/Lame : ${STATUS_MP3LAME}\n"
|
||||
)
|
||||
@@ -864,16 +673,11 @@ MESSAGE(
|
||||
MESSAGE(
|
||||
"Optional plugins\n"
|
||||
"----------------\n"
|
||||
"* Lv2 plugins : ${STATUS_LV2}\n"
|
||||
"* SUIL for plugin UIs : ${STATUS_SUIL}\n"
|
||||
"* ZynAddSubFX instrument : ${STATUS_ZYN}\n"
|
||||
"* Carla Patchbay & Rack : ${STATUS_CARLA}\n"
|
||||
"* SoundFont2 player : ${STATUS_FLUIDSYNTH}\n"
|
||||
"* Sid instrument : ${STATUS_SID}\n"
|
||||
"* Stk Mallets : ${STATUS_STK}\n"
|
||||
"* VST plugin host : ${STATUS_VST}\n"
|
||||
" * 32-bit Windows host : ${STATUS_VST_32}\n"
|
||||
" * 64-bit Windows host : ${STATUS_VST_64}\n"
|
||||
"* VST-instrument hoster : ${STATUS_VST}\n"
|
||||
"* VST-effect hoster : ${STATUS_VST}\n"
|
||||
"* CALF LADSPA plugins : ${STATUS_CALF}\n"
|
||||
"* CAPS LADSPA plugins : ${STATUS_CAPS}\n"
|
||||
"* CMT LADSPA plugins : ${STATUS_CMT}\n"
|
||||
@@ -882,20 +686,6 @@ MESSAGE(
|
||||
"* GIG player : ${STATUS_GIG}\n"
|
||||
)
|
||||
|
||||
MESSAGE(
|
||||
"Developer options\n"
|
||||
"-----------------------------------------\n"
|
||||
"* Debug FP exceptions : ${STATUS_DEBUG_FPE}\n"
|
||||
"* Debug using AddressSanitizer : ${STATUS_DEBUG_ASAN}\n"
|
||||
"* Debug using ThreadSanitizer : ${STATUS_DEBUG_TSAN}\n"
|
||||
"* Debug using MemorySanitizer : ${STATUS_DEBUG_MSAN}\n"
|
||||
"* Debug using UBSanitizer : ${STATUS_DEBUG_UBSAN}\n"
|
||||
"* Debug packaging commands : ${STATUS_DEBUG_CPACK}\n"
|
||||
"* Profile using GNU profiler : ${STATUS_GPROF}\n"
|
||||
"* Debug assertions : ${STATUS_ASSERTIONS}\n"
|
||||
"* Experimental Qt6 support : ${STATUS_QT6}\n"
|
||||
)
|
||||
|
||||
MESSAGE(
|
||||
"\n"
|
||||
"-----------------------------------------------------------------\n"
|
||||
@@ -905,10 +695,4 @@ MESSAGE(
|
||||
"-----------------------------------------------------------------\n"
|
||||
"\n\n")
|
||||
|
||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_DIR}")
|
||||
if(MSVC)
|
||||
# We can't set this on the install time according to the configuration
|
||||
SET(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
|
||||
SET(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
|
||||
endif()
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
|
||||
69
INSTALL.txt
69
INSTALL.txt
@@ -1,28 +1,16 @@
|
||||
This project uses git submodules and several are required for a successful
|
||||
build. If this tarball was NOT provided with submodules (default), some source
|
||||
dependencies will need to be manually added to src/3rdparty.
|
||||
Building LMMS got quite simple since 0.4.0 as everything is managed
|
||||
by cmake now. Therefore make sure you have CMake (>= 2.6.0 recommended) and
|
||||
then run
|
||||
|
||||
If this project WAS provided with submodules, there are detailed dependencies
|
||||
(e.g. supported compilers, cmake requirements, cross-compilation) at
|
||||
doc/wiki/Compiling.md including platform-specific build instructions (e.g.
|
||||
apt-get, dnf, pacman, etc).
|
||||
|
||||
Online documentation:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../
|
||||
make
|
||||
sudo make install
|
||||
|
||||
https://github.com/LMMS/lmms/wiki/
|
||||
|
||||
Live online chat via Discord (similar to IRC):
|
||||
|
||||
https://lmms.io/chat, Channel #programming
|
||||
|
||||
Basic build steps:
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ../
|
||||
make
|
||||
sudo make install
|
||||
# or alternately: su -c 'make install'
|
||||
If your system does not have "sudo", become root with your preferred mechanism
|
||||
and run the "make install" command.
|
||||
|
||||
With the above commands an out-of-tree build is performed. You can also run
|
||||
"cmake ." directly in the root of source tree although this is not recommended.
|
||||
@@ -37,31 +25,24 @@ that are going to be built into LMMS or built as plugins. Install the
|
||||
according libraries and development files if a certain feature is not enabled.
|
||||
Then remove CMakeCache.txt and run cmake again.
|
||||
|
||||
For non-root installs, or to install to a non-standard location, provide an
|
||||
install prefix to cmake, using the flag:
|
||||
If you want to supply an install prefix to cmake, add the flag:
|
||||
|
||||
-DCMAKE_INSTALL_PREFIX=<prefix>
|
||||
-DCMAKE_INSTALL_PREFIX=<prefix>
|
||||
|
||||
The Compilation tutorial (see docs/wiki/Compilation.md)
|
||||
specifically uses <prefix> as "../target" for all non-root installations. This
|
||||
is strongly recommended if developing a patch or a feature. For root
|
||||
installations, <prefix> can be /usr, /usr/local, /opt, etc. For most systems,
|
||||
the default is /usr/local.
|
||||
Where <prefix> can be /usr, /usr/local, /opt, etc. The default is /usr/local.
|
||||
|
||||
|
||||
|
||||
Building with QT5
|
||||
|
||||
First of all please note that CMake >= 2.8.11 is required for building with
|
||||
Qt5 support. In order to build LMMS with Qt5, add the following flag when
|
||||
invoking cmake:
|
||||
|
||||
-DWANT_QT5=ON
|
||||
|
||||
If your Qt5 installation does not reside in standard installation paths,
|
||||
additionally pass:
|
||||
additionally pass e.g.
|
||||
|
||||
-DCMAKE_PREFIX_PATH=<prefix>
|
||||
-DCMAKE_PREFIX_PATH=/opt/qt53/
|
||||
|
||||
Where <prefix> is the location to Qt5 installation, usually /opt/qt5/, etc.
|
||||
|
||||
Important wiki sections:
|
||||
|
||||
doc/wiki/Compiling.md:
|
||||
Dependencies Detailed
|
||||
- Build Toolchain (cmake)
|
||||
- Compiler (gcc, clang)
|
||||
- Libraries (required and optional dependencies)
|
||||
|
||||
doc/wiki/Dependencies-<platform>.md
|
||||
Platform-specific dependencies (Windows, Ubuntu, Fedora, macOS, etc.)
|
||||
|
||||
72
README.md
72
README.md
@@ -1,57 +1,59 @@
|
||||
<div align="center">
|
||||
<h1>
|
||||
<img src="https://raw.githubusercontent.com/LMMS/artwork/master/Icon%20%26%20Mimetypes/lmms-64x64.svg" alt="LMMS Logo"><br>LMMS
|
||||
</h1>
|
||||
<p>Cross-platform music production software</p>
|
||||
<p>
|
||||
<a href="https://lmms.io/">Website</a>
|
||||
⦁︎
|
||||
<a href="https://github.com/LMMS/lmms/releases">Releases</a>
|
||||
⦁︎
|
||||
<a href="https://github.com/LMMS/lmms/wiki">Developer wiki</a>
|
||||
⦁︎
|
||||
<a href="https://lmms.io/documentation">User manual</a>
|
||||
⦁︎
|
||||
<a href="https://lmms.io/showcase/">Showcase</a>
|
||||
⦁︎
|
||||
<a href="https://lmms.io/lsp/">Sharing platform</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://github.com/LMMS/lmms/actions/workflows/build.yml"><img src="https://github.com/LMMS/lmms/actions/workflows/build.yml/badge.svg" alt="Build status"></a>
|
||||
<a href="https://lmms.io/download"><img src="https://img.shields.io/github/release/LMMS/lmms.svg?maxAge=3600" alt="Latest stable release"></a>
|
||||
<a href="https://github.com/LMMS/lmms/releases"><img src="https://img.shields.io/github/downloads/LMMS/lmms/total.svg?maxAge=3600" alt="Overall downloads on Github"></a>
|
||||
<a href="https://discord.gg/3sc5su7"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Join the chat at Discord"></a>
|
||||
<a href="https://www.transifex.com/lmms/lmms/"><img src="https://img.shields.io/badge/localise-on_transifex-green.svg"></a>
|
||||
</p>
|
||||
</div>
|
||||
#  LMMS
|
||||
|
||||
[](https://travis-ci.org/LMMS/lmms)
|
||||
[](https://lmms.io/download)
|
||||
[](https://github.com/LMMS/lmms/releases)
|
||||
[](https://discord.gg/3sc5su7)
|
||||
[](https://www.transifex.com/lmms/lmms/)
|
||||
|
||||
What is LMMS?
|
||||
--------------
|
||||
|
||||
LMMS is an open-source cross-platform digital audio workstation designed for music production. It includes an advanced Piano Roll, Beat Sequencer, Song Editor, and Mixer for composing, arranging, and mixing music. It comes with 15+ synthesizer plugins by default, along with VST2 and SoundFont2 support.
|
||||
LMMS is a free cross-platform alternative to commercial programs like
|
||||
FL Studio®, which allow you to produce music with your computer. This includes
|
||||
the creation of melodies and beats, the synthesis and mixing of sounds, and
|
||||
arranging of samples. You can have fun with your MIDI-keyboard and much more;
|
||||
all in a user-friendly and modern interface.
|
||||
|
||||
[Homepage](https://lmms.io)<br>
|
||||
[Downloads/Releases](https://github.com/LMMS/lmms/releases)<br>
|
||||
[Developer Wiki](https://github.com/LMMS/lmms/wiki)<br>
|
||||
[Artist & User Wiki/Documentation](https://lmms.io/documentation)<br>
|
||||
[Sound Demos](https://lmms.io/showcase/)<br>
|
||||
[LMMS Sharing Platform](https://lmms.io/lsp/) Share your songs!
|
||||
|
||||
Features
|
||||
---------
|
||||
|
||||
* Song-Editor for arranging melodies, samples, patterns, and automation
|
||||
* Pattern-Editor for creating beats and patterns
|
||||
* Song-Editor for composing songs
|
||||
* A Beat+Bassline-Editor for creating beats and basslines
|
||||
* An easy-to-use Piano-Roll for editing patterns and melodies
|
||||
* A Mixer with unlimited mixer channels and arbitrary number of effects
|
||||
* An FX mixer with unlimited FX channels and arbitrary number of effects
|
||||
* Many powerful instrument and effect-plugins out of the box
|
||||
* Full user-defined track-based automation and computer-controlled automation sources
|
||||
* Compatible with many standards such as SoundFont2, VST2 (instruments and effects), LADSPA, LV2, GUS Patches, and full MIDI support
|
||||
* Compatible with many standards such as SoundFont2, VST(i), LADSPA, GUS Patches, and full MIDI support
|
||||
* MIDI file importing and exporting
|
||||
|
||||
Building
|
||||
---------
|
||||
|
||||
See [Compiling LMMS](https://github.com/LMMS/lmms/wiki/Compiling)
|
||||
See [Compiling LMMS](https://github.com/LMMS/lmms/wiki/Compiling) on our
|
||||
wiki for information on how to build LMMS.
|
||||
|
||||
|
||||
Join LMMS-development
|
||||
----------------------
|
||||
|
||||
If you are interested in LMMS, its programming, artwork, testing, writing demo songs, (and improving this README...) or something like that, you're welcome to participate in the development of LMMS!
|
||||
If you are interested in LMMS, its programming, artwork, testing, writing demo
|
||||
songs, (and improving this README...) or something like that, you're welcome
|
||||
to participate in the development of LMMS!
|
||||
|
||||
Information about what you can do and how can be found in the [wiki](https://github.com/LMMS/lmms/wiki).
|
||||
Information about what you can do and how can be found in the
|
||||
[wiki](https://github.com/LMMS/lmms/wiki).
|
||||
|
||||
Before coding a new big feature, please _always_ [file an issue](https://github.com/LMMS/lmms/issues/new) for your idea and suggestions about your feature and about the intended implementation on GitHub, or ask in one of the tech channels on Discord and wait for replies! Maybe there are different ideas, improvements, or hints, or maybe your feature is not welcome/needed at the moment.
|
||||
Before coding a new big feature, please _always_
|
||||
[file an issue](https://github.com/LMMS/lmms/issues/new) for your idea and
|
||||
suggestions about your feature and about the intended implementation on GitHub
|
||||
or post to the LMMS developers mailinglist (lmms-devel@lists.sourceforge.net)
|
||||
and wait for replies! Maybe there are different ideas, improvements, hints or
|
||||
maybe your feature is not welcome/needed at the moment.
|
||||
|
||||
212
buildtools/bin2res.cpp
Normal file
212
buildtools/bin2res.cpp
Normal file
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* bin2res.cpp - generate embedded resources from binary data (based on qembed)
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
static void embedData( const char * _input, int _size, std::ostream & _output );
|
||||
static std::string convertFileNameToCIdentifier( const std::string & _s );
|
||||
|
||||
|
||||
struct embed
|
||||
{
|
||||
unsigned int size;
|
||||
std::string name;
|
||||
std::string cname;
|
||||
} ;
|
||||
|
||||
typedef std::vector<std::string> stringlist;
|
||||
|
||||
const int MAX_FILE_SIZE = 256*256*256; // = 16 MB
|
||||
|
||||
|
||||
int main( int argc, char * * argv )
|
||||
{
|
||||
if( argc < 2 )
|
||||
{
|
||||
std::cerr << "Usage:" << std::endl << "\t" << argv[0] <<
|
||||
" files" << std::endl;
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
std::cout << "// Generated by bin2res" << std::endl;
|
||||
|
||||
std::vector<embed *> embedded_data;
|
||||
|
||||
std::cout << "#ifndef _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
std::cout << "#define _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
|
||||
stringlist files;
|
||||
for( int i = 1; i < argc; ++i )
|
||||
{
|
||||
files.push_back( std::string( argv[i] ) );
|
||||
}
|
||||
for( stringlist::iterator it = files.begin(); it != files.end(); ++it )
|
||||
{
|
||||
std::ifstream f( it->c_str(), std::ios::binary );
|
||||
if( f.fail() )
|
||||
{
|
||||
std::cerr << "Cannot open file " << *it <<
|
||||
", ignoring it" << std::endl;
|
||||
continue;
|
||||
}
|
||||
f.seekg( 0, std::ios::end );
|
||||
int fsize = f.tellg();
|
||||
f.seekg( 0 );
|
||||
if( fsize == 0 || fsize > MAX_FILE_SIZE )
|
||||
{
|
||||
std::cerr << "File " << *it << " has zero size or is "
|
||||
"too large to be processed with bin2res." <<
|
||||
std::endl;
|
||||
}
|
||||
char * data = new char[fsize];
|
||||
f.read( data, fsize );
|
||||
embed * e = new embed;
|
||||
e->size = fsize;
|
||||
if( it->rfind( '/' ) != std::string::npos )
|
||||
{
|
||||
e->name = std::string( it->c_str() +
|
||||
it->rfind( '/' ) + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
e->name = *it;
|
||||
}
|
||||
e->cname = convertFileNameToCIdentifier( e->name );
|
||||
embedded_data.push_back( e );
|
||||
std::string s;
|
||||
std::cout << "static const unsigned char " << e->cname <<
|
||||
"_data[] = {";
|
||||
embedData( data, fsize, std::cout );
|
||||
std::cout << std::endl << "};" << std::endl << std::endl;
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
if( embedded_data.size() > 0 )
|
||||
{
|
||||
std::cout << "static const unsigned char dummy_data[] ="
|
||||
"{ 0x00 };" << std::endl << std::endl;
|
||||
embed * dummy = new embed;
|
||||
dummy->size = 1;
|
||||
dummy->name = "dummy";
|
||||
dummy->cname = convertFileNameToCIdentifier(
|
||||
std::string( "dummy" ) );
|
||||
embedded_data.push_back( dummy );
|
||||
|
||||
std::cout << "#include <string.h>" << std::endl << std::endl;
|
||||
std::cout << "#include \"embed.h\"" << std::endl << std::endl;
|
||||
std::cout << "static embed::descriptor embed_vec[] = {" << std::endl;
|
||||
/* << "{" << std::endl
|
||||
<< " int size;" << std::endl
|
||||
<< " const unsigned char * data;" <<
|
||||
std::endl
|
||||
<< " const char * name;" << std::endl
|
||||
<< "} embed_vec[] = {" << std::endl;*/
|
||||
while( embedded_data.size() > 0 )
|
||||
{
|
||||
embed * e = embedded_data[0];
|
||||
std::cout << " { " << e->size << ", " << e->cname <<
|
||||
"_data, " << "\"" << e->name <<
|
||||
"\" }," << std::endl;
|
||||
delete e;
|
||||
embedded_data.erase( embedded_data.begin() );
|
||||
}
|
||||
std::cout << " { 0, 0, 0 }" << std::endl << "};" << std::endl
|
||||
<< std::endl
|
||||
<< "static const embed::descriptor & "
|
||||
"findEmbeddedData( const char * _name )"
|
||||
<< std::endl << "{" << std::endl
|
||||
<< " for( int i = 0; embed_vec[i].data; "
|
||||
"i++ )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " if( strcmp( embed_vec[i].name, "
|
||||
"_name ) == 0 )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " return( "
|
||||
"embed_vec[i] );" << std::endl
|
||||
<< " }" << std::endl
|
||||
<< " }" << std::endl
|
||||
/* << " printf( \"warning: embedded resource "
|
||||
"%s not found!\\n\", _name );"
|
||||
<< std::endl*/
|
||||
<< " return( findEmbeddedData( "
|
||||
"\"dummy\" ) );" << std::endl
|
||||
<< "}" << std::endl << std::endl;
|
||||
}
|
||||
std::cout << "#endif" << std::endl;
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
std::string convertFileNameToCIdentifier( const std::string & _s )
|
||||
{
|
||||
std::string r = _s;
|
||||
int len = r.length();
|
||||
if ( len > 0 && !isalpha( (char)r[0] ) )
|
||||
{
|
||||
r[0] = '_';
|
||||
}
|
||||
for ( int i = 1; i < len; i++ )
|
||||
{
|
||||
if ( !isalnum( (char)r[i] ) )
|
||||
{
|
||||
r[i] = '_';
|
||||
}
|
||||
}
|
||||
return( r );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void embedData( const char * _input, int _nbytes, std::ostream & _output )
|
||||
{
|
||||
static const char hexdigits[] = "0123456789abcdef";
|
||||
std::string s;
|
||||
for( int i = 0; i < _nbytes; i++ )
|
||||
{
|
||||
if( ( i%14 ) == 0 )
|
||||
{
|
||||
s += "\n ";
|
||||
_output << s;
|
||||
s = "";
|
||||
}
|
||||
unsigned int v = _input[i];
|
||||
s += "0x";
|
||||
s += hexdigits[(v >> 4) & 15];
|
||||
s += hexdigits[v & 15];
|
||||
if( i < _nbytes-1 )
|
||||
{
|
||||
s += ',';
|
||||
}
|
||||
}
|
||||
if ( s.length() )
|
||||
{
|
||||
_output << s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,19 +9,15 @@ IF(VERSION_STAGE)
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_STAGE}")
|
||||
ENDIF()
|
||||
IF(VERSION_BUILD)
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}-${VERSION_BUILD}")
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}.${VERSION_BUILD}")
|
||||
ENDIF()
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_UCASE}")
|
||||
SET(CPACK_SOURCE_GENERATOR "TBZ2")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
|
||||
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}" "${PROJECT_NAME_UCASE} binary")
|
||||
|
||||
# Disable strip for Debug|RelWithDebInfo
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Deb")
|
||||
unset(CPACK_STRIP_FILES)
|
||||
else()
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
endif()
|
||||
IF(NOT DEFINED WIN32)
|
||||
SET(CPACK_STRIP_FILES "bin/${CMAKE_PROJECT_NAME};${PLUGIN_DIR}/*.so")
|
||||
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}" "${PROJECT_NAME_UCASE} binary")
|
||||
ENDIF()
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
ADD_SUBDIRECTORY(nsis)
|
||||
|
||||
@@ -1,38 +1,30 @@
|
||||
IF(CMAKE_OSX_ARCHITECTURES)
|
||||
SET(DMG_ARCH "${CMAKE_OSX_ARCHITECTURES}")
|
||||
ELSEIF(IS_ARM64)
|
||||
# Target arch is host arch
|
||||
SET(DMG_ARCH "arm64")
|
||||
ELSE()
|
||||
# Fallback to Intel
|
||||
SET(DMG_ARCH "x86_64")
|
||||
ENDIF()
|
||||
SET(MACOSX_BUNDLE_ICON_FILE "icon.icns")
|
||||
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME_UCASE}")
|
||||
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
|
||||
SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME_UCASE}")
|
||||
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
|
||||
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
|
||||
SET(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}")
|
||||
SET(MACOSX_BUNDLE_MIMETYPE "application/x-lmms-project")
|
||||
SET(MACOSX_BUNDLE_MIMETYPE_ICON "project.icns")
|
||||
SET(MACOSX_BUNDLE_MIMETYPE_ID "io.lmms")
|
||||
SET(MACOSX_BUNDLE_PROJECT_URL "${PROJECT_URL}")
|
||||
|
||||
# Standard CPack options
|
||||
set(CPACK_GENERATOR "External" PARENT_SCOPE)
|
||||
set(CPACK_EXTERNAL_ENABLE_STAGING TRUE PARENT_SCOPE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}-${DMG_ARCH}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
|
||||
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/MacDeployQt.cmake" PARENT_SCOPE)
|
||||
# disable cpack's strip: causes missing symbols on macOS
|
||||
set(CPACK_STRIP_FILES_ORIG "${CPACK_STRIP_FILES}" PARENT_SCOPE)
|
||||
set(CPACK_STRIP_FILES FALSE PARENT_SCOPE)
|
||||
CONFIGURE_FILE("lmms.plist.in" "${CMAKE_BINARY_DIR}/Info.plist")
|
||||
CONFIGURE_FILE("install_apple.sh.in" "${CMAKE_BINARY_DIR}/install_apple.sh" @ONLY)
|
||||
CONFIGURE_FILE("package_apple.json.in" "${CMAKE_BINARY_DIR}/package_apple.json" @ONLY)
|
||||
|
||||
# Custom vars to expose to Cpack
|
||||
# must be prefixed with "CPACK_" per https://stackoverflow.com/a/46526757/3196753)
|
||||
set(CPACK_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}" PARENT_SCOPE)
|
||||
set(CPACK_CARLA_LIBRARIES "${CARLA_LIBRARIES}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_VERSION "${VERSION}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_URL "${PROJECT_URL}" PARENT_SCOPE)
|
||||
set(CPACK_SUIL_MODULES "${Suil_MODULES}" PARENT_SCOPE)
|
||||
set(CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX}" PARENT_SCOPE)
|
||||
# DMG creation target
|
||||
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}.dmg")
|
||||
FILE(REMOVE "${DMG_FILE}")
|
||||
ADD_CUSTOM_TARGET(removedmg
|
||||
COMMAND touch "\"${DMG_FILE}\"" && rm "\"${DMG_FILE}\""
|
||||
COMMENT "Removing old DMG")
|
||||
ADD_CUSTOM_TARGET(dmg
|
||||
COMMAND appdmg "\"${CMAKE_BINARY_DIR}/package_apple.json\"" "\"${DMG_FILE}\""
|
||||
DEPENDS "${CMAKE_BINARY_DIR}/package_apple.json"
|
||||
COMMENT "Generating DMG")
|
||||
ADD_DEPENDENCIES(dmg removedmg)
|
||||
|
||||
# see also ../postinstall/CMakeLists.txt
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.19")
|
||||
message(WARNING "DMG creation requires at least CMake 3.19")
|
||||
endif()
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
# Create a macOS .dmg desktop installer using macdeployqt
|
||||
#
|
||||
# Copyright (c) 2025, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# Variables must be prefixed with "CPACK_" to be visible here
|
||||
set(lmms "${CPACK_PROJECT_NAME}")
|
||||
set(APP "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${CPACK_PROJECT_NAME_UCASE}.app")
|
||||
|
||||
# Toggle command echoing & verbosity
|
||||
# 0 = no output, 1 = error/warning, 2 = normal, 3 = debug
|
||||
if(DEFINED ENV{CPACK_DEBUG})
|
||||
set(CPACK_DEBUG "$ENV{CPACK_DEBUG}")
|
||||
endif()
|
||||
if(NOT CPACK_DEBUG)
|
||||
set(VERBOSITY 1)
|
||||
set(COMMAND_ECHO NONE)
|
||||
else()
|
||||
set(VERBOSITY 2)
|
||||
set(COMMAND_ECHO STDOUT)
|
||||
endif()
|
||||
|
||||
# Detect release|debug build
|
||||
if(NOT CPACK_STRIP_FILES_ORIG)
|
||||
# -use-debug-libs implies -no-strip
|
||||
if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local")
|
||||
message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead")
|
||||
set(USE_DEBUG_LIBS -no-strip)
|
||||
else()
|
||||
set(USE_DEBUG_LIBS -use-debug-libs)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Cleanup CPack "External" json, txt files, old DMG files
|
||||
file(GLOB cleanup "${CPACK_BINARY_DIR}/${lmms}-*.json"
|
||||
"${CPACK_BINARY_DIR}/${lmms}-*.dmg"
|
||||
"${CPACK_BINARY_DIR}/install_manifest.txt")
|
||||
list(SORT cleanup)
|
||||
file(REMOVE ${cleanup})
|
||||
|
||||
# Create bundle structure
|
||||
file(MAKE_DIRECTORY "${APP}/Contents/MacOS")
|
||||
file(MAKE_DIRECTORY "${APP}/Contents/Frameworks")
|
||||
file(MAKE_DIRECTORY "${APP}/Contents/Resources")
|
||||
|
||||
# Fix layout
|
||||
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib" "${APP}/Contents/lib")
|
||||
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/share" "${APP}/Contents/share")
|
||||
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin" "${APP}/Contents/bin")
|
||||
|
||||
# Move binaries into Contents/MacOS
|
||||
file(RENAME "${APP}/Contents/bin/${lmms}" "${APP}/Contents/MacOS/${lmms}")
|
||||
file(RENAME "${APP}/Contents/lib/${lmms}/RemoteZynAddSubFx" "${APP}/Contents/MacOS/RemoteZynAddSubFx")
|
||||
file(REMOVE_RECURSE "${APP}/Contents/bin")
|
||||
file(REMOVE_RECURSE "${APP}/Contents/share/man1")
|
||||
file(REMOVE_RECURSE "${APP}/Contents/include")
|
||||
|
||||
# Copy missing files
|
||||
# Convert https://lmms.io to io.lmms
|
||||
string(REPLACE "." ";" mime_parts "${CPACK_PROJECT_URL}")
|
||||
string(REPLACE ":" ";" mime_parts "${mime_parts}")
|
||||
string(REPLACE "/" "" mime_parts "${mime_parts}")
|
||||
list(REMOVE_AT mime_parts 0)
|
||||
list(REVERSE mime_parts)
|
||||
list(JOIN mime_parts "." MACOS_MIMETYPE_ID)
|
||||
configure_file("${CPACK_CURRENT_SOURCE_DIR}/lmms.plist.in" "${APP}/Contents/Info.plist" @ONLY)
|
||||
file(COPY "${CPACK_CURRENT_SOURCE_DIR}/project.icns" DESTINATION "${APP}/Contents/Resources")
|
||||
file(COPY "${CPACK_CURRENT_SOURCE_DIR}/icon.icns" DESTINATION "${APP}/Contents/Resources")
|
||||
file(RENAME "${APP}/Contents/Resources/icon.icns" "${APP}/Contents/Resources/${lmms}.icns")
|
||||
|
||||
# Copy Suil modules
|
||||
if(CPACK_SUIL_MODULES)
|
||||
set(SUIL_MODULES_TARGET "${APP}/Contents/Frameworks/${CPACK_SUIL_MODULES_PREFIX}")
|
||||
file(MAKE_DIRECTORY "${SUIL_MODULES_TARGET}")
|
||||
file(COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET}")
|
||||
endif()
|
||||
|
||||
# Make all libraries writable for macdeployqt
|
||||
file(CHMOD_RECURSE "${APP}/Contents" PERMISSIONS
|
||||
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_WRITE GROUP_READ
|
||||
WORLD_READ)
|
||||
|
||||
# Qt6: Fix @rpath bug https://github.com/orgs/Homebrew/discussions/2823
|
||||
include(CreateSymlink)
|
||||
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
|
||||
get_filename_component(QTDIR "${QTBIN}" DIRECTORY)
|
||||
create_symlink("${QTDIR}/lib" "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib")
|
||||
|
||||
# Replace @rpath with @loader_path for Carla
|
||||
execute_process(COMMAND install_name_tool -change
|
||||
"@rpath/libcarlabase.dylib"
|
||||
"@loader_path/libcarlabase.dylib"
|
||||
"${APP}/Contents/lib/${lmms}/libcarlapatchbay.so"
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
execute_process(COMMAND install_name_tool -change
|
||||
"@rpath/libcarlabase.dylib"
|
||||
"@loader_path/libcarlabase.dylib"
|
||||
"${APP}/Contents/lib/${lmms}/libcarlarack.so"
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# Build list of executables to inform macdeployqt about
|
||||
# e.g. -executable=foo.dylib -executable=bar.dylib
|
||||
file(GLOB LIBS "${APP}/Contents/lib/${lmms}/*.so")
|
||||
|
||||
# Inform macdeployqt about LADSPA plugins; may depend on bundled fftw3f, etc.
|
||||
file(GLOB LADSPA "${APP}/Contents/lib/${lmms}/ladspa/*.so")
|
||||
|
||||
# Inform macdeployqt about remote plugins
|
||||
file(GLOB REMOTE_PLUGINS "${APP}/Contents/MacOS/*Remote*")
|
||||
|
||||
# Collect, sort and dedupe all libraries
|
||||
list(APPEND LIBS ${LADSPA})
|
||||
list(APPEND LIBS ${REMOTE_PLUGINS})
|
||||
list(APPEND LIBS ${CPACK_SUIL_MODULES})
|
||||
list(REMOVE_DUPLICATES LIBS)
|
||||
list(SORT LIBS)
|
||||
|
||||
# Construct macdeployqt parameters
|
||||
foreach(_lib IN LISTS LIBS)
|
||||
if(EXISTS "${_lib}")
|
||||
list(APPEND EXECUTABLES "-executable=${_lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Call macdeployqt
|
||||
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
|
||||
message(STATUS "Calling ${QTBIN}/macdeployqt ${APP} [... executables]")
|
||||
execute_process(COMMAND "${QTBIN}/macdeployqt" "${APP}" ${EXECUTABLES}
|
||||
-verbose=${VERBOSITY}
|
||||
${USE_DEBUG_LIBS}
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# Cleanup symlink
|
||||
file(REMOVE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib")
|
||||
|
||||
# Remove dummy carla libs, relink to a sane location (e.g. /Applications/Carla.app/...)
|
||||
# (must be done after calling macdeployqt)
|
||||
file(GLOB CARLALIBS "${APP}/Contents/lib/${lmms}/libcarla*")
|
||||
foreach(_carlalib IN LISTS CARLALIBS)
|
||||
foreach(_lib "${CPACK_CARLA_LIBRARIES}")
|
||||
set(_oldpath "../../Frameworks/lib${_lib}.dylib")
|
||||
set(_newpath "Carla.app/Contents/MacOS/lib${_lib}.dylib")
|
||||
execute_process(COMMAND install_name_tool -change
|
||||
"@loader_path/${_oldpath}"
|
||||
"@executable_path/../../../${_newpath}"
|
||||
"${_carlalib}"
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
file(REMOVE "${APP}/Contents/Frameworks/lib${_lib}.dylib")
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
# Call ad-hoc codesign manually (CMake offers this as well)
|
||||
execute_process(COMMAND codesign --force --deep --sign - "${APP}"
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# Create DMG
|
||||
# appdmg won't allow volume names > 27 char https://github.com/LinusU/node-alias/issues/7
|
||||
find_program(APPDMG_BIN appdmg REQUIRED)
|
||||
string(SUBSTRING "${CPACK_PROJECT_NAME_UCASE} ${CPACK_PROJECT_VERSION}" 0 27 APPDMG_VOLUME_NAME)
|
||||
# We'll configure this file twice (again in MacDeployQt.cmake once we know CPACK_TEMPORARY_INSTALL_DIRECTORY)
|
||||
configure_file("${CPACK_CURRENT_SOURCE_DIR}/appdmg.json.in" "${CPACK_CURRENT_BINARY_DIR}/appdmg.json" @ONLY)
|
||||
|
||||
execute_process(COMMAND "${APPDMG_BIN}"
|
||||
"${CPACK_CURRENT_BINARY_DIR}/appdmg.json"
|
||||
"${CPACK_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.dmg"
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"title": "@APPDMG_VOLUME_NAME@",
|
||||
"background": "@CPACK_SOURCE_DIR@/cmake/apple/background.png",
|
||||
"icon-size": 128,
|
||||
"contents": [
|
||||
{ "x": 139, "y": 200, "type": "file", "path": "@CPACK_TEMPORARY_INSTALL_DIRECTORY@/@CPACK_PROJECT_NAME_UCASE@.app" },
|
||||
{ "x": 568, "y": 200, "type": "link", "path": "/Applications" }
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
BIN
cmake/apple/dmg_branding@2x.png
Normal file
BIN
cmake/apple/dmg_branding@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 113 KiB |
120
cmake/apple/install_apple.sh.in
Normal file
120
cmake/apple/install_apple.sh.in
Normal file
@@ -0,0 +1,120 @@
|
||||
#!/bin/bash
|
||||
# Creates Apple ".app" bundle for @PROJECT_NAME_UCASE@
|
||||
# Note:
|
||||
# Examine linkings using `otool -L somelib.so`
|
||||
# Debug the loading of dynamic libraries using `export DYLD_PRINT_LIBRARIES=1`
|
||||
|
||||
# STK rawwaves directory
|
||||
STK_RAWWAVE=$HOME/stk-*/rawwaves
|
||||
|
||||
if [ ! -d "$STK_RAWWAVE" ]; then
|
||||
STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves
|
||||
fi
|
||||
|
||||
# Place to create ".app" bundle
|
||||
APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app"
|
||||
|
||||
MSG_COLOR='\x1B[1;36m'
|
||||
COLOR_RESET='\x1B[0m'
|
||||
echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"
|
||||
|
||||
# Locate macdeployqt, assume homebrew & Qt5
|
||||
which macdeployqt > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
export PATH=$PATH:$(brew --prefix qt)/bin
|
||||
fi
|
||||
|
||||
# Remove any old .app bundles
|
||||
rm -Rf "$APP"
|
||||
|
||||
# Copy/overwrite Info.plist
|
||||
\cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/"
|
||||
|
||||
# Create .app bundle containing contents from CMAKE_INSTALL_PREFIX
|
||||
mkdir -p "$APP/Contents/MacOS"
|
||||
mkdir -p "$APP/Contents/Frameworks"
|
||||
mkdir -p "$APP/Contents/Resources"
|
||||
mkdir -p "$APP/Contents/share/stk/rawwaves"
|
||||
cd "@CMAKE_INSTALL_PREFIX@"
|
||||
cp -R * "$APP/Contents"
|
||||
cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/"
|
||||
cp $STK_RAWWAVE/*.raw "$APP/Contents/share/stk/rawwaves" > /dev/null 2>&1
|
||||
|
||||
# Make all libraries writable for macdeployqt
|
||||
cd "$APP"
|
||||
find . -type f -print0 | xargs -0 chmod u+w
|
||||
|
||||
lmmsbin="MacOS/@CMAKE_PROJECT_NAME@"
|
||||
zynlib="lib/lmms/libzynaddsubfx.so"
|
||||
zynfmk="Frameworks/libZynAddSubFxCore.dylib"
|
||||
zynbin="MacOS/RemoteZynAddSubFx"
|
||||
|
||||
# Move lmms binary
|
||||
mv "$APP/Contents/bin/@CMAKE_PROJECT_NAME@" "$APP/Contents/$lmmsbin"
|
||||
|
||||
# Fix zyn linking
|
||||
mv "$APP/Contents/lib/lmms/RemoteZynAddSubFx" "$APP/Contents/$zynbin"
|
||||
mv "$APP/Contents/lib/lmms/libZynAddSubFxCore.dylib" "$APP/Contents/$zynfmk"
|
||||
|
||||
install_name_tool -change @rpath/libZynAddSubFxCore.dylib \
|
||||
@loader_path/../$zynfmk \
|
||||
"$APP/Contents/$zynbin"
|
||||
|
||||
install_name_tool -change @rpath/libZynAddSubFxCore.dylib \
|
||||
@loader_path/../../$zynfmk \
|
||||
"$APP/Contents/$zynlib"
|
||||
|
||||
# Replace @rpath with @loader_path for Carla
|
||||
# See also plugins/carlabase/CMakeLists.txt
|
||||
# This MUST be done BEFORE calling macdeployqt
|
||||
install_name_tool -change @rpath/libcarlabase.dylib \
|
||||
@loader_path/libcarlabase.dylib \
|
||||
"$APP/Contents/lib/lmms/libcarlapatchbay.so"
|
||||
|
||||
install_name_tool -change @rpath/libcarlabase.dylib \
|
||||
@loader_path/libcarlabase.dylib \
|
||||
"$APP/Contents/lib/lmms/libcarlarack.so"
|
||||
|
||||
# Link lmms binary
|
||||
_executables="${_executables} -executable=$APP/Contents/$zynbin"
|
||||
_executables="${_executables} -executable=$APP/Contents/$zynfmk"
|
||||
|
||||
# Build a list of shared objects in target/lib/lmms
|
||||
for file in "$APP/Contents/lib/lmms/"*.so; do
|
||||
_thisfile="$APP/Contents/lib/lmms/${file##*/}"
|
||||
_executables="${_executables} -executable=$_thisfile"
|
||||
done
|
||||
|
||||
# Build a list of shared objects in target/lib/lmms/ladspa
|
||||
for file in "$APP/Contents/lib/lmms/ladspa/"*.so; do
|
||||
_thisfile="$APP/Contents/lib/lmms/ladspa/${file##*/}"
|
||||
_executables="${_executables} -executable=$_thisfile"
|
||||
done
|
||||
|
||||
# Finalize .app
|
||||
macdeployqt "$APP" $_executables
|
||||
|
||||
# Carla is a standalone plugin. Remove library, look for it side-by-side LMMS.app
|
||||
# This MUST be done AFTER calling macdeployqt
|
||||
#
|
||||
# For example:
|
||||
# /Applications/LMMS.app
|
||||
# /Applications/Carla.app
|
||||
carlalibs=$(echo "@CARLA_LIBRARIES@"|tr ";" "\n")
|
||||
|
||||
# Loop over all libcarlas, fix linking
|
||||
for file in "$APP/Contents/lib/lmms/"libcarla*; do
|
||||
_thisfile="$APP/Contents/lib/lmms/${file##*/}"
|
||||
for lib in $carlalibs; do
|
||||
_oldpath="../../Frameworks/lib${lib}.dylib"
|
||||
_newpath="Carla.app/Contents/MacOS/lib${lib}.dylib"
|
||||
install_name_tool -change @loader_path/$_oldpath \
|
||||
@executable_path/../../../$_newpath \
|
||||
"$_thisfile"
|
||||
rm -f "$APP/Contents/Frameworks/lib${lib}.dylib"
|
||||
done
|
||||
done
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$APP/Contents/bin"
|
||||
echo -e "\nFinished.\n\n"
|
||||
@@ -7,13 +7,13 @@
|
||||
<string>English</string>
|
||||
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>@CPACK_PROJECT_NAME@</string>
|
||||
<string>@MACOSX_BUNDLE_ICON_FILE@</string>
|
||||
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@ @CPACK_PROJECT_VERSION@</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ @MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
|
||||
|
||||
<!--
|
||||
#############################################################
|
||||
@@ -29,38 +29,38 @@
|
||||
#############################################################
|
||||
-->
|
||||
<key>CFBundleSignature</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@CPACK_PROJECT_NAME@</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
|
||||
|
||||
<key>CFBundleVersion</key>
|
||||
<string>@CPACK_PROJECT_VERSION@</string>
|
||||
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
|
||||
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>@VERSIONCPACK_PROJECT_VERSION@</string>
|
||||
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
|
||||
|
||||
<key>CFBundleName</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@</string>
|
||||
<string>@MACOSX_BUNDLE_BUNDLE_NAME@</string>
|
||||
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>@MACOS_MIMETYPE_ID@</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ID@</string>
|
||||
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
|
||||
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mmpz</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@ Project</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>mmpz</string>
|
||||
@@ -69,19 +69,19 @@
|
||||
<string>Editor</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/x-@CPACK_PROJECT_NAME@-project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
|
||||
</array>
|
||||
</dict>
|
||||
|
||||
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>mmp</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@ Project (uncompressed)</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>mmp</string>
|
||||
@@ -90,23 +90,23 @@
|
||||
<string>Editor</string>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array>
|
||||
<string>application/x-@CPACK_PROJECT_NAME@-project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
|
||||
</array>
|
||||
</dict>
|
||||
|
||||
|
||||
</array>
|
||||
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>@MACOS_MIMETYPE_ID@.mmpz</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmpz</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>@CPACK_PROJECT_URL@</string>
|
||||
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>@CPACK_PROJECT_VERSIONPROJECT_NAME_UCASE@ Project</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
|
||||
<key>UTTypeIconFile</key>
|
||||
<string>project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
@@ -122,13 +122,13 @@
|
||||
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>@MACOS_MIMETYPE_ID@.mmp</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmp</string>
|
||||
<key>UTTypeReferenceURL</key>
|
||||
<string>@CPACK_PROJECT_URL@</string>
|
||||
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>@CPACK_PROJECT_NAME_UCASE@ Project (uncompressed)</string>
|
||||
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
|
||||
<key>UTTypeIconFile</key>
|
||||
<string>project</string>
|
||||
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.xml</string>
|
||||
|
||||
9
cmake/apple/package_apple.json.in
Normal file
9
cmake/apple/package_apple.json.in
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"title": "@MACOSX_BUNDLE_BUNDLE_NAME@ @MACOSX_BUNDLE_LONG_VERSION_STRING@",
|
||||
"background": "@CMAKE_SOURCE_DIR@/cmake/apple/dmg_branding.png",
|
||||
"icon-size": 128,
|
||||
"contents": [
|
||||
{ "x": 139, "y": 200, "type": "file", "path": "@CMAKE_BINARY_DIR@/@MACOSX_BUNDLE_BUNDLE_NAME@.app" },
|
||||
{ "x": 568, "y": 200, "type": "link", "path": "/Applications" }
|
||||
]
|
||||
}
|
||||
24
cmake/build_mingw32.sh
Executable file
24
cmake/build_mingw32.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Accomodate both linux windows mingw locations
|
||||
MINGW=/mingw32
|
||||
if [ -z "$MSYSCON" ]; then
|
||||
MINGW=/opt$MINGW
|
||||
else
|
||||
CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1"
|
||||
fi
|
||||
|
||||
export PATH=$MINGW/bin:$PATH
|
||||
export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
|
||||
if [ "$1" = "-qt5" ]; then
|
||||
QT5=True
|
||||
fi
|
||||
|
||||
if [ $QT5 ]; then
|
||||
CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
|
||||
fi
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS
|
||||
22
cmake/build_mingw64.sh
Executable file
22
cmake/build_mingw64.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Accomodate both linux windows mingw locations
|
||||
MINGW=/mingw64
|
||||
if [ -z "$MSYSCON" ]; then
|
||||
MINGW=/opt$MINGW
|
||||
else
|
||||
CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1"
|
||||
fi
|
||||
|
||||
export PATH=$MINGW/bin:$PATH
|
||||
|
||||
if [ "$1" = "-qt5" ]; then
|
||||
QT5=True
|
||||
fi
|
||||
|
||||
if [ $QT5 ]; then
|
||||
CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
|
||||
fi
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win64Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS
|
||||
@@ -1,52 +0,0 @@
|
||||
SET(PLUGIN_FILES "")
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin> DESTINATION platforms)
|
||||
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QSvgIconPlugin> DESTINATION iconengines)
|
||||
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QSvgPlugin> DESTINATION imageformats)
|
||||
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::Svg> DESTINATION .)
|
||||
ENDIF()
|
||||
|
||||
IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
|
||||
include(InstallTargetDependencies)
|
||||
|
||||
# Collect directories to search for DLLs
|
||||
GET_FILENAME_COMPONENT(QTBIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
|
||||
set(LIB_DIRS "${QTBIN_DIR}")
|
||||
|
||||
GET_PROPERTY(PLUGINS_BUILT GLOBAL PROPERTY PLUGINS_BUILT)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(LMMS_DEP_DESTINATION ${BIN_DIR})
|
||||
SET(PLUGIN_DEP_DESTINATION ${BIN_DIR})
|
||||
ELSE()
|
||||
SET(LMMS_DEP_DESTINATION ${LIB_DIR})
|
||||
SET(PLUGIN_DEP_DESTINATION ${LIB_DIR})
|
||||
ENDIF()
|
||||
|
||||
INSTALL_TARGET_DEPENDENCIES(
|
||||
NAME "main_binary"
|
||||
TARGETS lmms
|
||||
DESTINATION "${LMMS_DEP_DESTINATION}"
|
||||
LIB_DIRS ${LIB_DIRS}
|
||||
)
|
||||
|
||||
INSTALL_TARGET_DEPENDENCIES(
|
||||
NAME "plugins"
|
||||
TARGETS ${PLUGINS_BUILT}
|
||||
DESTINATION ${PLUGIN_DEP_DESTINATION}
|
||||
LIB_DIRS ${LIB_DIRS} "${PLUGIN_DIR}" "${PLUGIN_DIR}/optional"
|
||||
SEARCH_PATHS "${PLUGIN_DIR}" "${PLUGIN_DIR}/optional"
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# Install STK rawwaves
|
||||
if(LMMS_HAVE_STK AND (LMMS_BUILD_WIN32 OR LMMS_BUILD_APPLE))
|
||||
if(STK_RAWWAVE_ROOT)
|
||||
file(GLOB RAWWAVES "${STK_RAWWAVE_ROOT}/*.raw")
|
||||
list(SORT RAWWAVES)
|
||||
install(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
|
||||
else()
|
||||
message(WARNING "Can't find STK rawwave root!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# List of DLLs considered to be system libraries.
|
||||
# This is needed when cross-compiling for Windows.
|
||||
ADVAPI32.dll
|
||||
COMCTL32.dll
|
||||
comdlg32.dll
|
||||
d3d11.dll
|
||||
dwmapi.dll
|
||||
dxgi.dll
|
||||
GDI32.dll
|
||||
IMM32.dll
|
||||
KERNEL32.dll
|
||||
MPR.DLL
|
||||
msvcrt.dll
|
||||
netapi32.dll
|
||||
ole32.dll
|
||||
OLEAUT32.dll
|
||||
OPENGL32.DLL
|
||||
SHELL32.dll
|
||||
USER32.dll
|
||||
userenv.dll
|
||||
UxTheme.dll
|
||||
VERSION.dll
|
||||
WINMM.DLL
|
||||
WS2_32.dll
|
||||
RPCRT4.dll
|
||||
dsound.dll
|
||||
SETUPAPI.dll
|
||||
@@ -1,51 +1,18 @@
|
||||
install(DIRECTORY icons/ DESTINATION "${DATA_DIR}/icons/hicolor")
|
||||
install(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications")
|
||||
install(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")
|
||||
INSTALL(DIRECTORY icons/ DESTINATION "${DATA_DIR}/icons/hicolor")
|
||||
INSTALL(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications")
|
||||
INSTALL(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")
|
||||
|
||||
# Preserve old CPack behavior
|
||||
if(WANT_CPACK_TARBALL)
|
||||
message(STATUS "Skipping AppImage creation")
|
||||
return()
|
||||
endif()
|
||||
# AppImage creation target
|
||||
SET(APPIMAGE_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-linux-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
|
||||
|
||||
# Standard CPack options
|
||||
set(CPACK_GENERATOR "External" PARENT_SCOPE)
|
||||
set(CPACK_EXTERNAL_ENABLE_STAGING true PARENT_SCOPE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-linux-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
|
||||
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/LinuxDeploy.cmake" PARENT_SCOPE)
|
||||
CONFIGURE_FILE("package_linux.sh.in" "${CMAKE_BINARY_DIR}/package_linux.sh" @ONLY)
|
||||
|
||||
# Custom vars to expose to Cpack
|
||||
# must be prefixed with "CPACK_" per https://stackoverflow.com/a/46526757/3196753)
|
||||
set(CPACK_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(CPACK_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}" PARENT_SCOPE)
|
||||
set(CPACK_CARLA_LIBRARIES "${CARLA_LIBRARIES}" PARENT_SCOPE)
|
||||
set(CPACK_WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIRS}" PARENT_SCOPE)
|
||||
set(CPACK_WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIRS}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE}" PARENT_SCOPE)
|
||||
set(CPACK_PROJECT_VERSION "${VERSION}" PARENT_SCOPE)
|
||||
set(CPACK_CMAKE_COMMAND "${CMAKE_COMMAND}" PARENT_SCOPE)
|
||||
set(CPACK_SUIL_MODULES "${Suil_MODULES}" PARENT_SCOPE)
|
||||
set(CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX}" PARENT_SCOPE)
|
||||
set(CPACK_STK_RAWWAVE_ROOT "${STK_RAWWAVE_ROOT}" PARENT_SCOPE)
|
||||
|
||||
# TODO: Canidate for DetectMachine.cmake
|
||||
if(IS_X86_64)
|
||||
set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE)
|
||||
elseif(IS_X86)
|
||||
set(CPACK_TARGET_ARCH i386 PARENT_SCOPE)
|
||||
elseif(IS_ARM64)
|
||||
set(CPACK_TARGET_ARCH aarch64 PARENT_SCOPE)
|
||||
elseif(IS_ARM32)
|
||||
set(CPACK_TARGET_ARCH armhf PARENT_SCOPE)
|
||||
else()
|
||||
set(CPACK_TARGET_ARCH unknown PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS "3.19")
|
||||
message(WARNING "AppImage creation requires at least CMake 3.19")
|
||||
endif()
|
||||
FILE(REMOVE "${APPIMAGE_FILE}")
|
||||
ADD_CUSTOM_TARGET(removeappimage
|
||||
COMMAND rm -f "${APPIMAGE_FILE}"
|
||||
COMMENT "Removing old AppImage")
|
||||
ADD_CUSTOM_TARGET(appimage
|
||||
COMMAND chmod +x "${CMAKE_BINARY_DIR}/package_linux.sh"
|
||||
COMMAND "${CMAKE_BINARY_DIR}/package_linux.sh"
|
||||
COMMENT "Generating AppImage")
|
||||
ADD_DEPENDENCIES(appimage removeappimage)
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
# Create a Linux desktop installer using linuxdeploy
|
||||
# * Creates a relocatable LMMS.AppDir installation in build/_CPack_Packages using linuxdeploy
|
||||
# * If CPACK_TOOL=appimagetool or is not set, bundles AppDir into redistributable ".AppImage" file
|
||||
# * If CPACK_TOOL=makeself is provided, bundles into a redistributable ".run" file
|
||||
#
|
||||
# Copyright (c) 2025, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# Variables must be prefixed with "CPACK_" to be visible here
|
||||
set(lmms "${CPACK_PROJECT_NAME}")
|
||||
set(LMMS "${CPACK_PROJECT_NAME_UCASE}")
|
||||
set(ARCH "${CPACK_TARGET_ARCH}")
|
||||
set(APP "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${LMMS}.AppDir")
|
||||
|
||||
# Target AppImage file
|
||||
set(APPIMAGE_FILE "${CPACK_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.AppImage")
|
||||
set(APPIMAGE_BEFORE_RENAME "${CPACK_BINARY_DIR}/${LMMS}-${ARCH}.AppImage")
|
||||
|
||||
set(DESKTOP_FILE "${APP}/usr/share/applications/${lmms}.desktop")
|
||||
|
||||
# Determine which packaging tool to use
|
||||
if(NOT CPACK_TOOL)
|
||||
# Pick up environmental variable
|
||||
if(DEFINED ENV{CPACK_TOOL})
|
||||
set(CPACK_TOOL "$ENV{CPACK_TOOL}")
|
||||
else()
|
||||
set(CPACK_TOOL "appimagetool")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Toggle command echoing & verbosity
|
||||
# 0 = no output, 1 = error/warning, 2 = normal, 3 = debug
|
||||
if(DEFINED ENV{CPACK_DEBUG})
|
||||
set(CPACK_DEBUG "$ENV{CPACK_DEBUG}")
|
||||
endif()
|
||||
if(NOT CPACK_DEBUG)
|
||||
set(VERBOSITY 1)
|
||||
set(APPIMAGETOOL_VERBOSITY "")
|
||||
set(COMMAND_ECHO NONE)
|
||||
set(OUTPUT_QUIET OUTPUT_QUIET)
|
||||
else()
|
||||
set(VERBOSITY 2)
|
||||
set(APPIMAGETOOL_VERBOSITY "--verbose")
|
||||
set(COMMAND_ECHO STDOUT)
|
||||
unset(OUTPUT_QUIET)
|
||||
endif()
|
||||
|
||||
include(DownloadBinary)
|
||||
include(CreateSymlink)
|
||||
include(CopyDependency)
|
||||
|
||||
# Cleanup CPack "External" json, txt files, old AppImage files
|
||||
file(GLOB cleanup "${CPACK_BINARY_DIR}/${lmms}-*.json"
|
||||
"${CPACK_BINARY_DIR}/${lmms}-*.AppImage"
|
||||
"${CPACK_BINARY_DIR}/install_manifest.txt")
|
||||
list(SORT cleanup)
|
||||
file(REMOVE ${cleanup})
|
||||
|
||||
# Download and extract linuxdeploy
|
||||
download_binary(LINUXDEPLOY_BIN
|
||||
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage"
|
||||
linuxdeploy-${ARCH}.AppImage
|
||||
FALSE)
|
||||
|
||||
# Guess the path to appimagetool
|
||||
set(APPIMAGETOOL_BIN "${CPACK_CURRENT_BINARY_DIR}/.linuxdeploy-${ARCH}.AppImage/squashfs-root/plugins/linuxdeploy-plugin-appimage/appimagetool-prefix/AppRun")
|
||||
|
||||
# Download linuxdeploy-plugin-qt
|
||||
download_binary(LINUXDEPLOY_PLUGIN_BIN
|
||||
"https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage"
|
||||
linuxdeploy-plugin-qt-${ARCH}.AppImage
|
||||
FALSE)
|
||||
|
||||
message(STATUS "Creating AppDir ${APP}...")
|
||||
|
||||
file(REMOVE_RECURSE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/include")
|
||||
file(MAKE_DIRECTORY "${APP}/usr")
|
||||
|
||||
# Setup AppDir structure (/usr/bin, /usr/lib, /usr/share... etc)
|
||||
file(GLOB files "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/*")
|
||||
list(SORT files)
|
||||
foreach(_file ${files})
|
||||
get_filename_component(_filename "${_file}" NAME)
|
||||
if(NOT _filename MATCHES ".AppDir")
|
||||
file(RENAME "${_file}" "${APP}/usr/${_filename}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Gather deps
|
||||
list(APPEND DEPLOY_DEPS
|
||||
--deploy-deps-only "${APP}/usr/lib/${lmms}/"
|
||||
--deploy-deps-only "${APP}/usr/lib/${lmms}/ladspa/"
|
||||
)
|
||||
|
||||
# If usr/bin/lmms is hard-linked to libjack, copy it to a new location
|
||||
# See https://github.com/LMMS/lmms/issues/7689
|
||||
copy_dependency("${APP}/usr/bin/lmms" "libjack.so" "${APP}/usr/lib/jack" JACK_LIB_RELOC)
|
||||
if(JACK_LIB_RELOC)
|
||||
list(APPEND DEPLOY_DEPS --deploy-deps-only "${JACK_LIB_RELOC}")
|
||||
endif()
|
||||
|
||||
if(CPACK_HAVE_VST_32)
|
||||
list(APPEND DEPLOY_DEPS --deploy-deps-only "${APP}/usr/lib/${lmms}/32/")
|
||||
endif()
|
||||
|
||||
# Copy Suil modules
|
||||
if(CPACK_SUIL_MODULES)
|
||||
set(SUIL_MODULES_TARGET "${APP}/usr/lib/suil-0/")
|
||||
file(MAKE_DIRECTORY "${SUIL_MODULES_TARGET}")
|
||||
file(COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET}")
|
||||
list(APPEND DEPLOY_DEPS --deploy-deps-only "${APP}/usr/lib/suil-0/")
|
||||
endif()
|
||||
|
||||
# Copy stk/rawwaves
|
||||
if(CPACK_STK_RAWWAVE_ROOT)
|
||||
set(STK_RAWWAVE_TARGET "${APP}/usr/share/stk/rawwaves/")
|
||||
file(MAKE_DIRECTORY "${STK_RAWWAVE_TARGET}")
|
||||
file(GLOB RAWWAVES "${CPACK_STK_RAWWAVE_ROOT}/*.raw")
|
||||
file(COPY ${RAWWAVES} DESTINATION "${STK_RAWWAVE_TARGET}")
|
||||
endif()
|
||||
|
||||
# Ensure project's "qmake" executable is first on the PATH
|
||||
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
|
||||
set(ENV{PATH} "${QTBIN}:$ENV{PATH}")
|
||||
|
||||
# Promote finding our own libraries first
|
||||
set(ENV{LD_LIBRARY_PATH} "${APP}/usr/lib/${lmms}/:${APP}/usr/lib/${lmms}/optional:$ENV{LD_LIBRARY_PATH}")
|
||||
|
||||
# Workaround for finding libs from online installer
|
||||
# https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/193
|
||||
set(ENV{LD_LIBRARY_PATH} "${QTBIN}/../lib:$ENV{LD_LIBRARY_PATH}")
|
||||
|
||||
# Skip slow searching of copyright files https://github.com/linuxdeploy/linuxdeploy/issues/278
|
||||
set(ENV{DISABLE_COPYRIGHT_FILES_DEPLOYMENT} 1)
|
||||
|
||||
# Patch desktop file
|
||||
file(APPEND "${DESKTOP_FILE}" "X-AppImage-Version=${CPACK_PROJECT_VERSION}\n")
|
||||
|
||||
# Custom scripts to run immediately before lmms is executed
|
||||
file(COPY "${CPACK_SOURCE_DIR}/cmake/linux/apprun-hooks" DESTINATION "${APP}")
|
||||
file(REMOVE "${APP}/apprun-hooks/README.md")
|
||||
|
||||
# Prefer a hard-copy of .DirIcon over appimagetool's symlinking
|
||||
# 256x256 default for Cinnamon Desktop https://forums.linuxmint.com/viewtopic.php?p=2585952
|
||||
file(COPY "${APP}/usr/share/icons/hicolor/256x256/apps/${lmms}.png" DESTINATION "${APP}")
|
||||
file(RENAME "${APP}/${lmms}.png" "${APP}/.DirIcon")
|
||||
file(COPY "${APP}/usr/share/icons/hicolor/256x256/apps/${lmms}.png" DESTINATION "${APP}")
|
||||
|
||||
# Inform linuxdeploy-plugin-qt about wayland plugin
|
||||
set(ENV{EXTRA_PLATFORM_PLUGINS} "libqwayland-generic.so")
|
||||
set(ENV{EXTRA_QT_MODULES} "waylandcompositor")
|
||||
|
||||
# Call linuxdeploy
|
||||
message(STATUS "Calling ${LINUXDEPLOY_BIN} --appdir \"${APP}\" ... [... libraries].")
|
||||
execute_process(COMMAND "${LINUXDEPLOY_BIN}"
|
||||
--appdir "${APP}"
|
||||
--desktop-file "${DESKTOP_FILE}"
|
||||
--plugin qt
|
||||
${DEPLOY_DEPS}
|
||||
--exclude-library "*libgallium*"
|
||||
--verbosity ${VERBOSITY}
|
||||
WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}"
|
||||
${OUTPUT_QUIET}
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# Remove svg ambitiously placed by linuxdeploy
|
||||
file(REMOVE "${APP}/${lmms}.svg")
|
||||
|
||||
# Remove libraries that are normally system-provided
|
||||
file(GLOB EXCLUDE_LIBS
|
||||
"${APP}/usr/lib/libwine*"
|
||||
"${APP}/usr/lib/libcarla_native*"
|
||||
"${APP}/usr/lib/${lmms}/optional/libcarla*"
|
||||
"${APP}/usr/lib/libjack*")
|
||||
|
||||
list(SORT EXCLUDE_LIBS)
|
||||
foreach(_lib IN LISTS EXCLUDE_LIBS)
|
||||
if(EXISTS "${_lib}")
|
||||
file(REMOVE "${_lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# cleanup empty directories
|
||||
file(REMOVE_RECURSE "${APP}/usr/lib/${lmms}/optional/")
|
||||
|
||||
if(CPACK_TOOL STREQUAL "appimagetool")
|
||||
# Create ".AppImage" file using appimagetool (default)
|
||||
|
||||
# appimage plugin needs ARCH set when running in extracted form from squashfs-root / CI
|
||||
set(ENV{ARCH} "${ARCH}")
|
||||
message(STATUS "Finishing the AppImage...")
|
||||
execute_process(COMMAND "${APPIMAGETOOL_BIN}" "${APP}" "${APPIMAGE_FILE}"
|
||||
${APPIMAGETOOL_VERBOSITY}
|
||||
${OUTPUT_QUIET}
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
message(STATUS "AppImage created: ${APPIMAGE_FILE}")
|
||||
elseif(CPACK_TOOL STREQUAL "makeself")
|
||||
# Create self-extracting ".run" script using makeself
|
||||
find_program(MAKESELF_BIN makeself REQUIRED)
|
||||
|
||||
message(STATUS "Finishing the .run file using ${MAKESELF_BIN}...")
|
||||
string(REPLACE ".AppImage" ".run" RUN_FILE "${APPIMAGE_FILE}")
|
||||
configure_file(
|
||||
"${CPACK_SOURCE_DIR}/cmake/linux/makeself_setup.sh.in" "${APP}/setup.sh" @ONLY
|
||||
FILE_PERMISSIONS
|
||||
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_WRITE GROUP_READ
|
||||
WORLD_READ)
|
||||
|
||||
if(OUTPUT_QUIET)
|
||||
set(MAKESELF_QUIET "--quiet")
|
||||
set(ERROR_QUIET ERROR_QUIET)
|
||||
endif()
|
||||
|
||||
# makeself.sh [args] archive_dir file_name label startup_script [script_args]
|
||||
file(REMOVE "${RUN_FILE}")
|
||||
execute_process(COMMAND "${MAKESELF_BIN}"
|
||||
--keep-umask
|
||||
--nox11
|
||||
${MAKESELF_QUIET}
|
||||
"${APP}"
|
||||
"${RUN_FILE}"
|
||||
"${LMMS} Installer"
|
||||
"./setup.sh"
|
||||
${OUTPUT_QUIET}
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# ensure the installer can be executed as a script file
|
||||
execute_process(COMMAND "${RUN_FILE}" --help
|
||||
${OUTPUT_QUIET}
|
||||
${ERROR_QUIET}
|
||||
COMMAND_ECHO ${COMMAND_ECHO}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
message(STATUS "Installer created: ${RUN_FILE}")
|
||||
else()
|
||||
message(FATAL_ERROR "Packaging tool CPACK_TOOL=\"${CPACK_TOOL}\" is not yet supported")
|
||||
endif()
|
||||
@@ -1,11 +0,0 @@
|
||||
# AppRun Hooks
|
||||
|
||||
Scripts placed in this directory will automatically be bundled into linuxdeploy AppImages
|
||||
(e.g. `LMMS.AppDir/apprun-hooks`) and executed immediately before lmms.
|
||||
|
||||
Quoting:
|
||||
|
||||
> "Sometimes it's important to perform actions before running the actual app. Some plugins might have to set e.g.,
|
||||
> environment variables to work properly."
|
||||
|
||||
See also: https://github.com/linuxdeploy/linuxdeploy/wiki/Plugin-system#apprun-hooks
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Workaround nuances with carla being an optional-yet-hard-linked plugin
|
||||
CARLA_LIB_NAME="libcarla_native-plugin.so"
|
||||
KNOWN_LOCATIONS="lib lib64"
|
||||
unset CARLA_LIB_FILE
|
||||
|
||||
# Check for carla at "known" locations
|
||||
if command -v carla > /dev/null 2>&1; then
|
||||
CARLA_PATH="$(command -v carla)"
|
||||
CARLA_PREFIX="${CARLA_PATH%/bin*}"
|
||||
|
||||
# Look for libcarla_native-plugin.so in adjacent lib directory
|
||||
for lib in $KNOWN_LOCATIONS; do
|
||||
if [ -e "$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME" ]; then
|
||||
# Add directory to LD_LIBRARY_PATH so libcarlabase.so can find it
|
||||
CARLA_LIB_FILE="$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME"
|
||||
export LD_LIBRARY_PATH="$CARLA_PREFIX/$lib/carla/:$LD_LIBRARY_PATH"
|
||||
echo "[${0##*/}] Carla appears to be installed on this system at $CARLA_PREFIX/$lib/carla so we'll use it." >&2
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "[${0##*/}] Carla does not appear to be installed, we'll remove it from the plugin listing." >&2
|
||||
export "LMMS_EXCLUDE_PLUGINS=libcarla,${LMMS_EXCLUDE_PLUGINS}"
|
||||
fi
|
||||
|
||||
# Additional workarounds for library conflicts
|
||||
# libgobject has been versioned "2.0" for over 20 years, but the ABI is constantly changing
|
||||
KNOWN_CONFLICTS="libgobject-2.0.so.0"
|
||||
if [ -n "$CARLA_LIB_FILE" ]; then
|
||||
for conflict in $KNOWN_CONFLICTS; do
|
||||
# Only prepend LD_PRELOAD if we bundle the same version
|
||||
if [ -e "$APPDIR/usr/lib/$conflict" ]; then
|
||||
conflict_sys="$(ldd "$CARLA_LIB_FILE" | grep "$conflict" | awk '{print $3}')"
|
||||
if [ -e "$conflict_sys" ]; then
|
||||
# Add library to LD_PRELOAD so lmms can find it over its bundled version
|
||||
echo "[${0##*/}] Preferring the system's \"$conflict\" over the version bundled." >&2
|
||||
export LD_PRELOAD="$conflict_sys:$LD_PRELOAD"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Workaround crash when jack is missing by providing a dummy version
|
||||
if LC_ALL=C ldd "$APPDIR/usr/bin/lmms" |grep "libjack.so" |grep "not found" > /dev/null 2>&1; then
|
||||
echo "[${0##*/}] Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2
|
||||
export LD_LIBRARY_PATH="$APPDIR/usr/lib/jack:$LD_LIBRARY_PATH"
|
||||
else
|
||||
echo "[${0##*/}] Jack appears to be installed on this system, so we'll use it." >&2
|
||||
fi
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Workaround Unity desktop menubar integration
|
||||
# - Unity's menubar relocation breaks Qt's MDI window handling in Linux
|
||||
# - Unity was default in Ubuntu 11.04 - 18.04
|
||||
if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]; then
|
||||
export QT_X11_NO_NATIVE_MENUBAR=1
|
||||
fi
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Paths for plugin systems to pick-up
|
||||
export SUIL_MODULE_DIR="$APPDIR/usr/lib/suil-0/" # See also ${SUIL_MODULES_TARGET}
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Workaround crash in VirtualBox when hardware rendering is enabled
|
||||
if lsmod |grep vboxguest > /dev/null 2>&1; then
|
||||
echo "[${0##*/}] VirtualBox detected. Forcing libgl software rendering." >&2
|
||||
export LIBGL_ALWAYS_SOFTWARE=1;
|
||||
fi
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Configure QPlatform Abstraction (qpa) to prefer X-Protocol C-Bindings (xcb) over Wayland
|
||||
if [ -n "$QT_QPA_PLATFORM" ]; then
|
||||
echo "[${0##*/}] QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" was provided, using." >&2
|
||||
else
|
||||
export QT_QPA_PLATFORM="xcb"
|
||||
echo "[${0##*/}] Defaulting to QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" for compatibility purposes." >&2
|
||||
echo "[${0##*/}] To force wayland, set QT_QPA_PLATFORM=\"wayland\" or call using \"-platform wayland\"." >&2
|
||||
fi
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.5 KiB |
24
cmake/linux/launch_lmms.sh
Normal file
24
cmake/linux/launch_lmms.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
export PATH="$PATH:/sbin"
|
||||
if command -v carla > /dev/null 2>&1; then
|
||||
CARLAPATH="$(command -v carla)"
|
||||
CARLAPREFIX="${CARLAPATH%/bin*}"
|
||||
echo "Carla appears to be installed on this system at $CARLAPREFIX/lib[64]/carla so we'll use it."
|
||||
export LD_LIBRARY_PATH=$CARLAPREFIX/lib/carla:$CARLAPREFIX/lib64/carla:$LD_LIBRARY_PATH
|
||||
else
|
||||
echo "Carla does not appear to be installed. That's OK, please ignore any related library errors."
|
||||
fi
|
||||
export LD_LIBRARY_PATH=$DIR/usr/lib/:$DIR/usr/lib/lmms:$LD_LIBRARY_PATH
|
||||
# Prevent segfault on VirualBox
|
||||
if lsmod |grep vboxguest > /dev/null 2>&1; then
|
||||
echo "VirtualBox detected. Forcing libgl software rendering."
|
||||
export LIBGL_ALWAYS_SOFTWARE=1;
|
||||
fi
|
||||
if ldconfig -p | grep libjack.so.0 > /dev/null 2>&1; then
|
||||
echo "Jack appears to be installed on this system, so we'll use it."
|
||||
else
|
||||
echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead."
|
||||
export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH
|
||||
fi
|
||||
QT_X11_NO_NATIVE_MENUBAR=1 "$DIR"/usr/bin/lmms.real "$@"
|
||||
@@ -4,11 +4,9 @@ GenericName=Music production suite
|
||||
GenericName[ca]=Programari de producció musical
|
||||
GenericName[de]=Software zur Musik-Produktion
|
||||
GenericName[fr]=Suite de production musicale
|
||||
GenericName[pl]=Narzędzia do produkcji muzyki
|
||||
Comment=Music sequencer and synthesizer
|
||||
Comment[ca]=Producció fàcil de música per a tothom!
|
||||
Comment[fr]=Séquenceur et synthétiseur de musique
|
||||
Comment[pl]=Prosta produkcja muzyki dla każdego!
|
||||
Icon=lmms
|
||||
Exec=lmms %f
|
||||
Terminal=false
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Halt on first error
|
||||
set -e
|
||||
|
||||
DESTDIR="/opt/@CPACK_PROJECT_NAME@"
|
||||
BASHCOMPLETIONS="/usr/share/bash-completion/completions"
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
# Prepend "$HOME" so we can install to a writable location
|
||||
DESTDIR="${HOME}${DESTDIR}"
|
||||
BASHCOMPLETIONS="${HOME}/.local/share/bash-completion/completions"
|
||||
echo "Installing as a regular user to ${DESTDIR}/..."
|
||||
else
|
||||
echo "Installing as elevated user to ${DESTDIR}/..."
|
||||
fi
|
||||
|
||||
# Deploy @CPACK_PROJECT_NAME_UCASE@
|
||||
mkdir -p "${DESTDIR}"
|
||||
unalias cp &> /dev/null || true
|
||||
cp -rf ./* "${DESTDIR}"
|
||||
rm -f "${DESTDIR}/setup.sh"
|
||||
mv "${DESTDIR}/AppRun" "${DESTDIR}/@CPACK_PROJECT_NAME@"
|
||||
|
||||
# Install bash completions
|
||||
mkdir -p "${BASHCOMPLETIONS}"
|
||||
ln -sf "${DESTDIR}/usr/share/@CPACK_PROJECT_NAME@/bash-completion/completions/@CPACK_PROJECT_NAME@" "${BASHCOMPLETIONS}/@CPACK_PROJECT_NAME@"
|
||||
|
||||
# Test @CPACK_PROJECT_NAME_UCASE@
|
||||
echo "Installation complete... Testing \"@CPACK_PROJECT_NAME@\"..."
|
||||
"${DESTDIR}/@CPACK_PROJECT_NAME@" --allowroot --version &> /dev/null
|
||||
|
||||
# TODO: Register file associations, desktop icon, etc
|
||||
|
||||
echo "@CPACK_PROJECT_NAME_UCASE@ was installed successfully to ${DESTDIR}. To run:"
|
||||
echo " ${DESTDIR}/@CPACK_PROJECT_NAME@"
|
||||
180
cmake/linux/package_linux.sh.in
Normal file
180
cmake/linux/package_linux.sh.in
Normal file
@@ -0,0 +1,180 @@
|
||||
#!/usr/bin/env bash
|
||||
# Creates Linux ".AppImage" for @PROJECT_NAME_UCASE@
|
||||
#
|
||||
# Depends: linuxdeployqt
|
||||
#
|
||||
# Notes: Will attempt to fetch linuxdeployqt automatically (x86_64 only)
|
||||
# See Also: https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md
|
||||
|
||||
set -e
|
||||
|
||||
LINUXDEPLOYQT="@CMAKE_BINARY_DIR@/linuxdeployqt"
|
||||
VERBOSITY=2 # 3=debug
|
||||
LOGFILE="@CMAKE_BINARY_DIR@/appimage.log"
|
||||
APPDIR="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.AppDir/"
|
||||
DESKTOPFILE="${APPDIR}usr/share/applications/lmms.desktop"
|
||||
STRIP=""
|
||||
|
||||
# Don't strip for Debug|RelWithDebInfo builds
|
||||
if [[ "@CMAKE_BUILD_TYPE@" == *"Deb"* ]]; then
|
||||
STRIP="-no-strip"
|
||||
fi
|
||||
|
||||
# Console colors
|
||||
RED="\\x1B[1;31m"
|
||||
GREEN="\\x1B[1;32m"
|
||||
YELLOW="\\x1B[1;33m"
|
||||
PLAIN="\\x1B[0m"
|
||||
|
||||
function error {
|
||||
echo -e " ${PLAIN}[${RED}error${PLAIN}] ${1}"
|
||||
return 1
|
||||
}
|
||||
|
||||
function success {
|
||||
echo -e " ${PLAIN}[${GREEN}success${PLAIN}] ${1}"
|
||||
}
|
||||
|
||||
function skipped {
|
||||
echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}"
|
||||
}
|
||||
|
||||
# Blindly assume system arch is appimage arch
|
||||
ARCH=$(arch)
|
||||
export ARCH
|
||||
|
||||
# Check for problematic install locations
|
||||
INSTALL=$(echo "@CMAKE_INSTALL_PREFIX@" | sed 's/\/*$//g')
|
||||
if [ "$INSTALL" == "/usr/local" ] || [ "$INSTALL" == "/usr" ] ; then
|
||||
error "Incompatible CMAKE_INSTALL_PREFIX for creating AppImage: @CMAKE_INSTALL_PREFIX@"
|
||||
fi
|
||||
|
||||
echo -e "\nWriting verbose output to \"${LOGFILE}\""
|
||||
|
||||
# Ensure linuxdeployqt uses the same qmake version as cmake
|
||||
export PATH="$(pwd -P)/squashfs-root/usr/bin:$(dirname "@QT_QMAKE_EXECUTABLE@")":$PATH
|
||||
|
||||
# Fetch portable linuxdeployqt if cache is older than $DAYSOLD
|
||||
APPIMAGETOOL="squashfs-root/usr/bin/appimagetool"
|
||||
echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..."
|
||||
mkdir -p "$HOME/bin"
|
||||
DAYSOLD=2
|
||||
if env -i which linuxdeployqt > /dev/null 2>&1; then
|
||||
skipped "System already provides this utility"
|
||||
elif ! find "$LINUXDEPLOYQT" -mtime -$DAYSOLD 2>/dev/null|grep -q "." > /dev/null 2>&1; then
|
||||
url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-$(uname -p).AppImage"
|
||||
echo " [.......] Couldn't find linuxdeployqt newer than $DAYSOLD days old"
|
||||
echo " [.......] Downloading ($(uname -p)): ${url}"
|
||||
wget "$url" -O "$LINUXDEPLOYQT" -q || (rm "$LINUXDEPLOYQT" && false)
|
||||
chmod +x "$LINUXDEPLOYQT"
|
||||
touch "$LINUXDEPLOYQT"
|
||||
success "Downloaded $LINUXDEPLOYQT"
|
||||
"$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1
|
||||
# We need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it
|
||||
# See https://github.com/probonopd/linuxdeployqt/pull/370/
|
||||
LINUXDEPLOYQT="squashfs-root/usr/bin/linuxdeployqt"
|
||||
success "Extracted $APPIMAGETOOL"
|
||||
else
|
||||
skipped "$LINUXDEPLOYQT is less than $DAYSOLD days old"
|
||||
fi
|
||||
|
||||
# Make skeleton AppDir
|
||||
echo -e "\nCreating ${APPDIR}..."
|
||||
rm -rf "${APPDIR}"
|
||||
mkdir -p "${APPDIR}usr"
|
||||
success "Created ${APPDIR}"
|
||||
|
||||
# Clone install to AppDir
|
||||
echo -e "\nCopying @CMAKE_INSTALL_PREFIX@ to ${APPDIR}..."
|
||||
cp -R "@CMAKE_INSTALL_PREFIX@/." "${APPDIR}usr"
|
||||
rm -rf "${APPDIR}usr/include"
|
||||
success "${APPDIR}"
|
||||
|
||||
# Copy rawwaves directory for stk/mallets
|
||||
mkdir -p "${APPDIR}usr/share/stk/"
|
||||
cp -R /usr/share/stk/rawwaves/ "${APPDIR}usr/share/stk/"
|
||||
|
||||
# Create a wrapper script which calls the lmms executable
|
||||
mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real"
|
||||
|
||||
cp "@CMAKE_CURRENT_SOURCE_DIR@/launch_lmms.sh" "${APPDIR}usr/bin/lmms"
|
||||
|
||||
chmod +x "${APPDIR}usr/bin/lmms"
|
||||
|
||||
# Per https://github.com/probonopd/linuxdeployqt/issues/129
|
||||
unset LD_LIBRARY_PATH
|
||||
|
||||
# Ensure linuxdeployqt can find shared objects
|
||||
export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":"${APPDIR}usr/lib/lmms/optional":$LD_LIBRARY_PATH
|
||||
|
||||
# Handle wine linking
|
||||
if [ -d "@WINE_LIBRARY_FIX@" ]; then
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_LIBRARY_FIX@:@WINE_LIBRARY_FIX@wine/
|
||||
fi
|
||||
|
||||
# Move executables so linuxdeployqt can find them
|
||||
ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx"
|
||||
VSTLIB="${APPDIR}usr/lib/lmms/RemoteVstPlugin.exe.so"
|
||||
|
||||
ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx"
|
||||
VSTBIN="${APPDIR}usr/bin/RemoteVstPlugin.exe.so"
|
||||
|
||||
mv "$ZYNLIB" "$ZYNBIN"
|
||||
mv "$VSTLIB" "$VSTBIN" || true
|
||||
|
||||
# Patch the desktop file
|
||||
sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE"
|
||||
|
||||
# Fix linking for soft-linked plugins
|
||||
for file in "${APPDIR}usr/lib/lmms/"*.so; do
|
||||
thisfile="${APPDIR}usr/lib/lmms/${file##*/}"
|
||||
executables="${executables} -executable=$thisfile"
|
||||
done
|
||||
executables="${executables} -executable=${ZYNBIN}"
|
||||
executables="${executables} -executable=${VSTBIN}"
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imp_1199.so"
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197.so"
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so"
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so"
|
||||
|
||||
# Bundle both qt and non-qt dependencies into appimage format
|
||||
echo -e "\nBundling and relinking system dependencies..."
|
||||
echo -e ">>>>> linuxdeployqt" > "$LOGFILE"
|
||||
# shellcheck disable=SC2086
|
||||
"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1
|
||||
success "Bundled and relinked dependencies"
|
||||
|
||||
# Link to original location so lmms can find them
|
||||
ln -sr "$ZYNBIN" "$ZYNLIB"
|
||||
ln -sr "$VSTBIN" "$VSTLIB" || true
|
||||
|
||||
# Remove wine library conflict
|
||||
rm -f "${APPDIR}/usr/lib/libwine.so.1"
|
||||
|
||||
# Use system-provided carla
|
||||
rm -f "${APPDIR}usr/lib/"libcarla*.so
|
||||
rm -f "${APPDIR}usr/lib/lmms/optional/"libcarla*.so
|
||||
|
||||
# Remove bundled jack in LD_LIBRARY_PATH if exists
|
||||
if [ -e "${APPDIR}/usr/lib/libjack.so.0" ]; then
|
||||
rm "${APPDIR}/usr/lib/libjack.so.0"
|
||||
fi
|
||||
|
||||
# Bundle jack out of LD_LIBRARY_PATH
|
||||
JACK_LIB=$(ldd "${APPDIR}/usr/bin/lmms.real" | sed -n 's/\tlibjack\.so\.0 => \(.\+\) (0x[0-9a-f]\+)/\1/p')
|
||||
if [ -e "$JACK_LIB" ]; then
|
||||
mkdir -p "${APPDIR}usr/lib/lmms/optional/"
|
||||
cp "$JACK_LIB" "${APPDIR}usr/lib/lmms/optional/"
|
||||
fi
|
||||
|
||||
# Point the AppRun to the shim launcher
|
||||
rm -f "${APPDIR}/AppRun"
|
||||
ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun"
|
||||
|
||||
# Create AppImage
|
||||
echo -e "\nFinishing the AppImage..."
|
||||
echo -e "\n\n>>>>> appimagetool" >> "$LOGFILE"
|
||||
"$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" >> "$LOGFILE" 2>&1
|
||||
success "Created @APPIMAGE_FILE@"
|
||||
|
||||
echo -e "\nFinished"
|
||||
@@ -1,78 +1,93 @@
|
||||
# Copyright (c) 2024, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
|
||||
# A wrapper around pkg-config-provided and cmake-provided bash completion that
|
||||
# will have dynamic behavior at INSTALL() time to allow both root-level
|
||||
# INSTALL() as well as user-level INSTALL().
|
||||
#
|
||||
# See also https://github.com/scop/bash-completion
|
||||
#
|
||||
# Copyright (c) 2018, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
# Description:
|
||||
# Fail-safe bash-completion installation support
|
||||
# - Installs to ${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions
|
||||
# - Attempts to calculate and install to system-wide location
|
||||
# - See also https://github.com/scop/bash-completion
|
||||
#
|
||||
# Usage:
|
||||
# INCLUDE(BashCompletion)
|
||||
# BASHCOMP_INSTALL(foo)
|
||||
# ... where "foo" is a shell script adjacent to the CMakeLists.txt
|
||||
#
|
||||
# How it determines BASHCOMP_PKG_PATH, in order:
|
||||
# 1. Uses BASHCOMP_PKG_PATH if already set (e.g. -DBASHCOMP_PKG_PATH=...)
|
||||
# a. If not, uses pkg-config's PKG_CHECK_MODULES to determine path
|
||||
# b. Fallback to cmake's FIND_PACKAGE(bash-completion) path
|
||||
# c. Fallback to hard-coded /usr/share/bash-completion/completions
|
||||
# 2. Final fallback to ${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions if
|
||||
# detected path is unwritable.
|
||||
|
||||
# Honor manual override if provided
|
||||
if(NOT BASHCOMP_PKG_PATH)
|
||||
# First, use pkg-config, which is the most reliable
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKGCONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(BASH_COMPLETION bash-completion)
|
||||
PKG_GET_VARIABLE(BASHCOMP_PKG_PATH bash-completion completionsdir)
|
||||
else()
|
||||
# Second, use cmake (preferred but less common)
|
||||
find_package(bash-completion QUIET)
|
||||
if(BASH_COMPLETION_FOUND)
|
||||
set(BASHCOMP_PKG_PATH "${BASH_COMPLETION_COMPLETIONSDIR}")
|
||||
endif()
|
||||
endif()
|
||||
# - Windows does not support bash completion
|
||||
# - macOS support should eventually be added for Homebrew (TODO)
|
||||
IF(WIN32)
|
||||
MESSAGE(STATUS "Bash competion is not supported on this platform.")
|
||||
ELSEIF(APPLE)
|
||||
MESSAGE(STATUS "Bash completion is not yet implemented for this platform.")
|
||||
ELSE()
|
||||
INCLUDE(FindUnixCommands)
|
||||
# Honor manual override if provided
|
||||
IF(NOT BASHCOMP_PKG_PATH)
|
||||
# First, use pkg-config, which is the most reliable
|
||||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
IF(PKGCONFIG_FOUND)
|
||||
PKG_CHECK_MODULES(BASH_COMPLETION bash-completion)
|
||||
PKG_GET_VARIABLE(BASHCOMP_PKG_PATH bash-completion completionsdir)
|
||||
ELSE()
|
||||
# Second, use cmake (preferred but less common)
|
||||
FIND_PACKAGE(bash-completion QUIET)
|
||||
IF(BASH_COMPLETION_FOUND)
|
||||
SET(BASHCOMP_PKG_PATH "${BASH_COMPLETION_COMPLETIONSDIR}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Third, use a hard-coded fallback value
|
||||
if("${BASHCOMP_PKG_PATH}" STREQUAL "")
|
||||
set(BASHCOMP_PKG_PATH "/usr/share/bash-completion/completions")
|
||||
endif()
|
||||
endif()
|
||||
# Third, use a hard-coded fallback value
|
||||
IF("${BASHCOMP_PKG_PATH}" STREQUAL "")
|
||||
SET(BASHCOMP_PKG_PATH "/usr/share/bash-completion/completions")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Always provide a fallback for non-root INSTALL()
|
||||
# * "lmms" subfolder ensures we don't pollute /usr/local/share/ on default "make install"
|
||||
set(BASHCOMP_USER_PATH "share/${PROJECT_NAME}/bash-completion/completions")
|
||||
# Always provide a fallback for non-root INSTALL()
|
||||
SET(BASHCOMP_USER_PATH "${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions")
|
||||
|
||||
macro(BASHCOMP_INSTALL SCRIPT_NAME)
|
||||
# Note: When running from CPack, message(...) will be suppressed unless WARNING
|
||||
if(WIN32)
|
||||
message(STATUS "Bash completion is not supported on this platform.")
|
||||
else()
|
||||
# Install a copy of bash completion to the default install prefix
|
||||
# See also: https://github.com/LMMS/lmms/pull/7252/files#r1815749125
|
||||
install(FILES "${SCRIPT_NAME}" DESTINATION "${BASHCOMP_USER_PATH}")
|
||||
|
||||
# Next, blindly attempt a system-wide install, ignoring failure
|
||||
# See also: https://stackoverflow.com/q/58448332
|
||||
# * CPack doesn't use CMAKE_INSTALL_PREFIX, so the original will be missing when packaging
|
||||
# and this step will be skipped
|
||||
# * For non-root installs (e.g. ../target), this will silently fail
|
||||
set(BASHCOMP_ORIG "${CMAKE_INSTALL_PREFIX}/${BASHCOMP_USER_PATH}/${CMAKE_PROJECT_NAME}")
|
||||
set(BASHCOMP_LINK "${BASHCOMP_PKG_PATH}/${CMAKE_PROJECT_NAME}")
|
||||
|
||||
if(BASHCOMP_PKG_PATH)
|
||||
# TODO: CMake 3.21 Use "file(COPY_FILE ...)"
|
||||
install(CODE "
|
||||
if(EXISTS \"${BASHCOMP_ORIG}\")
|
||||
file(REMOVE \"${BASHCOMP_LINK}\")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
\"${BASHCOMP_ORIG}\"
|
||||
\"${BASHCOMP_LINK}\"
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE result)
|
||||
if(result EQUAL 0)
|
||||
message(STATUS \"Bash completion-support has been installed to ${BASHCOMP_LINK}\")
|
||||
endif()
|
||||
endif()
|
||||
")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
# Cmake doesn't allow easy use of conditional logic at INSTALL() time
|
||||
# this is a problem because ${BASHCOMP_PKG_PATH} may not be writable and we
|
||||
# need sane fallback behavior for bundled INSTALL() (e.g. .AppImage, etc).
|
||||
#
|
||||
# The reason this can't be detected by cmake is that it's fairly common to
|
||||
# run "cmake" as a one user (i.e. non-root) and "make install" as another user
|
||||
# (i.e. root).
|
||||
#
|
||||
# - Creates a script called "install_${SCRIPT_NAME}_completion.sh" into the
|
||||
# working binary directory and invokes this script at install.
|
||||
# - Script handles INSTALL()-time conditional logic for sane ballback behavior
|
||||
# when ${BASHCOMP_PKG_PATH} is unwritable (i.e. non-root); Something cmake
|
||||
# can't handle on its own at INSTALL() time)
|
||||
MACRO(BASHCOMP_INSTALL SCRIPT_NAME)
|
||||
# A shell script for wrapping conditionl logic
|
||||
SET(BASHCOMP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_${SCRIPT_NAME}_completion.sh")
|
||||
|
||||
FILE(WRITE ${BASHCOMP_SCRIPT} "\
|
||||
#!${BASH}\n\
|
||||
set -e\n\
|
||||
if [ -w \"${BASHCOMP_PKG_PATH}\" ]; then\n\
|
||||
BASHCOMP_PKG_PATH=\"${BASHCOMP_PKG_PATH}\"\n\
|
||||
else \n\
|
||||
BASHCOMP_PKG_PATH=\"\$DESTDIR${BASHCOMP_USER_PATH}\"\n\
|
||||
fi\n\
|
||||
echo -e \"\\nInstalling bash completion...\\n\"\n\
|
||||
mkdir -p \"\$BASHCOMP_PKG_PATH\"\n\
|
||||
cp \"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_NAME}\" \"\$BASHCOMP_PKG_PATH\"\n\
|
||||
chmod a+r \"\$BASHCOMP_PKG_PATH/${SCRIPT_NAME}\"\n\
|
||||
echo -e \"Bash completion for ${SCRIPT_NAME} has been installed to \$BASHCOMP_PKG_PATH/${SCRIPT_NAME}\"\n\
|
||||
")
|
||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x \"install_${SCRIPT_NAME}_completion.sh\" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )")
|
||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"./install_${SCRIPT_NAME}_completion.sh\" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )")
|
||||
|
||||
MESSAGE(STATUS "Bash completion script for ${SCRIPT_NAME} will be installed to ${BASHCOMP_PKG_PATH} or fallback to ${BASHCOMP_USER_PATH} if unwritable.")
|
||||
ENDMACRO()
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
# BuildPlugin.cmake - Copyright (c) 2008 Tobias Doerffel
|
||||
#
|
||||
# description: build LMMS-plugin
|
||||
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> LINK <SHARED|MODULE>)
|
||||
|
||||
INCLUDE(GenQrc)
|
||||
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE>)
|
||||
|
||||
MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "LINK;EXPORT_BASE_NAME" "MOCFILES;EMBEDDED_RESOURCES" ${ARGN})
|
||||
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "" "MOCFILES;EMBEDDED_RESOURCES;UICFILES;LINK" ${ARGN})
|
||||
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})
|
||||
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/include")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src/gui")
|
||||
|
||||
ADD_DEFINITIONS(-DPLUGIN_NAME=${PLUGIN_NAME})
|
||||
|
||||
@@ -27,13 +25,23 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ENDFOREACH()
|
||||
SET(PLUGIN_EMBEDDED_RESOURCES ${NEW_ARGS})
|
||||
|
||||
ADD_GEN_QRC(RCC_OUT "${PLUGIN_NAME}.qrc" PREFIX artwork/${PLUGIN_NAME} ${PLUGIN_EMBEDDED_RESOURCES})
|
||||
SET(ER_H "${CMAKE_CURRENT_BINARY_DIR}/embedded_resources.h")
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${ER_H}
|
||||
COMMAND ${BIN2RES}
|
||||
ARGS ${PLUGIN_EMBEDDED_RESOURCES} > "${ER_H}"
|
||||
DEPENDS bin2res)
|
||||
ENDIF(ER_LEN)
|
||||
|
||||
cmake_language(CALL QT${QT_VERSION_MAJOR}_WRAP_CPP plugin_MOC_out ${PLUGIN_MOCFILES})
|
||||
IF(QT5)
|
||||
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
|
||||
QT5_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
|
||||
ELSE()
|
||||
QT4_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
|
||||
QT4_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
|
||||
ENDIF()
|
||||
|
||||
FOREACH(f ${PLUGIN_SOURCES})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${ER_H} ${plugin_UIC_out})
|
||||
ENDFOREACH(f)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
@@ -44,50 +52,43 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
|
||||
LINK_LIBRARIES(${QT_LIBRARIES})
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
IF (NOT PLUGIN_LINK)
|
||||
SET(PLUGIN_LINK "MODULE")
|
||||
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Override Qt debug libraries with release versions
|
||||
SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}")
|
||||
ENDIF()
|
||||
|
||||
ADD_LIBRARY(${PLUGIN_NAME} ${PLUGIN_LINK} ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
|
||||
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
|
||||
ADD_LIBRARY(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES} ${plugin_MOC_out})
|
||||
ELSE ()
|
||||
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out})
|
||||
ENDIF ()
|
||||
|
||||
IF(QT5)
|
||||
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)
|
||||
ENDIF()
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} lmms)
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
target_link_libraries("${PLUGIN_NAME}" lmms Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
|
||||
|
||||
INSTALL(TARGETS ${PLUGIN_NAME}
|
||||
LIBRARY DESTINATION "${PLUGIN_DIR}"
|
||||
RUNTIME DESTINATION "${PLUGIN_DIR}"
|
||||
)
|
||||
IF(LMMS_BUILD_WIN32 AND "${PLUGIN_LINK}" STREQUAL "SHARED")
|
||||
INSTALL(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION "${PLUGIN_DIR}")
|
||||
ELSE()
|
||||
INSTALL(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION "${PLUGIN_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
|
||||
TARGET_LINK_OPTIONS(${PLUGIN_NAME} PRIVATE -undefined dynamic_lookup)
|
||||
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
||||
ELSE()
|
||||
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-bundle_loader \"${CMAKE_BINARY_DIR}/lmms\"")
|
||||
ENDIF()
|
||||
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
|
||||
ENDIF(LMMS_BUILD_APPLE)
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
add_custom_command(
|
||||
TARGET "${PLUGIN_NAME}"
|
||||
POST_BUILD
|
||||
COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:${PLUGIN_NAME}>"
|
||||
VERBATIM
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
|
||||
ENDIF()
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${RCC_OUT} ${plugin_MOC_out}")
|
||||
|
||||
IF(NOT PLUGIN_EXPORT_BASE_NAME)
|
||||
SET(PLUGIN_EXPORT_BASE_NAME "PLUGIN")
|
||||
ENDIF()
|
||||
|
||||
GENERATE_EXPORT_HEADER(${PLUGIN_NAME}
|
||||
BASE_NAME ${PLUGIN_EXPORT_BASE_NAME}
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(${PLUGIN_NAME}
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
)
|
||||
|
||||
SET_PROPERTY(GLOBAL APPEND PROPERTY PLUGINS_BUILT ${PLUGIN_NAME})
|
||||
GET_PROPERTY(PLUGINS_BUILT GLOBAL PROPERTY PLUGINS_BUILT)
|
||||
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ER_H} ${plugin_MOC_out}")
|
||||
ENDMACRO(BUILD_PLUGIN)
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
|
||||
macro(CHECK_CXX_PREPROCESSOR VAR DIRECTIVE)
|
||||
string(RANDOM DEFINED_KEY)
|
||||
string(RANDOM UNDEFINED_KEY)
|
||||
|
||||
set(TMP_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/CxxTmp/src.cpp")
|
||||
SET(SRC "
|
||||
#if ${DIRECTIVE}
|
||||
#error ${DEFINED_KEY}
|
||||
#else
|
||||
#error ${UNDEFINED_KEY}
|
||||
#endif
|
||||
")
|
||||
file(WRITE ${TMP_FILENAME} "${SRC}")
|
||||
try_compile(RESULT_VAR
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${TMP_FILENAME}
|
||||
OUTPUT_VARIABLE OUTPUT_VAR
|
||||
)
|
||||
|
||||
if(OUTPUT_VAR MATCHES ${DEFINED_KEY})
|
||||
set(${VAR} ON)
|
||||
elseif(OUTPUT_VAR MATCHES ${UNDEFINED_KEY})
|
||||
set(${VAR} OFF)
|
||||
else()
|
||||
message(FATAL_ERROR "Can't determine if \"${DIRECTIVE}\" is true.")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(CHECK_CXX_DEFINE VAR DEFINE)
|
||||
CHECK_CXX_PREPROCESSOR(${VAR} "defined(${DEFINE})")
|
||||
endmacro()
|
||||
@@ -1,213 +0,0 @@
|
||||
# Utility for validating and, if needed, cloning all submodules
|
||||
#
|
||||
# Looks for a .gitmodules in the root project folder
|
||||
# Loops over all modules looking well-known configure/build scripts
|
||||
#
|
||||
# Usage:
|
||||
# INCLUDE(CheckSubmodules)
|
||||
#
|
||||
# Options:
|
||||
# SET(PLUGIN_LIST "ZynAddSubFx;...") # skips submodules for plugins not explicitly listed
|
||||
#
|
||||
# Or via command line:
|
||||
# cmake -PLUGIN_LIST=foo;bar
|
||||
#
|
||||
# Copyright (c) 2019, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# Files which confirm a successful clone
|
||||
SET(VALID_CRUMBS "CMakeLists.txt;Makefile;Makefile.in;Makefile.am;configure.ac;configure.py;autogen.sh;.gitignore;LICENSE;Home.md;license.txt")
|
||||
|
||||
OPTION(NO_SHALLOW_CLONE "Disable shallow cloning of submodules" OFF)
|
||||
|
||||
# Try and use the specified shallow clone on submodules, if supported
|
||||
SET(DEPTH_VALUE 100)
|
||||
|
||||
# Number of times git commands will retry before failing
|
||||
SET(MAX_ATTEMPTS 2)
|
||||
|
||||
MESSAGE("\nChecking submodules...")
|
||||
IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/.gitmodules")
|
||||
MESSAGE("Skipping the check because .gitmodules not detected."
|
||||
"Please make sure you have all submodules in the source tree!"
|
||||
)
|
||||
RETURN()
|
||||
ENDIF()
|
||||
FILE(READ "${CMAKE_SOURCE_DIR}/.gitmodules" SUBMODULE_DATA)
|
||||
|
||||
# Force English locale
|
||||
SET(LC_ALL_BACKUP "$ENV{LC_ALL}")
|
||||
SET(LANG_BACKUP "$ENV{LANG}")
|
||||
SET(ENV{LC_ALL} "C")
|
||||
SET(ENV{LANG} "en_US")
|
||||
|
||||
# Submodule list pairs, unparsed (WARNING: Assumes alphanumeric paths)
|
||||
STRING(REGEX MATCHALL "path = [-0-9A-Za-z/]+" SUBMODULE_LIST_RAW ${SUBMODULE_DATA})
|
||||
STRING(REGEX MATCHALL "url = [.:%-0-9A-Za-z/]+" SUBMODULE_URL_RAW ${SUBMODULE_DATA})
|
||||
|
||||
# Submodule list pairs, parsed
|
||||
SET(SUBMODULE_LIST "")
|
||||
SET(SUBMODULE_URL "")
|
||||
|
||||
FOREACH(_path ${SUBMODULE_LIST_RAW})
|
||||
# Parse SUBMODULE_PATH
|
||||
STRING(REPLACE "path = " "" SUBMODULE_PATH "${_path}")
|
||||
|
||||
# Grab index for matching SUBMODULE_URL
|
||||
LIST(FIND SUBMODULE_LIST_RAW "${_path}" SUBMODULE_INDEX)
|
||||
LIST(GET SUBMODULE_URL_RAW ${SUBMODULE_INDEX} _url)
|
||||
|
||||
# Parse SUBMODULE_URL
|
||||
STRING(REPLACE "url = " "" SUBMODULE_URL "${_url}")
|
||||
|
||||
SET(SKIP false)
|
||||
|
||||
# Loop over skipped plugins, add to SKIP_SUBMODULES (e.g. -DPLUGIN_LIST=foo;bar)
|
||||
IF(${SUBMODULE_PATH} MATCHES "^plugins/")
|
||||
SET(REMOVE_PLUGIN true)
|
||||
FOREACH(_plugin ${PLUGIN_LIST})
|
||||
IF(_plugin STREQUAL "")
|
||||
CONTINUE()
|
||||
ENDIF()
|
||||
IF(${SUBMODULE_PATH} MATCHES "${_plugin}")
|
||||
SET(REMOVE_PLUGIN false)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
IF(REMOVE_PLUGIN)
|
||||
LIST(APPEND SKIP_SUBMODULES "${SUBMODULE_PATH}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Finally, loop and mark "SKIP" on match
|
||||
IF(SKIP_SUBMODULES)
|
||||
FOREACH(_skip ${SKIP_SUBMODULES})
|
||||
IF("${SUBMODULE_PATH}" MATCHES "${_skip}")
|
||||
MESSAGE("-- Skipping ${SUBMODULE_PATH} matches \"${_skip}\" (absent in PLUGIN_LIST)")
|
||||
SET(SKIP true)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT SKIP)
|
||||
LIST(APPEND SUBMODULE_LIST "${SUBMODULE_PATH}")
|
||||
LIST(APPEND SUBMODULE_URL "${SUBMODULE_URL}")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
# Once called, status is stored in GIT_RESULT respectively.
|
||||
# Note: Git likes to write to stderr. Don't assume stderr is error; Check GIT_RESULT instead.
|
||||
MACRO(GIT_SUBMODULE SUBMODULE_PATH FORCE_DEINIT FORCE_REMOTE NO_DEPTH)
|
||||
FIND_PACKAGE(Git REQUIRED)
|
||||
# Handle missing commits
|
||||
SET(FORCE_REMOTE_FLAG "${FORCE_REMOTE}")
|
||||
SET(NO_DEPTH_FLAG "${NO_DEPTH}")
|
||||
IF(FORCE_REMOTE_FLAG)
|
||||
MESSAGE("-- Adding remote submodulefix to ${SUBMODULE_PATH}")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${GIT_EXECUTABLE}" remote rm submodulefix
|
||||
COMMAND "${GIT_EXECUTABLE}" remote add submodulefix ${FORCE_REMOTE}
|
||||
COMMAND "${GIT_EXECUTABLE}" fetch submodulefix
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/${SUBMODULE_PATH}"
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
)
|
||||
# Recurse
|
||||
GIT_SUBMODULE(${SUBMODULE_PATH} false false ${NO_DEPTH_FLAG})
|
||||
ELSEIF(${FORCE_DEINIT})
|
||||
MESSAGE("-- Resetting ${SUBMODULE_PATH}")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${GIT_EXECUTABLE}" submodule deinit -f "${CMAKE_SOURCE_DIR}/${SUBMODULE_PATH}"
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_QUIET
|
||||
)
|
||||
MESSAGE("-- Deleting ${CMAKE_SOURCE_DIR}/.git/${SUBMODULE_PATH}")
|
||||
FILE(REMOVE_RECURSE "${CMAKE_SOURCE_DIR}/.git/modules/${SUBMODULE_PATH}")
|
||||
# Recurse without depth
|
||||
GIT_SUBMODULE(${SUBMODULE_PATH} false false true)
|
||||
ELSE()
|
||||
# Try to use the depth switch
|
||||
IF(NO_SHALLOW_CLONE OR GIT_VERSION_STRING VERSION_LESS "1.8.4" OR NO_DEPTH_FLAG)
|
||||
# Shallow submodules were introduced in 1.8.4
|
||||
MESSAGE("-- Fetching ${SUBMODULE_PATH}")
|
||||
SET(DEPTH_CMD "")
|
||||
SET(DEPTH_VAL "")
|
||||
ELSE()
|
||||
MESSAGE("-- Fetching ${SUBMODULE_PATH} @ --depth ${DEPTH_VALUE}")
|
||||
SET(DEPTH_CMD "--depth")
|
||||
SET(DEPTH_VAL "${DEPTH_VALUE}")
|
||||
ENDIF()
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive ${DEPTH_CMD} ${DEPTH_VAL} "${CMAKE_SOURCE_DIR}/${SUBMODULE_PATH}"
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE GIT_RESULT
|
||||
OUTPUT_VARIABLE GIT_STDOUT
|
||||
ERROR_VARIABLE GIT_STDERR
|
||||
)
|
||||
|
||||
SET(GIT_MESSAGE "${GIT_STDOUT}${GIT_STDERR}")
|
||||
MESSAGE("${GIT_MESSAGE}")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
SET(MISSING_COMMIT_PHRASES "no such remote ref;reference is not a tree;unadvertised object")
|
||||
SET(RETRY_PHRASES "Failed to recurse;cannot create directory;already exists;${MISSING_COMMIT_PHRASES}")
|
||||
|
||||
# Attempt to do lazy clone
|
||||
FOREACH(_submodule ${SUBMODULE_LIST})
|
||||
STRING(REPLACE "/" ";" PATH_PARTS "${_submodule}")
|
||||
LIST(REVERSE PATH_PARTS)
|
||||
LIST(GET PATH_PARTS 0 SUBMODULE_NAME)
|
||||
|
||||
MESSAGE("-- Checking ${SUBMODULE_NAME}...")
|
||||
SET(CRUMB_FOUND false)
|
||||
FOREACH(_crumb ${VALID_CRUMBS})
|
||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/${_submodule}/${_crumb}")
|
||||
SET(CRUMB_FOUND true)
|
||||
MESSAGE("-- Found ${_submodule}/${_crumb}")
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
IF(NOT CRUMB_FOUND)
|
||||
GIT_SUBMODULE("${_submodule}" false false false)
|
||||
|
||||
SET(COUNTED 0)
|
||||
# Handle edge-cases where submodule didn't clone properly or re-uses a non-empty directory
|
||||
WHILE(NOT GIT_RESULT EQUAL 0 AND COUNTED LESS MAX_ATTEMPTS)
|
||||
MATH(EXPR COUNTED "${COUNTED}+1")
|
||||
SET(MISSING_COMMIT false)
|
||||
FOREACH(_phrase ${MISSING_COMMIT_PHRASES})
|
||||
IF("${GIT_MESSAGE}" MATCHES "${_phrase}")
|
||||
SET(MISSING_COMMIT true)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
FOREACH(_phrase ${RETRY_PHRASES})
|
||||
IF(${MISSING_COMMIT} AND COUNTED LESS 2)
|
||||
LIST(FIND SUBMODULE_LIST ${_submodule} SUBMODULE_INDEX)
|
||||
LIST(GET SUBMODULE_URL_LIST ${SUBMODULE_INDEX} SUBMODULE_URL)
|
||||
MESSAGE("-- Retrying ${_submodule} using 'remote add submodulefix' (attempt ${COUNTED} of ${MAX_ATTEMPTS})...")
|
||||
|
||||
GIT_SUBMODULE("${_submodule}" false "${SUBMODULE_URL}" false)
|
||||
BREAK()
|
||||
ELSEIF("${GIT_MESSAGE}" MATCHES "${_phrase}")
|
||||
MESSAGE("-- Retrying ${_submodule} using 'deinit' (attempt ${COUNTED} of ${MAX_ATTEMPTS})...")
|
||||
GIT_SUBMODULE("${_submodule}" true false false)
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ENDWHILE()
|
||||
|
||||
IF(NOT GIT_RESULT EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "${GIT_EXECUTABLE} exited with status of ${GIT_RESULT}")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
MESSAGE("-- Done validating submodules.\n")
|
||||
|
||||
# Reset locale
|
||||
SET(ENV{LC_ALL} "${LC_ALL_BACKUP}")
|
||||
SET(ENV{LANG} "${LANG_BACKUP}")
|
||||
@@ -1,39 +0,0 @@
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
FUNCTION(CheckWineGcc BITNESS WINEGCC_EXECUTABLE RESULT)
|
||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx" "
|
||||
#include <iostream>
|
||||
#define USE_WS_PREFIX
|
||||
#include <windows.h>
|
||||
int main(int argc, const char* argv[]) {
|
||||
return 0;
|
||||
}
|
||||
")
|
||||
|
||||
# Handle non-Intel platforms
|
||||
IF(LMMS_HOST_X86_64 OR LMMS_HOST_X86)
|
||||
SET(MPLATFORM "-m${BITNESS}")
|
||||
ELSEIF(BITNESS EQUAL 64)
|
||||
SET(MPLATFORM "")
|
||||
ELSE()
|
||||
# Skip 32-bit for non-Intel
|
||||
SET(${RESULT} False PARENT_SCOPE)
|
||||
RETURN()
|
||||
ENDIF()
|
||||
|
||||
EXECUTE_PROCESS(COMMAND ${WINEGCC_EXECUTABLE} "${MPLATFORM}"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
|
||||
"-o" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
RESULT_VARIABLE WINEGCC_RESULT
|
||||
)
|
||||
FILE(REMOVE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.exe.so"
|
||||
)
|
||||
IF(WINEGCC_RESULT EQUAL 0)
|
||||
SET(${RESULT} True PARENT_SCOPE)
|
||||
ELSE()
|
||||
SET(${RESULT} False PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
@@ -1,40 +0,0 @@
|
||||
option(USE_COMPILE_CACHE "Use a compiler cache for compilation" OFF)
|
||||
|
||||
# Compatibility for old option name
|
||||
if(USE_CCACHE)
|
||||
set(USE_COMPILE_CACHE ON)
|
||||
endif()
|
||||
|
||||
if(NOT USE_COMPILE_CACHE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "(GNU|AppleClang|Clang|MSVC)")
|
||||
message(WARNING "Compiler cache only available with MSVC or GNU")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CACHE_TOOL_NAME ccache)
|
||||
find_program(CACHE_TOOL "${CACHE_TOOL_NAME}")
|
||||
if(NOT CACHE_TOOL)
|
||||
message(WARNING "USE_COMPILE_CACHE enabled, but no ${CACHE_TOOL_NAME} found")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# ccache doesn't support debug information in the PDB format. Setting the
|
||||
# debug information format requires CMP0141, introduced with CMake 3.25, to
|
||||
# be set to NEW prior to the initial `project` command.
|
||||
if(CMAKE_VERSION VERSION_LESS "3.25")
|
||||
message(WARNING "Use of compiler cache with MSVC requires at least CMake 3.25")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
|
||||
endif()
|
||||
|
||||
message(STATUS "Using ${CACHE_TOOL} for compiler caching")
|
||||
|
||||
# TODO CMake 3.21: Use CMAKE_<LANG>_<COMPILER|LINKER>_LAUNCHER variables instead
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CACHE_TOOL}")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CACHE_TOOL}")
|
||||
@@ -1,76 +0,0 @@
|
||||
# Copy source_lib's dependency matching 'name_match' into specified location
|
||||
# Sets variable named in relocated_lib to the destination
|
||||
macro(copy_dependency source_lib name_match destination relocated_lib)
|
||||
if(NOT COMMAND_ECHO OR "${COMMAND_ECHO}" STREQUAL "NONE")
|
||||
set(_command_echo NONE)
|
||||
else()
|
||||
set(_command_echo "${COMMAND_ECHO}")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND file -b --mime-type "${source_lib}" OUTPUT_VARIABLE file_type)
|
||||
|
||||
set(_is_linux_lib false)
|
||||
set(_is_mac_lib false)
|
||||
|
||||
if("${file_type}" MATCHES "application/x-pie-executable")
|
||||
# Linux ELF binary
|
||||
set(_is_linux_lib true)
|
||||
list(APPEND _lib_command ldd)
|
||||
elseif("${file_type}" MATCHES "application/x-mach-binary")
|
||||
# macOS Mach-O binary
|
||||
set(_is_mac_lib true)
|
||||
list(APPEND _lib_command otool -L)
|
||||
else()
|
||||
message(FATAL_ERROR "Copying dependencies for ${file_type} are not yet supported")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${_lib_command}
|
||||
"${source_lib}"
|
||||
OUTPUT_VARIABLE raw_output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
COMMAND_ECHO ${_command_echo}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# escape periods to avoid double-escaping
|
||||
string(REPLACE "." "\\." name_match "${name_match}")
|
||||
|
||||
# cli output --> list
|
||||
string(REPLACE "\n" ";" raw_list "${raw_output}")
|
||||
|
||||
foreach(line ${raw_list})
|
||||
if(line MATCHES "${name_match}")
|
||||
if(_is_linux_lib)
|
||||
# Assumes format "libname.so.0 => /lib/location/libname.so.0 (0x00007f48d0b0e000)"
|
||||
string(REGEX MATCH "=> ([^\\(]+)" dummy_var "${line}")
|
||||
# Trim leading/trailing whitespace and add to our list
|
||||
string(STRIP "${CMAKE_MATCH_1}" lib)
|
||||
elseif(_is_mac_lib)
|
||||
# Assumes format "@loader_path/../Frameworks/libname-0.0.dylib (compatibility version 0.0.0, current version 0.24.26)"
|
||||
string(REGEX MATCH "^[ \t]+(.*) \\(" dummy_var "${line}")
|
||||
string(STRIP "${CMAKE_MATCH_1}" lib)
|
||||
get_filename_component(loader_path ${source_lib} DIRECTORY)
|
||||
string(REPLACE "@loader_path" "${loader_path}" resolved_lib "${lib}")
|
||||
string(REPLACE "@rpath" "${loader_path}" resolved_lib "${lib}")
|
||||
# Special handling for '@executable_path'
|
||||
if(line MATCHES "@executable_path")
|
||||
# Find the position of '/Contents/'
|
||||
string(FIND "${APP_PATH}" "/Contents/" APP_CONTENTS_POS)
|
||||
# Extract the base path up to '/Contents/'
|
||||
string(SUBSTRING "${loader_path}" 0 "${APP_CONTENTS_POS}" app_base_path)
|
||||
string(REPLACE "@executable_path" "${app_base_path}/Contents/MacOS" resolved_lib "${lib}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Resolve any possible symlinks
|
||||
file(REAL_PATH "${lib}" libreal)
|
||||
get_filename_component(symname "${lib}" NAME)
|
||||
get_filename_component(realname "${libreal}" NAME)
|
||||
file(MAKE_DIRECTORY "${destination}")
|
||||
# Copy, but with original symlink name
|
||||
file(COPY "${libreal}" DESTINATION "${destination}")
|
||||
file(RENAME "${destination}/${realname}" "${destination}/${symname}")
|
||||
set("${relocated_lib}" "${destination}/${symname}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
@@ -1,34 +0,0 @@
|
||||
# Offer relative symlink support via "cmake -E create_symlink"
|
||||
# For verbose, set COMMAND_ECHO to STDOUT in calling script
|
||||
macro(create_symlink filepath sympath)
|
||||
if(CMAKE_COMMAND)
|
||||
set(_cmake_command "${CMAKE_COMMAND}")
|
||||
elseif(CPACK_CMAKE_COMMAND)
|
||||
set(_cmake_command "${CPACK_CMAKE_COMMAND}")
|
||||
else()
|
||||
message(FATAL_ERROR "Sorry, can't resolve variable CMAKE_COMMAND")
|
||||
endif()
|
||||
|
||||
if(NOT IS_ABSOLUTE "${sympath}")
|
||||
message(FATAL_ERROR "Sorry, this command only works with absolute paths")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED COMMAND_ECHO)
|
||||
set(_command_echo NONE)
|
||||
else()
|
||||
set(_command_echo "${COMMAND_ECHO}")
|
||||
endif()
|
||||
|
||||
# Calculate the relative path
|
||||
file(RELATIVE_PATH reldir "${sympath}/../" "${filepath}")
|
||||
get_filename_component(symname "${sympath}" NAME)
|
||||
|
||||
# Calculate the working directory
|
||||
get_filename_component(sympath_parent "${sympath}" DIRECTORY)
|
||||
|
||||
# Create the symbolic link
|
||||
execute_process(COMMAND "${_cmake_command}" -E create_symlink "${reldir}" "${symname}"
|
||||
WORKING_DIRECTORY "${sympath_parent}"
|
||||
COMMAND_ECHO ${_command_echo}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
endmacro()
|
||||
@@ -1,21 +0,0 @@
|
||||
function(CreateTempFilePath)
|
||||
set(options CONFIG_SUFFIX)
|
||||
set(oneValueArgs OUTPUT_VAR TAG)
|
||||
set(multiValueArgs CONTENT)
|
||||
cmake_parse_arguments(TEMP "${options}" "${oneValueArgs}"
|
||||
"${multiValueArgs}" ${ARGN} )
|
||||
|
||||
# Use hash to create a unique identifier
|
||||
# for this file.
|
||||
string(SHA1 hashed_content "${TEMP_CONTENT}")
|
||||
|
||||
set(file_name "${CMAKE_BINARY_DIR}/${TEMP_TAG}_${hashed_content}")
|
||||
set(${TEMP_OUTPUT_VAR} "${file_name}" PARENT_SCOPE)
|
||||
if(TEMP_CONFIG_SUFFIX)
|
||||
set(file_name "${file_name}_$<CONFIG>")
|
||||
endif()
|
||||
|
||||
file(GENERATE OUTPUT "${file_name}"
|
||||
CONTENT "${TEMP_CONTENT}")
|
||||
|
||||
endfunction()
|
||||
@@ -1,31 +0,0 @@
|
||||
# This functions forwards a variable to
|
||||
# the install stage.
|
||||
# Parameters:
|
||||
# CONTENT: Variable content.
|
||||
# NAME: Variable name.
|
||||
# Options:
|
||||
# GENERATOR_EXPRESSION: Support generator expression for CONTENT.
|
||||
function(DEFINE_INSTALL_VAR)
|
||||
set(options GENERATOR_EXPRESSION)
|
||||
set(oneValueArgs NAME )
|
||||
set(multiValueArgs CONTENT)
|
||||
cmake_parse_arguments(VAR "${options}" "${oneValueArgs}"
|
||||
"${multiValueArgs}" ${ARGN} )
|
||||
|
||||
# install(CODE) does not support generator expression in ver<3.14
|
||||
if(VAR_GENERATOR_EXPRESSION AND ${CMAKE_VERSION} VERSION_LESS "3.14.0")
|
||||
include(CreateTempFile)
|
||||
if(CMAKE_CONFIGURATION_TYPES) # in case of multi-config generators like MSVC generators
|
||||
CreateTempFilePath(OUTPUT_VAR file_path TAG "${VAR_NAME}" CONTENT "${VAR_CONTENT}" CONFIG_SUFFIX)
|
||||
install(CODE "file(READ \"${file_path}_\${CMAKE_INSTALL_CONFIG_NAME}\" \"${VAR_NAME}\")")
|
||||
else()
|
||||
CreateTempFilePath(OUTPUT_VAR file_path TAG "${VAR_NAME}" CONTENT "${VAR_CONTENT}")
|
||||
install(CODE "file(READ \"${file_path}\" \"${VAR_NAME}\")")
|
||||
endif()
|
||||
else()
|
||||
if(VAR_GENERATOR_EXPRESSION)
|
||||
cmake_policy(SET CMP0087 NEW) # install(CODE) and install(SCRIPT) support generator expressions.
|
||||
endif()
|
||||
install(CODE "set(\"${VAR_NAME}\" \"${VAR_CONTENT}\")")
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -12,84 +12,22 @@ ELSE()
|
||||
SET(LMMS_BUILD_LINUX 1)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# See build_mingwXX.sh for LMMS_BUILD_MSYS
|
||||
|
||||
MESSAGE("PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
SET(LMMS_HOST_X86 FALSE)
|
||||
SET(LMMS_HOST_X86_64 FALSE)
|
||||
SET(LMMS_HOST_ARM32 FALSE)
|
||||
SET(LMMS_HOST_ARM64 FALSE)
|
||||
SET(LMMS_HOST_RISCV32 FALSE)
|
||||
SET(LMMS_HOST_RISCV64 FALSE)
|
||||
|
||||
IF(NOT DEFINED WIN64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# TODO: This seems a bit presumptous
|
||||
SET(WIN64 ON)
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
if(MSVC)
|
||||
SET(MSVC_VER ${CMAKE_CXX_COMPILER_VERSION})
|
||||
|
||||
# Detect target architecture
|
||||
IF(CMAKE_GENERATOR_PLATFORM)
|
||||
STRING(TOLOWER "${CMAKE_GENERATOR_PLATFORM}" MSVC_TARGET_PLATFORM)
|
||||
ELSE()
|
||||
STRING(TOLOWER "${CMAKE_VS_PLATFORM_NAME_DEFAULT}" MSVC_TARGET_PLATFORM)
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC_TARGET_PLATFORM MATCHES "x64")
|
||||
SET(IS_X86_64 TRUE)
|
||||
SET(LMMS_BUILD_WIN64 TRUE)
|
||||
ELSEIF(MSVC_TARGET_PLATFORM MATCHES "win32")
|
||||
SET(IS_X86 TRUE)
|
||||
ELSEIF(MSVC_TARGET_PLATFORM MATCHES "arm64")
|
||||
SET(IS_ARM64 TRUE)
|
||||
ELSEIF(MSVC_TARGET_PLATFORM MATCHES "arm")
|
||||
SET(IS_ARM32 TRUE)
|
||||
ELSEIF(CMAKE_CXX_COMPILER MATCHES "amd64/cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "x64/cl.exe$")
|
||||
SET(IS_X86_64 TRUE)
|
||||
SET(LMMS_BUILD_WIN64 TRUE)
|
||||
ELSEIF(CMAKE_CXX_COMPILER MATCHES "bin/cl.exe$" OR CMAKE_CXX_COMPILER MATCHES "x86/cl.exe$")
|
||||
SET(IS_X86 TRUE)
|
||||
ELSEIF(CMAKE_CXX_COMPILER MATCHES "arm64/cl.exe$")
|
||||
SET(IS_ARM64 TRUE)
|
||||
ELSEIF(CMAKE_CXX_COMPILER MATCHES "arm/cl.exe$")
|
||||
SET(IS_ARM32 TRUE)
|
||||
ELSE()
|
||||
MESSAGE(WARNING "Unknown target architecture: ${MSVC_TARGET_PLATFORM}")
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC_VER VERSION_GREATER 19.30 OR MSVC_VER VERSION_EQUAL 19.30)
|
||||
SET(LMMS_MSVC_GENERATOR "Visual Studio 17 2022")
|
||||
SET(LMMS_MSVC_YEAR 2022)
|
||||
ELSEIF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20)
|
||||
SET(LMMS_MSVC_GENERATOR "Visual Studio 16 2019")
|
||||
SET(LMMS_MSVC_YEAR 2019) # Qt only provides binaries for MSVC 2017, but 2019 is binary compatible
|
||||
ELSEIF(MSVC_VER VERSION_GREATER 19.10 OR MSVC_VER VERSION_EQUAL 19.10)
|
||||
SET(LMMS_MSVC_GENERATOR "Visual Studio 15 2017")
|
||||
SET(LMMS_MSVC_YEAR 2017)
|
||||
ELSEIF(MSVC_VER VERSION_GREATER 19.0 OR MSVC_VER VERSION_EQUAL 19.0)
|
||||
SET(LMMS_MSVC_GENERATOR "Visual Studio 14 2015")
|
||||
SET(LMMS_MSVC_YEAR 2015)
|
||||
ELSE()
|
||||
MESSAGE(SEND_WARNING "Can't detect MSVC version: ${MSVC_VER}")
|
||||
ENDIF()
|
||||
|
||||
unset(MSVC_VER)
|
||||
else()
|
||||
# Cross-compiled
|
||||
if($ENV{MSYSTEM_CARCH} MATCHES "aarch64")
|
||||
set(IS_ARM64 TRUE)
|
||||
set(LMMS_BUILD_WIN64 TRUE)
|
||||
elseif(WIN64)
|
||||
set(IS_X86_64 TRUE)
|
||||
set(LMMS_BUILD_WIN64 TRUE)
|
||||
else()
|
||||
set(IS_X86 TRUE)
|
||||
endif()
|
||||
endif()
|
||||
ELSE()
|
||||
# Detect target architecture based on compiler target triple e.g. "x86_64-pc-linux"
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine ${CMAKE_C_FLAGS} OUTPUT_VARIABLE Machine)
|
||||
IF(WIN64)
|
||||
SET(IS_X86_64 TRUE)
|
||||
SET(LMMS_BUILD_WIN64 TRUE)
|
||||
ELSE(WIN64)
|
||||
SET(IS_X86 TRUE)
|
||||
ENDIF(WIN64)
|
||||
ELSE(WIN32)
|
||||
# Detect target architecture based on compiler target triple
|
||||
EXEC_PROGRAM( ${CMAKE_C_COMPILER} ARGS "-dumpmachine ${CMAKE_C_FLAGS}" OUTPUT_VARIABLE Machine )
|
||||
MESSAGE("Machine: ${Machine}")
|
||||
STRING(REGEX MATCH "i.86" IS_X86 "${Machine}")
|
||||
STRING(REGEX MATCH "86_64|amd64" IS_X86_64 "${Machine}")
|
||||
@@ -99,12 +37,6 @@ ELSE()
|
||||
ELSE()
|
||||
SET(IS_ARM32 TRUE)
|
||||
ENDIF()
|
||||
ELSEIF(Machine MATCHES "rv|riscv")
|
||||
IF(Machine MATCHES "rv64|riscv64")
|
||||
SET(IS_RISCV64 TRUE)
|
||||
ELSE()
|
||||
SET(IS_RISCV32 TRUE)
|
||||
ENDIF()
|
||||
ELSEIF(Machine MATCHES "ppc|powerpc")
|
||||
IF(Machine MATCHES "ppc64|powerpc64")
|
||||
SET(IS_PPC64 TRUE)
|
||||
@@ -112,7 +44,7 @@ ELSE()
|
||||
SET(IS_PPC32 TRUE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(IS_X86)
|
||||
MESSAGE("-- Target host is 32 bit, Intel")
|
||||
@@ -126,12 +58,6 @@ ELSEIF(IS_ARM32)
|
||||
ELSEIF(IS_ARM64)
|
||||
MESSAGE("-- Target host is 64 bit, ARM")
|
||||
SET(LMMS_HOST_ARM64 TRUE)
|
||||
ELSEIF(IS_RISCV32)
|
||||
MESSAGE("-- Target host is 32 bit, RISC-V")
|
||||
SET(LMMS_HOST_RISCV32 TRUE)
|
||||
ELSEIF(IS_RISCV64)
|
||||
MESSAGE("-- Target host is 64 bit, RISC-V")
|
||||
SET(LMMS_HOST_RISCV64 TRUE)
|
||||
ELSEIF(IS_PPC32)
|
||||
MESSAGE("-- Target host is 32 bit, PPC")
|
||||
SET(LMMS_HOST_PPC32 TRUE)
|
||||
@@ -165,26 +91,15 @@ IF(LMMS_BUILD_APPLE)
|
||||
# Detect Homebrew versus Macports environment
|
||||
EXECUTE_PROCESS(COMMAND brew --prefix RESULT_VARIABLE DETECT_HOMEBREW OUTPUT_VARIABLE HOMEBREW_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
EXECUTE_PROCESS(COMMAND which port RESULT_VARIABLE DETECT_MACPORTS OUTPUT_VARIABLE MACPORTS_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
IF(DETECT_HOMEBREW EQUAL 0)
|
||||
SET(HOMEBREW 1)
|
||||
SET(APPLE_PREFIX "${HOMEBREW_PREFIX}")
|
||||
# Configure Qt
|
||||
SET(Qt5_DIR "${HOMEBREW_PREFIX}/opt/qt@5/lib/cmake/Qt5")
|
||||
SET(Qt5Test_DIR "${HOMEBREW_PREFIX}/opt/qt@5/lib/cmake/Qt5Test")
|
||||
SET(Qt6_DIR "${HOMEBREW_PREFIX}/opt/qt@6/lib/cmake/Qt6")
|
||||
SET(Qt6Test_DIR "${HOMEBREW_PREFIX}/opt/qt@6/lib/cmake/Qt6Test")
|
||||
ELSEIF(DETECT_MACPORTS EQUAL 0)
|
||||
SET(MACPORTS 1)
|
||||
# move up two directories
|
||||
GET_FILENAME_COMPONENT(MACPORTS_PREFIX "${MACPORTS_PREFIX}" DIRECTORY)
|
||||
GET_FILENAME_COMPONENT(MACPORTS_PREFIX "${MACPORTS_PREFIX}" DIRECTORY)
|
||||
SET(APPLE_PREFIX "${MACPORTS_PREFIX}")
|
||||
# Configure Qt
|
||||
SET(Qt5_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt5")
|
||||
SET(Qt5Test_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt5Test")
|
||||
SET(Qt6_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt6")
|
||||
SET(Qt6Test_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt6Test")
|
||||
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${APPLE_PREFIX}/lib)
|
||||
IF(${DETECT_HOMEBREW} EQUAL 0)
|
||||
SET(HOMEBREW 1)
|
||||
SET(APPLE_PREFIX "${HOMEBREW_PREFIX}")
|
||||
ELSEIF(${DETECT_MACPORTS} EQUAL 0)
|
||||
SET(MACPORTS 1)
|
||||
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
|
||||
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
|
||||
SET(APPLE_PREFIX "${MACPORTS_PREFIX}")
|
||||
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${APPLE_PREFIX}/lib)
|
||||
ENDIF()
|
||||
|
||||
# Detect OS Version
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
# Downloads an executable from the provided URL for use in a build system
|
||||
# and optionally prepends it to the PATH
|
||||
#
|
||||
# Assumes:
|
||||
# - CMAKE_CURRENT_BINARY_DIR/[${_name}]
|
||||
# - CPACK_CURRENT_BINARY_DIR/[${_name}]
|
||||
# - Fallback to $ENV{TMPDIR}/[RANDOM]/[${_name}]
|
||||
# - For verbose, set COMMAND_ECHO to STDOUT in calling script
|
||||
#
|
||||
macro(download_binary RESULT_VARIABLE _url _name _prepend_to_path)
|
||||
if(NOT COMMAND_ECHO OR "${COMMAND_ECHO}" STREQUAL "NONE")
|
||||
set(_command_echo NONE)
|
||||
set(_output_quiet OUTPUT_QUIET)
|
||||
set(_error_quiet ERROR_QUIET)
|
||||
else()
|
||||
set(_command_echo "${COMMAND_ECHO}")
|
||||
set(_output_quiet "")
|
||||
set(_error_quiet "")
|
||||
endif()
|
||||
|
||||
# Check if fuse is needed
|
||||
if("${RESULT_VARIABLE}" MATCHES "\\.AppImage$" OR "${_name}" MATCHES "\\.AppImage$")
|
||||
message(STATUS "AppImage detected, we'll extract the AppImage before using")
|
||||
set(_${RESULT_VARIABLE}_IS_APPIMAGE TRUE)
|
||||
endif()
|
||||
|
||||
# Determine a suitable working directory
|
||||
if(CMAKE_CURRENT_BINARY_DIR)
|
||||
# Assume we're called from configure step
|
||||
set(_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
elseif(CPACK_CURRENT_BINARY_DIR)
|
||||
# Assume cpack (non-standard variable name, but used throughout)
|
||||
set(_working_dir "${CPACK_CURRENT_BINARY_DIR}")
|
||||
else()
|
||||
# Fallback to somewhere temporary, writable
|
||||
if($ENV{_tmpdir})
|
||||
# POSIX
|
||||
set(_tmpdir "$ENV{_tmpdir}")
|
||||
elseif($ENV{TEMP})
|
||||
# Windows
|
||||
set(_tmpdir "$ENV{TEMP}")
|
||||
else()
|
||||
# Linux, shame on you!
|
||||
find_program(MKTEMP mktemp)
|
||||
if(MKTEMP)
|
||||
execute_process(COMMAND mktemp
|
||||
OUTPUT_VARIABLE _working_dir
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
${_output_quiet}
|
||||
COMMAND_ECHO ${_command_echo})
|
||||
# mktemp formats it how we want it
|
||||
else()
|
||||
# Ummm... Linux you can do better!
|
||||
set(_tmpdir "/tmp")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT DEFINED _working_dir)
|
||||
string(RANDOM subdir)
|
||||
set(_working_dir "${_tmpdir}/tmp.${subdir}")
|
||||
endif()
|
||||
if(NOT EXISTS "${_working_dir}")
|
||||
file(MAKE_DIRECTORY "${_working_dir}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_prepend_to_path)
|
||||
# Ensure the PATH is configured
|
||||
string(FIND "$ENV{PATH}" "${_working_dir}" _pathloc)
|
||||
if(NOT $_pathloc EQUAL 0)
|
||||
set(ENV{PATH} "${_working_dir}:$ENV{PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# First ensure the binary doesn't already exist
|
||||
find_program(_${RESULT_VARIABLE} "${_name}" HINTS "${_working_dir}")
|
||||
|
||||
set(_binary_path "${_working_dir}/${_name}")
|
||||
if(NOT _${RESULT_VARIABLE})
|
||||
message(STATUS "Downloading ${_name} from ${_url}...")
|
||||
file(DOWNLOAD
|
||||
"${_url}"
|
||||
"${_binary_path}"
|
||||
STATUS DOWNLOAD_STATUS)
|
||||
# Check if download was successful.
|
||||
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
|
||||
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
|
||||
if(NOT ${STATUS_CODE} EQUAL 0)
|
||||
file(REMOVE "${_binary_path}")
|
||||
message(FATAL_ERROR "Error downloading ${_url} ${ERROR_MESSAGE}")
|
||||
endif()
|
||||
|
||||
# Ensure the file is executable
|
||||
file(CHMOD "${_binary_path}" PERMISSIONS
|
||||
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_WRITE GROUP_READ)
|
||||
|
||||
# Ensure it's found
|
||||
find_program(_${RESULT_VARIABLE} "${_name}" HINTS "${_working_dir}" REQUIRED)
|
||||
endif()
|
||||
|
||||
# We need to create a subdirectory for this binary and symlink it's AppRun to where it's expected
|
||||
if(_${RESULT_VARIABLE}_IS_APPIMAGE AND NOT IS_SYMLINK "${_${RESULT_VARIABLE}}")
|
||||
if(NOT COMMAND create_symlink)
|
||||
include(CreateSymlink)
|
||||
endif()
|
||||
|
||||
message(STATUS "Extracting ${_${RESULT_VARIABLE}} to ${_working_dir}/.${_name}/")
|
||||
|
||||
# extract appimage
|
||||
execute_process(COMMAND "${_${RESULT_VARIABLE}}" --appimage-extract
|
||||
WORKING_DIRECTORY "${_working_dir}"
|
||||
COMMAND_ECHO ${_command_echo}
|
||||
${_output_quiet}
|
||||
${_error_quiet}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
# move extracted files to dedicated location (e.g. ".linuxdeploy-x86_64.AppImage/squashfs-root/")
|
||||
file(MAKE_DIRECTORY "${_working_dir}/.${_name}/")
|
||||
file(RENAME "${_working_dir}/squashfs-root/" "${_working_dir}/.${_name}/squashfs-root/")
|
||||
|
||||
# remove the unusable binary
|
||||
file(REMOVE "${_${RESULT_VARIABLE}}")
|
||||
|
||||
# symlink the expected binary name to the AppRun file
|
||||
message(STATUS "Creating a symbolic link ${_${RESULT_VARIABLE}} which points to ${_working_dir}/.${_name}/squashfs-root/AppRun")
|
||||
create_symlink("${_working_dir}/.${_name}/squashfs-root/AppRun" "${_${RESULT_VARIABLE}}")
|
||||
endif()
|
||||
|
||||
# Test the binary
|
||||
# - TODO: Add support for bad binaries that set "$?" to an error code for no good reason
|
||||
# - TODO: Add support for Windows binaries expecting "/?" instead of "--help"
|
||||
message(STATUS "Testing that ${_name} works on this system...")
|
||||
set(_test_param "--help")
|
||||
|
||||
execute_process(COMMAND "${_${RESULT_VARIABLE}}" ${_test_param}
|
||||
COMMAND_ECHO ${_command_echo}
|
||||
${_output_quiet}
|
||||
${_error_quiet}
|
||||
COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
message(STATUS "The binary \"${_${RESULT_VARIABLE}}\" is now available")
|
||||
set(${RESULT_VARIABLE} "${_${RESULT_VARIABLE}}")
|
||||
endmacro()
|
||||
@@ -1,76 +0,0 @@
|
||||
# Shim the SYSTEM property for older CMake versions - we rely on this property
|
||||
# to determine which set of error flags to use.
|
||||
if(CMAKE_VERSION VERSION_LESS "3.25")
|
||||
define_property(TARGET
|
||||
PROPERTY SYSTEM
|
||||
INHERITED
|
||||
BRIEF_DOCS "Shim of built-in SYSTEM property for CMake versions less than 3.25"
|
||||
FULL_DOCS "Non-functional, but allows the property to be inherited properly."
|
||||
"See the CMake documentation at https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html."
|
||||
)
|
||||
endif()
|
||||
|
||||
# Allow the user to control whether to treat warnings as errors
|
||||
option(USE_WERROR "Treat compiler warnings as errors" OFF)
|
||||
|
||||
# Compute the appropriate flags for the current compiler and options
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
set(COMPILE_ERROR_FLAGS
|
||||
"-Wall" # Enable most warnings by default
|
||||
)
|
||||
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
|
||||
"-w" # Disable all warnings
|
||||
)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
# The following warning generates false positives that are difficult
|
||||
# to work around, in particular when inlining calls to standard
|
||||
# algorithms performed on single-element arrays. See, for example,
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111273.
|
||||
"-Wno-array-bounds" # Permit out-of-bounds array subscripts
|
||||
)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11")
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
# This has the same problems described above for "array-bounds".
|
||||
"-Wno-stringop-overread" # Permit string functions overreading the source
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(USE_WERROR)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
"-Werror" # Treat warnings as errors
|
||||
)
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
set(COMPILE_ERROR_FLAGS
|
||||
"/W2" # Enable some warnings by default
|
||||
"/external:W0" # Don't emit warnings for third-party code
|
||||
"/external:anglebrackets" # Consider headers included with angle brackets to be third-party
|
||||
"/external:templates-" # Still emit warnings from first-party instantiations of third-party templates
|
||||
# Silence "class X needs to have DLL-interface to be used by clients of
|
||||
# class Y" warnings. These aren't trivial to address, and don't pose a
|
||||
# problem for us since we build all modules with the same compiler and
|
||||
# options, and dynamically link the CRT.
|
||||
"/wd4251"
|
||||
)
|
||||
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
|
||||
"/W0" # Disable all warnings
|
||||
)
|
||||
|
||||
if(USE_WERROR)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
"/WX" # Treat warnings as errors
|
||||
)
|
||||
endif()
|
||||
|
||||
# Silence deprecation warnings for the std::atomic_...<std::shared_ptr> family of functions.
|
||||
# TODO: Remove once C++20's std::atomic<std::shared_ptr> is fully supported.
|
||||
add_compile_definitions("_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING")
|
||||
endif()
|
||||
|
||||
# Add the flags to the whole directory tree. We use the third-party flags for
|
||||
# targets whose SYSTEM property is true, and the normal flags otherwise.
|
||||
add_compile_options("$<IF:$<BOOL:$<TARGET_PROPERTY:SYSTEM>>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>")
|
||||
@@ -1,47 +0,0 @@
|
||||
# FindFFTW.cmake - Try to find FFTW3
|
||||
# Copyright (c) 2018 Lukas W <lukaswhl/at/gmail.com>
|
||||
# This file is MIT licensed.
|
||||
# See http://opensource.org/licenses/MIT
|
||||
|
||||
# Try pkgconfig for hints
|
||||
find_package(PkgConfig QUIET)
|
||||
|
||||
if(NOT FFTW_FIND_COMPONENTS)
|
||||
set(FFTW_FIND_COMPONENTS fftw3f fftw3 fftwl)
|
||||
endif()
|
||||
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(FFTW_PKG QUIET fftw>=3.0.0)
|
||||
pkg_check_modules(FFTW3_PKG QUIET fftw3>=3.0.0)
|
||||
endif()
|
||||
|
||||
find_path(FFTW_INCLUDE_DIR
|
||||
NAMES fftw3.h
|
||||
PATHS ${FFTW_PKG_INCLUDE_DIRS} ${FFTW3_PKG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(check_list)
|
||||
|
||||
foreach(comp ${FFTW_FIND_COMPONENTS})
|
||||
string(TOUPPER ${comp} COMP)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(${COMP}_PKG QUIET ${comp}>=3.0.0)
|
||||
endif()
|
||||
|
||||
find_library(${COMP}_LIBRARY
|
||||
NAMES ${comp}
|
||||
PATHS ${comp}_PKG_LIBRARY_DIRS
|
||||
)
|
||||
list(APPEND check_list ${COMP}_LIBRARY)
|
||||
|
||||
set(${COMP}_LIBRARIES ${${COMP}_LIBRARY} CACHE FILEPATH "${COMP} library path")
|
||||
set(${COMP}_INCLUDE_DIRS ${FFTW_INCLUDE_DIR} CACHE PATH "${COMP} include path")
|
||||
mark_as_advanced(${COMP}_LIBRARIES ${COMP}_INCLUDE_DIRS)
|
||||
endforeach()
|
||||
|
||||
find_package(PackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW_INCLUDE_DIR ${check_list})
|
||||
|
||||
set(FFTW_INCLUDE_DIRS ${FFTW_INCLUDE_DIR})
|
||||
|
||||
mark_as_advanced(FFTW_LIBRARY FFTW_LIBRARIES FFTW_INCLUDE_DIR FFTW_INCLUDE_DIRS ${check_list})
|
||||
@@ -1,73 +0,0 @@
|
||||
# Copyright (c) 2022 Dominic Clark
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# Return if we already have FluidSynth
|
||||
if(TARGET fluidsynth)
|
||||
set(FluidSynth_FOUND 1)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Attempt to find FluidSynth using PkgConfig
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(FLUIDSYNTH_PKG fluidsynth)
|
||||
endif()
|
||||
|
||||
# Find the library and headers using the results from PkgConfig as a guide
|
||||
find_path(FluidSynth_INCLUDE_DIR
|
||||
NAMES "fluidsynth.h"
|
||||
HINTS ${FLUIDSYNTH_PKG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(FluidSynth_LIBRARY
|
||||
NAMES "fluidsynth" "fluidsynth-3" "fluidsynth-2" "fluidsynth-1"
|
||||
HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
if(FluidSynth_INCLUDE_DIR AND FluidSynth_LIBRARY)
|
||||
add_library(fluidsynth UNKNOWN IMPORTED)
|
||||
set_target_properties(fluidsynth PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
if(VCPKG_INSTALLED_DIR)
|
||||
include(ImportedTargetHelpers)
|
||||
get_vcpkg_library_configs(FluidSynth_IMPLIB_RELEASE FluidSynth_IMPLIB_DEBUG "${FluidSynth_LIBRARY}")
|
||||
else()
|
||||
set(FluidSynth_IMPLIB_RELEASE "${FluidSynth_LIBRARY}")
|
||||
endif()
|
||||
|
||||
if(FluidSynth_IMPLIB_DEBUG)
|
||||
set_target_properties(fluidsynth PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${FluidSynth_IMPLIB_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG "${FluidSynth_IMPLIB_DEBUG}"
|
||||
)
|
||||
else()
|
||||
set_target_properties(fluidsynth PROPERTIES
|
||||
IMPORTED_LOCATION "${FluidSynth_IMPLIB_RELEASE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h")
|
||||
file(STRINGS
|
||||
"${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h"
|
||||
_version_string
|
||||
REGEX "^#[\t ]*define[\t ]+FLUIDSYNTH_VERSION[\t ]+\".*\""
|
||||
)
|
||||
string(REGEX REPLACE
|
||||
"^.*FLUIDSYNTH_VERSION[\t ]+\"([^\"]*)\".*$"
|
||||
"\\1"
|
||||
FluidSynth_VERSION_STRING
|
||||
"${_version_string}"
|
||||
)
|
||||
unset(_version_string)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(FluidSynth
|
||||
REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_DIR
|
||||
VERSION_VAR FluidSynth_VERSION_STRING
|
||||
)
|
||||
@@ -1,31 +1,16 @@
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
# - Try to find LAME
|
||||
# Once done this will define
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
# LAME_FOUND - system has liblame
|
||||
# LAME_INCLUDE_DIRS - the liblame include directory
|
||||
# LAME_LIBRARIES - The liblame libraries
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(mp3lame mp3lame::mp3lame
|
||||
LIBRARY_NAMES "mp3lame"
|
||||
INCLUDE_NAMES "lame/lame.h"
|
||||
PREFIX Lame
|
||||
)
|
||||
|
||||
determine_version_from_source(Lame_VERSION mp3lame::mp3lame [[
|
||||
#include <iostream>
|
||||
#include <lame/lame.h>
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
auto version = lame_version_t{};
|
||||
get_lame_version_numerical(&version);
|
||||
std::cout << version.major << "." << version.minor;
|
||||
}
|
||||
]])
|
||||
find_path(LAME_INCLUDE_DIRS lame/lame.h)
|
||||
find_library(LAME_LIBRARIES mp3lame)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Lame DEFAULT_MSG LAME_INCLUDE_DIRS LAME_LIBRARIES)
|
||||
|
||||
find_package_handle_standard_args(Lame
|
||||
REQUIRED_VARS Lame_LIBRARY Lame_INCLUDE_DIRS
|
||||
VERSION_VAR Lame_VERSION
|
||||
)
|
||||
list(APPEND LAME_DEFINITIONS -DHAVE_LIBMP3LAME=1)
|
||||
|
||||
mark_as_advanced(LAME_INCLUDE_DIRS LAME_LIBRARIES LAME_DEFINITIONS)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# Copyright (c) 2025 Dalton Messmer <messmer.dalton/at/gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(Lilv Lilv::lilv
|
||||
LIBRARY_NAMES "lilv" "lilv-0"
|
||||
INCLUDE_NAMES "lilv/lilv.h"
|
||||
PKG_CONFIG "lilv-0"
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Lilv
|
||||
REQUIRED_VARS Lilv_LIBRARY Lilv_INCLUDE_DIRS
|
||||
VERSION_VAR Lilv_VERSION
|
||||
)
|
||||
@@ -1,68 +1,86 @@
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
# - Try to find the OggVorbis libraries
|
||||
# Once done this will define
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# OGGVORBIS_FOUND - system has OggVorbis
|
||||
# OGGVORBIS_VERSION - set either to 1 or 2
|
||||
# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
|
||||
# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
|
||||
# OGG_LIBRARY - The Ogg library
|
||||
# VORBIS_LIBRARY - The Vorbis library
|
||||
# VORBISFILE_LIBRARY - The VorbisFile library
|
||||
# VORBISENC_LIBRARY - The VorbisEnc library
|
||||
|
||||
# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(Ogg Ogg::ogg
|
||||
LIBRARY_NAMES "ogg"
|
||||
INCLUDE_NAMES "ogg/ogg.h"
|
||||
PKG_CONFIG ogg
|
||||
)
|
||||
include (CheckLibraryExists)
|
||||
|
||||
find_package_config_mode_with_fallback(Vorbis Vorbis::vorbis
|
||||
LIBRARY_NAMES "vorbis"
|
||||
INCLUDE_NAMES "vorbis/codec.h"
|
||||
PKG_CONFIG vorbis
|
||||
DEPENDS Ogg::ogg
|
||||
)
|
||||
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
|
||||
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
|
||||
|
||||
find_package_config_mode_with_fallback(Vorbis Vorbis::vorbisfile
|
||||
LIBRARY_NAMES "vorbisfile"
|
||||
INCLUDE_NAMES "vorbis/vorbisfile.h"
|
||||
PKG_CONFIG vorbisfile
|
||||
DEPENDS Vorbis::vorbis
|
||||
PREFIX VorbisFile
|
||||
)
|
||||
find_library(OGG_LIBRARY NAMES ogg)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis)
|
||||
find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
|
||||
find_library(VORBISENC_LIBRARY NAMES vorbisenc)
|
||||
|
||||
find_package_config_mode_with_fallback(Vorbis Vorbis::vorbisenc
|
||||
LIBRARY_NAMES "vorbisenc"
|
||||
INCLUDE_NAMES "vorbis/vorbisenc.h"
|
||||
PKG_CONFIG vorbisenc
|
||||
DEPENDS Vorbis::vorbis
|
||||
PREFIX VorbisEnc
|
||||
)
|
||||
|
||||
determine_version_from_source(Vorbis_VERSION Vorbis::vorbis [[
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <vorbis/codec.h>
|
||||
if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
set(OGGVORBIS_FOUND TRUE)
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
// Version string has the format "org name version"
|
||||
const auto version = std::string_view{vorbis_version_string()};
|
||||
const auto nameBegin = version.find(' ') + 1;
|
||||
const auto versionBegin = version.find(' ', nameBegin) + 1;
|
||||
std::cout << version.substr(versionBegin);
|
||||
}
|
||||
]])
|
||||
set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
|
||||
check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
|
||||
|
||||
if (HAVE_LIBVORBISENC2)
|
||||
set (OGGVORBIS_VERSION 2)
|
||||
else (HAVE_LIBVORBISENC2)
|
||||
set (OGGVORBIS_VERSION 1)
|
||||
endif (HAVE_LIBVORBISENC2)
|
||||
|
||||
else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
set (OGGVORBIS_VERSION)
|
||||
set(OGGVORBIS_FOUND FALSE)
|
||||
endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
|
||||
|
||||
if (OGGVORBIS_FOUND)
|
||||
if (NOT OggVorbis_FIND_QUIETLY)
|
||||
message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
|
||||
endif (NOT OggVorbis_FIND_QUIETLY)
|
||||
else (OGGVORBIS_FOUND)
|
||||
if (OggVorbis_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find OggVorbis libraries")
|
||||
endif (OggVorbis_FIND_REQUIRED)
|
||||
if (NOT OggVorbis_FIND_QUITELY)
|
||||
message(STATUS "Could NOT find OggVorbis libraries")
|
||||
endif (NOT OggVorbis_FIND_QUITELY)
|
||||
endif (OGGVORBIS_FOUND)
|
||||
|
||||
#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
|
||||
#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
|
||||
#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
|
||||
#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
|
||||
#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
|
||||
#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
|
||||
|
||||
#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
# message(STATUS "Ogg/Vorbis found")
|
||||
# set (VORBIS_LIBS "-lvorbis -logg")
|
||||
# set (VORBISFILE_LIBS "-lvorbisfile")
|
||||
# set (VORBISENC_LIBS "-lvorbisenc")
|
||||
# set (OGGVORBIS_FOUND TRUE)
|
||||
# if (HAVE_LIBVORBISENC2)
|
||||
# set (HAVE_VORBIS 2)
|
||||
# else (HAVE_LIBVORBISENC2)
|
||||
# set (HAVE_VORBIS 1)
|
||||
# endif (HAVE_LIBVORBISENC2)
|
||||
#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
# message(STATUS "Ogg/Vorbis not found")
|
||||
#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
|
||||
|
||||
find_package_handle_standard_args(OggVorbis
|
||||
REQUIRED_VARS
|
||||
Ogg_LIBRARY
|
||||
Ogg_INCLUDE_DIRS
|
||||
Vorbis_LIBRARY
|
||||
Vorbis_INCLUDE_DIRS
|
||||
VorbisFile_LIBRARY
|
||||
VorbisFile_INCLUDE_DIRS
|
||||
VorbisEnc_LIBRARY
|
||||
VorbisEnc_INCLUDE_DIRS
|
||||
# This only reports the Vorbis version - Ogg can have a different version,
|
||||
# so if we ever care about that, it should be split off into a different
|
||||
# find module.
|
||||
VERSION_VAR Vorbis_VERSION
|
||||
)
|
||||
|
||||
@@ -1,34 +1,36 @@
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
# - Try to find Portaudio
|
||||
# Once done this will define
|
||||
#
|
||||
# PORTAUDIO_FOUND - system has Portaudio
|
||||
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
|
||||
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
|
||||
# PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(portaudio portaudio
|
||||
LIBRARY_NAMES "portaudio"
|
||||
INCLUDE_NAMES "portaudio.h"
|
||||
PKG_CONFIG portaudio-2.0
|
||||
PREFIX Portaudio
|
||||
)
|
||||
if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(PORTAUDIO_FOUND TRUE)
|
||||
else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(PORTAUDIO portaudio-2.0)
|
||||
if (PORTAUDIO_FOUND)
|
||||
if (NOT Portaudio_FIND_QUIETLY)
|
||||
message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}")
|
||||
endif (NOT Portaudio_FIND_QUIETLY)
|
||||
else (PORTAUDIO_FOUND)
|
||||
if (Portaudio_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find Portaudio")
|
||||
endif (Portaudio_FIND_REQUIRED)
|
||||
endif (PORTAUDIO_FOUND)
|
||||
|
||||
determine_version_from_source(Portaudio_VERSION portaudio [[
|
||||
#include <iostream>
|
||||
#include "portaudio.h"
|
||||
# show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
// Version number has the format 0xMMmmpp
|
||||
const auto version = Pa_GetVersion();
|
||||
std::cout << ((version >> 16) & 0xff)
|
||||
<< "." << ((version >> 8) & 0xff)
|
||||
<< "." << ((version >> 0) & 0xff);
|
||||
}
|
||||
]])
|
||||
endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Portaudio
|
||||
REQUIRED_VARS Portaudio_LIBRARY Portaudio_INCLUDE_DIRS
|
||||
VERSION_VAR Portaudio_VERSION
|
||||
)
|
||||
|
||||
@@ -18,15 +18,13 @@ ENDIF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
|
||||
IF (NOT WIN32)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PA libpulse)
|
||||
set(_PASIncDir ${PA_INCLUDE_DIRS})
|
||||
set(_PASLinkDir ${PA_LIBRARY_DIRS})
|
||||
set(_PASLinkFlags ${PA_LDFLAGS})
|
||||
set(_PASCflags ${PA_CFLAGS})
|
||||
set(PULSEAUDIO_DEFINITIONS ${_PASCflags})
|
||||
endif()
|
||||
INCLUDE(FindPkgConfig)
|
||||
pkg_check_modules(PA libpulse)
|
||||
set(_PASIncDir ${PA_INCLUDE_DIRS})
|
||||
set(_PASLinkDir ${PA_LIBRARY_DIRS})
|
||||
set(_PASLinkFlags ${PA_LDFLAGS})
|
||||
set(_PASCflags ${PA_CFLAGS})
|
||||
SET(PULSEAUDIO_DEFINITIONS ${_PASCflags})
|
||||
ENDIF (NOT WIN32)
|
||||
|
||||
FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
# This module defines
|
||||
# SDL2::SDL2, a target providing SDL2 itself
|
||||
# SDL2_LIBRARY, the name of the library to link against
|
||||
# SDL2_FOUND, if false, do not try to link to SDL2
|
||||
# SDL2_INCLUDE_DIR, where to find SDL.h
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# SDL2_LIBRARY to override this selection or set the CMake environment
|
||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDL2DIR
|
||||
# used in building SDL2.
|
||||
#
|
||||
# Modified by Eric Wing, l.e.galup, and Dominic Clark
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright 2003-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file COPYING-CMAKE-SCRIPTS for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Try config mode first - anything SDL2 itself provides is likely to be more
|
||||
# reliable than our guesses.
|
||||
find_package(SDL2 CONFIG QUIET)
|
||||
|
||||
if(TARGET SDL2::SDL2)
|
||||
# SDL2::SDL2 under MinGW is an interface target for reasons, so we can't get
|
||||
# the library location from it. Print minimal information and return early.
|
||||
get_target_property(sdl2_target_type SDL2::SDL2 TYPE)
|
||||
if(sdl2_target_type STREQUAL "INTERFACE_LIBRARY")
|
||||
unset(sdl2_target_type)
|
||||
if(NOT SDL2_FIND_QUIETLY)
|
||||
message(STATUS "Found SDL2 (found version \"${SDL2_VERSION}\")")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
unset(sdl2_target_type)
|
||||
|
||||
# Extract details for find_package_handle_standard_args
|
||||
get_target_property(SDL2_LIBRARY SDL2::SDL2 LOCATION)
|
||||
get_target_property(SDL2_INCLUDE_DIR SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)
|
||||
else()
|
||||
set(SDL2_SEARCH_PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
${SDL2_PATH}
|
||||
)
|
||||
|
||||
find_path(SDL2_INCLUDE_DIR
|
||||
NAMES SDL.h
|
||||
HINTS $ENV{SDL2DIR} ${SDL2_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES SDL2 include/SDL2 include
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(PATH_SUFFIXES lib64 lib/x64 lib)
|
||||
else()
|
||||
set(PATH_SUFFIXES lib/x86 lib)
|
||||
endif()
|
||||
|
||||
find_library(SDL2_LIBRARY
|
||||
NAMES SDL2
|
||||
HINTS $ENV{SDL2DIR} ${SDL2_LIBDIR}
|
||||
PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
|
||||
# SDL2 may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
if(NOT APPLE)
|
||||
find_package(Threads)
|
||||
endif()
|
||||
|
||||
if(SDL2_LIBRARY AND SDL2_INCLUDE_DIR)
|
||||
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
|
||||
set_target_properties(SDL2::SDL2 PROPERTIES
|
||||
IMPORTED_LOCATION "${SDL2_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
|
||||
)
|
||||
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
if(APPLE)
|
||||
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
|
||||
INTERFACE_LINK_OPTIONS "-framework Cocoa"
|
||||
)
|
||||
endif()
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
if(NOT APPLE AND Threads_FOUND)
|
||||
set_property(TARGET SDL2::SDL2 APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES "Threads::Threads"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h")
|
||||
file(READ "${SDL2_INCLUDE_DIR}/SDL_version.h" _sdl_version_h)
|
||||
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MAJOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MAJOR "${_sdl_version_h}")
|
||||
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MINOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MINOR "${_sdl_version_h}")
|
||||
string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_PATCH "${_sdl_version_h}")
|
||||
set(SDL2_VERSION "${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}")
|
||||
unset(_sdl_version_h)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SDL2
|
||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
||||
VERSION_VAR SDL2_VERSION
|
||||
)
|
||||
@@ -1,27 +1,20 @@
|
||||
include(ImportedTargetHelpers)
|
||||
FIND_PATH(STK_INCLUDE_DIR Stk.h /usr/include/stk /usr/local/include/stk ${CMAKE_INSTALL_PREFIX}/include/stk ${CMAKE_FIND_ROOT_PATH}/include/stk)
|
||||
|
||||
# TODO CMake 3.18: Alias this target to something less hideous
|
||||
find_package_config_mode_with_fallback(unofficial-libstk unofficial::libstk::libstk
|
||||
LIBRARY_NAMES "stk"
|
||||
INCLUDE_NAMES "stk/Stk.h"
|
||||
LIBRARY_HINTS "/usr/lib" "/usr/local/lib" "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_FIND_ROOT_PATH}/lib"
|
||||
INCLUDE_HINTS "/usr/include" "/usr/local/include" "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_FIND_ROOT_PATH}/include"
|
||||
PREFIX STK
|
||||
)
|
||||
FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_FIND_ROOT_PATH}/lib)
|
||||
|
||||
# Find STK rawwave path
|
||||
if(STK_INCLUDE_DIRS)
|
||||
list(GET STK_INCLUDE_DIRS 0 STK_INCLUDE_DIR)
|
||||
find_path(STK_RAWWAVE_ROOT
|
||||
NAMES silence.raw sinewave.raw
|
||||
HINTS "${STK_INCLUDE_DIR}/.." "${STK_INCLUDE_DIR}/../.."
|
||||
PATH_SUFFIXES share/stk/rawwaves share/libstk/rawwaves
|
||||
)
|
||||
endif()
|
||||
IF (STK_INCLUDE_DIR AND STK_LIBRARY)
|
||||
SET(STK_FOUND TRUE)
|
||||
ENDIF (STK_INCLUDE_DIR AND STK_LIBRARY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(STK
|
||||
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR STK_RAWWAVE_ROOT
|
||||
# STK doesn't appear to expose its version, so we can't pass it here
|
||||
)
|
||||
IF (STK_FOUND)
|
||||
IF (NOT STK_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found STK: ${STK_LIBRARY}")
|
||||
SET(HAVE_STK TRUE)
|
||||
ENDIF (NOT STK_FIND_QUIETLY)
|
||||
ELSE (STK_FOUND)
|
||||
IF (STK_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find STK")
|
||||
ENDIF (STK_FIND_REQUIRED)
|
||||
ENDIF (STK_FOUND)
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(SampleRate SampleRate::samplerate
|
||||
LIBRARY_NAMES "samplerate" "libsamplerate" "libsamplerate-0"
|
||||
INCLUDE_NAMES "samplerate.h"
|
||||
PKG_CONFIG samplerate
|
||||
PREFIX Samplerate
|
||||
)
|
||||
|
||||
determine_version_from_source(Samplerate_VERSION SampleRate::samplerate [[
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <samplerate.h>
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
// Version string has the format "name-version copyright"
|
||||
const auto version = std::string_view{src_get_version()};
|
||||
const auto begin = version.find('-') + 1;
|
||||
const auto end = version.find(' ', begin);
|
||||
std::cout << version.substr(begin, end - begin);
|
||||
}
|
||||
]])
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Samplerate
|
||||
REQUIRED_VARS Samplerate_LIBRARY Samplerate_INCLUDE_DIRS
|
||||
VERSION_VAR Samplerate_VERSION
|
||||
)
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_package_config_mode_with_fallback(SndFile SndFile::sndfile
|
||||
LIBRARY_NAMES "sndfile" "libsndfile" "libsndfile-1"
|
||||
INCLUDE_NAMES "sndfile.h"
|
||||
PKG_CONFIG sndfile
|
||||
)
|
||||
|
||||
determine_version_from_source(SndFile_VERSION SndFile::sndfile [[
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <sndfile.h>
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
// Version string has the format "name-version", optionally followed by "-exp"
|
||||
const auto version = std::string_view{sf_version_string()};
|
||||
const auto begin = version.find('-') + 1;
|
||||
const auto end = version.find('-', begin);
|
||||
std::cout << version.substr(begin, end - begin);
|
||||
}
|
||||
]])
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(SndFile
|
||||
REQUIRED_VARS SndFile_LIBRARY SndFile_INCLUDE_DIRS
|
||||
VERSION_VAR SndFile_VERSION
|
||||
)
|
||||
@@ -24,11 +24,11 @@ check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SIO_OPEN)
|
||||
find_path(SNDIO_INCLUDE_DIR sndio.h)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sndio DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
|
||||
find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
|
||||
|
||||
if(SNDIO_FOUND)
|
||||
set(SNDIO_INCLUDE_DIRS "${SNDIO_INCLUDE_DIR}")
|
||||
set(SNDIO_LIBRARIES "${SNDIO_LIBRARY}")
|
||||
endif()
|
||||
endif(HAVE_SNDIO)
|
||||
|
||||
mark_as_advanced(SNDIO_INCLUDE_DIR SNDIO_LIBRARY SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user