Merge branch 'master' into refac/memory
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
clone_depth: 1
|
||||
version: "{build}"
|
||||
image: Visual Studio 2017
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
environment:
|
||||
matrix:
|
||||
- compiler: msvc
|
||||
install:
|
||||
- cd C:\Tools\vcpkg
|
||||
- git pull
|
||||
- .\bootstrap-vcpkg.bat
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- vcpkg install --triplet %PLATFORM%-windows --recurse fftw3 libsamplerate libsndfile lilv lv2 sdl2
|
||||
- nuget install clcache -Version 4.1.0
|
||||
build_script:
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- mkdir build
|
||||
- cd build
|
||||
- ps: $env:CMAKE_PLATFORM="$(if ($env:PLATFORM -eq 'x64') { 'x64' } else { '' })"
|
||||
- ps: $env:QT_SUFFIX="$(if ($env:PLATFORM -eq 'x64') { '_64' } else { '' })"
|
||||
- cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.12/msvc2017%QT_SUFFIX%;c:/tools/vcpkg/installed/%PLATFORM%-windows -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" ..
|
||||
- cmake --build . -- /maxcpucount:4
|
||||
- cmake --build . --target tests
|
||||
- cmake --build . --target package
|
||||
artifacts:
|
||||
- path: 'build\lmms-*.exe'
|
||||
name: Installer
|
||||
cache:
|
||||
- c:/tools/vcpkg/installed
|
||||
@@ -1,222 +0,0 @@
|
||||
version: 2
|
||||
|
||||
shared:
|
||||
restore_cache: &restore_cache
|
||||
restore_cache:
|
||||
keys:
|
||||
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
|
||||
- ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
|
||||
- ccache-{{ arch }}
|
||||
save_cache: &save_cache
|
||||
save_cache:
|
||||
key: ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
|
||||
paths:
|
||||
- ~/.ccache
|
||||
restore_homebrew_cache: &restore_homebrew_cache
|
||||
restore_cache:
|
||||
keys:
|
||||
- homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
|
||||
- homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
|
||||
- homebrew-{{ arch }}
|
||||
save_homebrew_cache: &save_homebrew_cache
|
||||
save_cache:
|
||||
key: homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }}
|
||||
paths:
|
||||
- ~/Library/Caches/Homebrew
|
||||
- /usr/local/Homebrew
|
||||
|
||||
ccache_stats: &ccache_stats
|
||||
run:
|
||||
name: Print ccache statistics
|
||||
command: |
|
||||
echo "[ccache config]"
|
||||
ccache -p
|
||||
echo "[ccache stats]"
|
||||
ccache -s
|
||||
|
||||
# Commmon initializing commands
|
||||
init: &init
|
||||
run:
|
||||
name: Initialize
|
||||
command: |
|
||||
mkdir -p /tmp/artifacts
|
||||
# Workaround for failing submodule fetching
|
||||
git config --global --unset url."ssh://git@github.com".insteadOf || true
|
||||
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
|
||||
then
|
||||
echo "Fetching out merged pull request"
|
||||
git fetch -u origin refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/merge
|
||||
git checkout pr/merge
|
||||
else
|
||||
echo "Not a pull request"
|
||||
fi
|
||||
|
||||
# Commmon environment variables
|
||||
common_environment: &common_environment
|
||||
QT5: True
|
||||
CMAKE_OPTS: -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON
|
||||
CCACHE_MAXSIZE: 500M
|
||||
CCACHE_LOGFILE: /tmp/artifacts/ccache.log
|
||||
MAKEFLAGS: -j6
|
||||
|
||||
jobs:
|
||||
mingw32:
|
||||
environment:
|
||||
<<: *common_environment
|
||||
docker:
|
||||
- image: lmmsci/linux.mingw32:18.04
|
||||
steps:
|
||||
- checkout
|
||||
- *init
|
||||
- *restore_cache
|
||||
- run:
|
||||
name: Building
|
||||
command: |
|
||||
mkdir build && cd build
|
||||
../cmake/build_win32.sh
|
||||
make lmms
|
||||
make
|
||||
- run:
|
||||
name: Build tests
|
||||
command: cd build && make tests
|
||||
- run:
|
||||
name: Build installer
|
||||
command: |
|
||||
cd build
|
||||
make package
|
||||
cp ./lmms-*.exe /tmp/artifacts/
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts/
|
||||
destination: /
|
||||
- *ccache_stats
|
||||
- *save_cache
|
||||
mingw64:
|
||||
environment:
|
||||
<<: *common_environment
|
||||
docker:
|
||||
- image: lmmsci/linux.mingw64:18.04
|
||||
steps:
|
||||
- checkout
|
||||
- *init
|
||||
- *restore_cache
|
||||
- run:
|
||||
name: Building
|
||||
command: |
|
||||
mkdir build && cd build
|
||||
../cmake/build_win64.sh
|
||||
make
|
||||
- run:
|
||||
name: Build tests
|
||||
command: cd build && make tests
|
||||
- run:
|
||||
name: Build installer
|
||||
command: |
|
||||
cd build
|
||||
make package
|
||||
cp ./lmms-*.exe /tmp/artifacts/
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts/
|
||||
destination: /
|
||||
- *ccache_stats
|
||||
- *save_cache
|
||||
linux.gcc:
|
||||
docker:
|
||||
- image: lmmsci/linux.gcc:16.04
|
||||
environment:
|
||||
<<: *common_environment
|
||||
steps:
|
||||
- checkout
|
||||
- *init
|
||||
- *restore_cache
|
||||
- run:
|
||||
name: Configure
|
||||
command: |
|
||||
source /opt/qt5*/bin/qt5*-env.sh || true
|
||||
mkdir build && cd build
|
||||
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
|
||||
- run:
|
||||
name: Build
|
||||
command: cd build && make
|
||||
- run:
|
||||
name: Build tests
|
||||
command: cd build && make tests
|
||||
- run:
|
||||
name: Run tests
|
||||
command: build/tests/tests
|
||||
- *ccache_stats
|
||||
- run:
|
||||
name: Build AppImage
|
||||
command: |
|
||||
cd build
|
||||
make install
|
||||
make appimage || (cat appimage.log && false)
|
||||
cp ./lmms-*.AppImage /tmp/artifacts/
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts/
|
||||
destination: /
|
||||
- store_artifacts:
|
||||
path: build/appimage.log
|
||||
destination: /
|
||||
- *save_cache
|
||||
shellcheck:
|
||||
docker:
|
||||
- image: koalaman/shellcheck-alpine:v0.4.6
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Shellcheck
|
||||
command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in")
|
||||
macos:
|
||||
environment:
|
||||
<<: *common_environment
|
||||
macos:
|
||||
xcode: "10.3.0"
|
||||
steps:
|
||||
- checkout
|
||||
- *init
|
||||
- *restore_homebrew_cache
|
||||
- *restore_cache
|
||||
- run:
|
||||
name: Install Homebrew dependencies
|
||||
command: |
|
||||
# uninstall Homebrew's python 2 to prevent errors on brew install
|
||||
brew uninstall python@2 || true
|
||||
brew update && brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio lilv lv2 stk fluid-synth portaudio fltk qt5 carla
|
||||
- run:
|
||||
name: Install nodejs dependencies
|
||||
command: npm install -g appdmg
|
||||
- run:
|
||||
name: Building
|
||||
command: |
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX="../target" -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" $CMAKE_OPTS -DUSE_WERROR=OFF
|
||||
make
|
||||
- run:
|
||||
name: Build tests
|
||||
command: cd build && make tests
|
||||
- run:
|
||||
name: Run tests
|
||||
command: build/tests/tests
|
||||
- run:
|
||||
name: Build DMG
|
||||
command: |
|
||||
cd build
|
||||
make install
|
||||
make dmg
|
||||
cp ./lmms-*.dmg /tmp/artifacts/
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts/
|
||||
destination: /
|
||||
- *save_cache
|
||||
- *save_homebrew_cache
|
||||
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build-and-test:
|
||||
jobs:
|
||||
- macos
|
||||
- mingw32
|
||||
- mingw64
|
||||
- linux.gcc
|
||||
- shellcheck
|
||||
84
.clang-format
Normal file
84
.clang-format
Normal file
@@ -0,0 +1,84 @@
|
||||
---
|
||||
# Language
|
||||
Language: Cpp
|
||||
Standard: Cpp11 # Cpp14 and Cpp17 are not supported by clang 11
|
||||
|
||||
# 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
|
||||
|
||||
...
|
||||
|
||||
51
.clang-tidy
Normal file
51
.clang-tidy
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
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
|
||||
AnalyzeTemporaryDtors: false
|
||||
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
|
||||
...
|
||||
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1,5 @@
|
||||
.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
|
||||
|
||||
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +1,2 @@
|
||||
---
|
||||
custom: https://lmms.io/get-involved/#donate
|
||||
|
||||
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
36
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,36 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Please search the issue tracker for existing bug reports before submitting your own. Delete this line to confirm no similar report has been posted yet.
|
||||
|
||||
### Bug Summary
|
||||
|
||||
#### Steps to reproduce
|
||||
|
||||
#### Expected behavior
|
||||
|
||||
#### Actual behavior
|
||||
|
||||
#### Screenshot
|
||||
|
||||
#### Affected LMMS versions
|
||||
|
||||
<!--
|
||||
LMMS's version is visible on the splash screen and under Help > About.
|
||||
If your version isn't from lmms.io/download, please note which branch it was built from.
|
||||
Finally, if possible, please test if the bug occurs on both stable and master.
|
||||
-->
|
||||
|
||||
#### Logs
|
||||
<details>
|
||||
<summary>Click to expand</summary>
|
||||
<pre>
|
||||
<!-- paste logs here -->
|
||||
</pre>
|
||||
</details>
|
||||
91
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
91
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
# 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
|
||||
7
.github/ISSUE_TEMPLATE/config.yml
vendored
7
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,4 +1,5 @@
|
||||
---
|
||||
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!
|
||||
- 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!
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/feature_request.md
vendored
18
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Please search the issue tracker for existing feature requests before submitting your own. Delete this line to confirm no similar request has been posted yet.
|
||||
|
||||
### Enhancement Summary
|
||||
|
||||
#### Justification
|
||||
|
||||
#### Mockup
|
||||
|
||||
<!-- If your request encompasses changes to the user interface, provide a mockup of your proposal here -->
|
||||
32
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
32
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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,2 +1,3 @@
|
||||
---
|
||||
# Label requiring a response
|
||||
responseRequiredLabel: "response required"
|
||||
|
||||
331
.github/workflows/build.yml
vendored
Normal file
331
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
---
|
||||
name: build
|
||||
'on': [push, pull_request]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
linux:
|
||||
name: linux
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/lmms/linux.gcc:20.04
|
||||
env:
|
||||
CMAKE_OPTS: >-
|
||||
-DUSE_WERROR=ON
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DUSE_COMPILE_CACHE=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: 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
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
source /opt/qt5*/bin/qt5*-env.sh || true
|
||||
cmake -S . \
|
||||
-B build \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
$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 install
|
||||
cmake --build build --target appimage
|
||||
- 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
|
||||
macos:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: [ x86_64, arm64 ]
|
||||
include:
|
||||
- arch: x86_64
|
||||
os: macos-12
|
||||
xcode: "13.1"
|
||||
- arch: arm64
|
||||
os: macos-14
|
||||
xcode: "14.3.1"
|
||||
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
|
||||
mkdir build
|
||||
cmake -S . \
|
||||
-B build \
|
||||
-DCMAKE_INSTALL_PREFIX="../target" \
|
||||
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)" \
|
||||
-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 install
|
||||
cmake --build build --target dmg
|
||||
- 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:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: ['32', '64']
|
||||
name: mingw${{ matrix.arch }}
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/lmms/linux.mingw:20.04
|
||||
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: Enable POSIX MinGW
|
||||
run: |
|
||||
update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
|
||||
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
|
||||
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
|
||||
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
||||
- 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 }}-${{ matrix.arch }}-${{ github.ref }}\
|
||||
-${{ github.run_id }}"
|
||||
restore-keys: |
|
||||
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
|
||||
ccache-${{ github.job }}-${{ matrix.arch }}-
|
||||
path: ~/.ccache
|
||||
- name: Configure
|
||||
run: |
|
||||
ccache --zero-stats
|
||||
cmake -S . \
|
||||
-B build \
|
||||
-DCMAKE_INSTALL_PREFIX=./install \
|
||||
-DCMAKE_TOOLCHAIN_FILE="./cmake/toolchains/MinGW-W64-${{ matrix.arch }}.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: mingw${{ matrix.arch }}
|
||||
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:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch: ['x86', 'x64']
|
||||
name: msvc-${{ matrix.arch }}
|
||||
runs-on: windows-2019
|
||||
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-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }}
|
||||
restore-keys: |
|
||||
vcpkg-${{ matrix.arch }}-
|
||||
path: build\vcpkg_installed
|
||||
- name: Cache ccache data
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
# yamllint disable rule:line-length
|
||||
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: ~\AppData\Local\ccache
|
||||
# yamllint enable rule:line-length
|
||||
- name: Install tools
|
||||
run: choco install ccache
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@b3ea5275e37b734d027040e2c7fe7a10ea2ef946
|
||||
with:
|
||||
version: '5.15.2'
|
||||
arch: |-
|
||||
${{
|
||||
fromJSON('
|
||||
{
|
||||
"x86": "win32_msvc2019",
|
||||
"x64": "win64_msvc2019_64"
|
||||
}
|
||||
')[matrix.arch]
|
||||
}}
|
||||
archives: qtbase qtsvg qttools
|
||||
cache: true
|
||||
- name: Set up build environment
|
||||
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
- 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 `
|
||||
-DUSE_COMPILE_CACHE=ON `
|
||||
-DUSE_WERROR=ON `
|
||||
-DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows" `
|
||||
-DVCPKG_HOST_TRIPLET="${{ matrix.arch }}-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-${{ matrix.arch }}
|
||||
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
|
||||
40
.github/workflows/checks.yml
vendored
Normal file
40
.github/workflows/checks.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
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
|
||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -1,11 +1,12 @@
|
||||
/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
|
||||
|
||||
27
.gitmodules
vendored
27
.gitmodules
vendored
@@ -1,15 +1,12 @@
|
||||
[submodule "src/3rdparty/qt5-x11embed"]
|
||||
path = src/3rdparty/qt5-x11embed
|
||||
url = https://github.com/Lukas-W/qt5-x11embed.git
|
||||
[submodule "src/3rdparty/rpmalloc/rpmalloc"]
|
||||
path = src/3rdparty/rpmalloc/rpmalloc
|
||||
url = https://github.com/mjansson/rpmalloc.git
|
||||
[submodule "plugins/zynaddsubfx/zynaddsubfx"]
|
||||
path = plugins/zynaddsubfx/zynaddsubfx
|
||||
[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://bitbucket.org/mpyne/game-music-emu.git
|
||||
url = https://github.com/libgme/game-music-emu.git
|
||||
[submodule "plugins/OpulenZ/adplug"]
|
||||
path = plugins/OpulenZ/adplug
|
||||
url = https://github.com/adplug/adplug.git
|
||||
@@ -24,13 +21,10 @@
|
||||
url = https://github.com/swh/ladspa
|
||||
[submodule "plugins/LadspaEffect/tap/tap-plugins"]
|
||||
path = plugins/LadspaEffect/tap/tap-plugins
|
||||
url = https://github.com/tomszilagyi/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 "src/3rdparty/mingw-std-threads"]
|
||||
path = src/3rdparty/mingw-std-threads
|
||||
url = https://github.com/meganz/mingw-std-threads.git
|
||||
[submodule "src/3rdparty/libcds"]
|
||||
path = src/3rdparty/libcds
|
||||
url = https://github.com/khizmax/libcds.git
|
||||
@@ -40,15 +34,18 @@
|
||||
[submodule "src/3rdparty/ringbuffer"]
|
||||
path = src/3rdparty/ringbuffer
|
||||
url = https://github.com/JohannesLorenz/ringbuffer.git
|
||||
[submodule "plugins/carlabase/carla"]
|
||||
path = plugins/carlabase/carla
|
||||
[submodule "plugins/CarlaBase/carla"]
|
||||
path = plugins/CarlaBase/carla
|
||||
url = https://github.com/falktx/carla
|
||||
[submodule "plugins/sid/resid"]
|
||||
path = plugins/Sid/resid
|
||||
url = https://github.com/simonowen/resid
|
||||
[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
|
||||
|
||||
2
.mailmap
2
.mailmap
@@ -1,4 +1,4 @@
|
||||
Alexandre Almeida <wilsalx@gmail.com> <meta.lx@hotmail.com>
|
||||
Alexandre Almeida <wilsalx@gmail.com>
|
||||
Tobias Junghans <tobias.doerffel@gmail.com>
|
||||
Dave French <dave.french3@googlemail.com>
|
||||
Paul Giblock <drfaygo@gmail.com> <pgib@users.sf.net>
|
||||
|
||||
33
.travis.yml
33
.travis.yml
@@ -1,33 +0,0 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: xenial
|
||||
sudo: required
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/apt_mingw_cache
|
||||
- $HOME/.ccache
|
||||
- $HOME/pbuilder-bases
|
||||
matrix:
|
||||
include:
|
||||
- env: TYPE=style
|
||||
- os: linux
|
||||
- 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
|
||||
- os: osx
|
||||
osx_image: xcode10.3
|
||||
before_install:
|
||||
# appdmg doesn't work with old Node.js
|
||||
- if [ "$TRAVIS_OS_NAME" = osx ]; then nvm install 10; fi
|
||||
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh
|
||||
script: ${TRAVIS_BUILD_DIR}/.travis/script.sh
|
||||
after_script: ${TRAVIS_BUILD_DIR}/.travis/after_script.sh
|
||||
before_deploy:
|
||||
- if [ "$TARGET_OS" != debian-sid ]; then make package; fi
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TYPE" != 'style' ]; then
|
||||
ccache -s
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
0de866bc0ee26de392e037104b174474989a830e2249280a136144baa44557aa ccache_3.2.4-1_amd64.deb
|
||||
@@ -1,3 +0,0 @@
|
||||
314ef4af137903dfb13e8c3ef1e6ea56cfdb23808d52ec4f5f50e288c73610c5 pbuilder_0.229.1_all.deb
|
||||
fa82aa8ed3055c6f6330104deedf080b26778295e589426d4c4dd0f2c2a5defa debootstrap_1.0.95_all.deb
|
||||
2ef4c09f7841b72f93412803ddd142f72658536dbfabe00e449eb548f432f3f8 debian-archive-keyring_2017.7ubuntu1_all.deb
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TYPE" = 'style' ]; then
|
||||
sudo apt-get -yqq update
|
||||
sudo apt-get install shellcheck
|
||||
else
|
||||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install.sh"
|
||||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.install.sh"
|
||||
fi
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
sudo add-apt-repository ppa:beineri/opt-qt592-xenial -y
|
||||
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update -qq || true
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
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 qt59base qt59translations qt59tools"
|
||||
|
||||
# swh build dependencies
|
||||
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"
|
||||
|
||||
# VST dependencies
|
||||
VST_PACKAGES="wine-dev qt59x11extras qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"
|
||||
|
||||
# LV2 dependencies; libsuil-dev is not required
|
||||
LV2_PACKAGES="lv2-dev liblilv-dev"
|
||||
|
||||
# Help with unmet dependencies
|
||||
PACKAGES="$PACKAGES $SWH_PACKAGES $VST_PACKAGES $LV2_PACKAGES libjack-jackd2-0"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
sudo apt-get install -y $PACKAGES
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
|
||||
# shellcheck disable=SC1091
|
||||
source /opt/qt59/bin/qt59-env.sh
|
||||
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cmake -DUSE_WERROR=ON -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
|
||||
make -j4
|
||||
make tests
|
||||
./tests/tests
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
sudo apt-get update -qq
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/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"
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
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
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CACHE_DIR=$HOME/apt_mingw_cache/$1
|
||||
mkdir -p "$CACHE_DIR"
|
||||
|
||||
pushd "$CACHE_DIR"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
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
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y
|
||||
sudo apt-get update -qq
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
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 mingw32-x-qt5base"
|
||||
|
||||
# swh build dependencies
|
||||
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win32
|
||||
|
||||
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES $SWH_PACKAGES"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
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
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_win32.sh
|
||||
|
||||
make -j4
|
||||
make tests
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh"
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# First, install 32-bit deps
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win32.install.sh"
|
||||
|
||||
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 mingw64-x-qt5base"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win64
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
sudo apt-get install -y $MINGW_PACKAGES
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_win64.sh
|
||||
|
||||
make -j4
|
||||
make tests
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
brew update
|
||||
# Python 2 may cause conflicts on dependency installation
|
||||
brew unlink python@2 || true
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate lilv lv2 jack sdl libgig libsoundio stk fluid-synth portaudio node fltk qt carla"
|
||||
|
||||
if "${TRAVIS}"; then
|
||||
PACKAGES="$PACKAGES ccache"
|
||||
fi
|
||||
|
||||
# removing already installed packages from the list
|
||||
for p in $(brew list); do
|
||||
PACKAGES=${PACKAGES//$p/}
|
||||
done;
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
brew install $PACKAGES
|
||||
|
||||
# fftw tries to install gcc which conflicts with travis
|
||||
brew install fftw --ignore-dependencies
|
||||
|
||||
npm install -g appdmg
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
# Workaround; No FindQt5.cmake module exists
|
||||
CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
|
||||
export CMAKE_PREFIX_PATH
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cmake -DUSE_WERROR=OFF -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
|
||||
|
||||
make -j4
|
||||
make tests
|
||||
./tests/tests
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$TYPE" = 'style' ]; then
|
||||
|
||||
# SC2185 is disabled because of: https://github.com/koalaman/shellcheck/issues/942
|
||||
# once it's fixed, it should be enabled again
|
||||
# shellcheck disable=SC2185
|
||||
# shellcheck disable=SC2046
|
||||
shellcheck $(find -O3 . -maxdepth 3 -type f -name '*.sh' -o -name "*.sh.in")
|
||||
shellcheck doc/bash-completion/lmms
|
||||
|
||||
else
|
||||
|
||||
export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUNDLE_QT_TRANSLATIONS=ON"
|
||||
|
||||
if [ -z "$TRAVIS_TAG" ]; then
|
||||
export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"
|
||||
fi
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh"
|
||||
|
||||
# Package and upload non-tagged builds
|
||||
if [ -n "$TRAVIS_TAG" ]; then
|
||||
# Skip, handled by travis deploy instead
|
||||
exit 0
|
||||
elif [[ $TARGET_OS == win* ]]; then
|
||||
cd build
|
||||
make -j4 package
|
||||
PACKAGE="$(ls lmms-*win*.exe)"
|
||||
elif [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||
cd build
|
||||
make -j4 install > /dev/null
|
||||
make dmg
|
||||
PACKAGE="$(ls lmms-*.dmg)"
|
||||
elif [[ $TARGET_OS != debian-sid ]]; then
|
||||
cd build
|
||||
make -j4 install > /dev/null
|
||||
make appimage
|
||||
PACKAGE="$(ls lmms-*.AppImage)"
|
||||
fi
|
||||
|
||||
echo "Uploading $PACKAGE to transfer.sh..."
|
||||
# Limit the connection time to 3 minutes and total upload time to 5 minutes
|
||||
# Otherwise the build may hang
|
||||
curl --connect-timeout 180 --max-time 300 --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true
|
||||
fi
|
||||
@@ -3,9 +3,8 @@ host = https://www.transifex.com
|
||||
minimum_perc = 51
|
||||
#Need to finish at least 51% before merging back
|
||||
|
||||
[lmms.lmms]
|
||||
[o:lmms:p:lmms:r:lmms]
|
||||
file_filter = data/locale/<lang>.ts
|
||||
source_file = data/locale/en.ts
|
||||
source_lang = en
|
||||
type = QT
|
||||
|
||||
type = QT
|
||||
|
||||
3
.yamllint
Normal file
3
.yamllint
Normal file
@@ -0,0 +1,3 @@
|
||||
rules:
|
||||
line-length:
|
||||
max: 120 # be conforming to LMMS coding rules
|
||||
20
Brewfile
Normal file
20
Brewfile
Normal file
@@ -0,0 +1,20 @@
|
||||
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 "pkg-config"
|
||||
brew "portaudio"
|
||||
brew "qt@5"
|
||||
brew "sdl2"
|
||||
brew "stk"
|
||||
371
CMakeLists.txt
371
CMakeLists.txt
@@ -1,4 +1,23 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
|
||||
|
||||
# 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.
|
||||
|
||||
PROJECT(lmms)
|
||||
|
||||
@@ -6,32 +25,28 @@ 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})
|
||||
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0005 NEW)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
IF (CMAKE_MAJOR_VERSION GREATER 2)
|
||||
CMAKE_POLICY(SET CMP0026 NEW)
|
||||
CMAKE_POLICY(SET CMP0045 NEW)
|
||||
CMAKE_POLICY(SET CMP0050 OLD)
|
||||
ENDIF()
|
||||
CMAKE_POLICY(SET CMP0020 NEW)
|
||||
CMAKE_POLICY(SET CMP0057 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
|
||||
# Import of windows.h breaks min()/max()
|
||||
ADD_DEFINITIONS(-DNOMINMAX)
|
||||
|
||||
# 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 2020)
|
||||
SET(PROJECT_YEAR 2024)
|
||||
|
||||
SET(PROJECT_AUTHOR "LMMS Developers")
|
||||
SET(PROJECT_URL "https://lmms.io")
|
||||
@@ -56,6 +71,7 @@ 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)
|
||||
@@ -73,25 +89,32 @@ 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 VST support" ON)
|
||||
OPTION(WANT_VST_64 "Include 64-bit 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_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(BUNDLE_QT_TRANSLATIONS "Install Qt translation files for LMMS" OFF)
|
||||
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
# Fix linking on 10.14+. See issue #4762 on github
|
||||
LINK_DIRECTORIES(/usr/local/lib)
|
||||
LINK_DIRECTORIES("${APPLE_PREFIX}/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)
|
||||
@@ -101,43 +124,37 @@ ENDIF(LMMS_BUILD_APPLE)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
SET(WANT_ALSA OFF)
|
||||
SET(WANT_OSS 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_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)
|
||||
|
||||
|
||||
# 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()
|
||||
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
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)
|
||||
@@ -148,12 +165,15 @@ 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}")
|
||||
|
||||
FIND_PACKAGE(Qt5 5.6.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
|
||||
FIND_PACKAGE(Qt5 5.9.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
include_directories(SYSTEM
|
||||
${Qt5Core_INCLUDE_DIRS}
|
||||
${Qt5Gui_INCLUDE_DIRS}
|
||||
${Qt5Widgets_INCLUDE_DIRS}
|
||||
@@ -183,7 +203,7 @@ execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
|
||||
)
|
||||
IF(EXISTS "${QT_TRANSLATIONS_DIR}")
|
||||
MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
|
||||
ADD_DEFINITIONS(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
|
||||
ADD_DEFINITIONS("-DQT_TRANSLATIONS_DIR=\"${QT_TRANSLATIONS_DIR}\"")
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt5Test)
|
||||
@@ -191,13 +211,30 @@ SET(QT_QTTEST_LIBRARY Qt5::Test)
|
||||
|
||||
# check for libsndfile
|
||||
FIND_PACKAGE(SndFile REQUIRED)
|
||||
IF(NOT SNDFILE_FOUND)
|
||||
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 SF_SET_COMPRESSION_LEVEL
|
||||
IF(NOT SNDFILE_VERSION VERSION_LESS 1.0.26)
|
||||
SET(LMMS_HAVE_SF_COMPLEVEL TRUE)
|
||||
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)
|
||||
@@ -205,6 +242,8 @@ IF(WANT_LV2)
|
||||
PKG_CHECK_MODULES(LILV lilv-0)
|
||||
ENDIF()
|
||||
IF(NOT LV2_FOUND AND NOT LILV_FOUND)
|
||||
UNSET(LV2_FOUND CACHE)
|
||||
UNSET(LILV_FOUND CACHE)
|
||||
FIND_PACKAGE(LV2 CONFIG)
|
||||
FIND_PACKAGE(LILV CONFIG)
|
||||
IF(LILV_FOUND)
|
||||
@@ -259,8 +298,12 @@ ELSE(WANT_CMT)
|
||||
ENDIF(WANT_CMT)
|
||||
|
||||
IF(WANT_SWH)
|
||||
SET(LMMS_HAVE_SWH TRUE)
|
||||
SET(STATUS_SWH "OK")
|
||||
IF(PERL_FOUND)
|
||||
SET(LMMS_HAVE_SWH TRUE)
|
||||
SET(STATUS_SWH "OK")
|
||||
ELSE()
|
||||
SET(STATUS_SWH "Skipping, perl is missing")
|
||||
ENDIF()
|
||||
ELSE(WANT_SWH)
|
||||
SET(STATUS_SWH "not built as requested")
|
||||
ENDIF(WANT_SWH)
|
||||
@@ -292,40 +335,26 @@ ENDIF(WANT_CARLA)
|
||||
|
||||
# check for SDL2
|
||||
IF(WANT_SDL)
|
||||
SET(SDL2_BUILDING_LIBRARY TRUE)
|
||||
FIND_PACKAGE(SDL2)
|
||||
IF(SDL2_FOUND)
|
||||
SET(LMMS_HAVE_SDL TRUE)
|
||||
SET(LMMS_HAVE_SDL2 TRUE)
|
||||
SET(STATUS_SDL "OK, using SDL2")
|
||||
SET(SDL_INCLUDE_DIR "")
|
||||
SET(SDL_LIBRARY "")
|
||||
SET(STATUS_SDL "OK")
|
||||
SET(SDL2_LIBRARY "SDL2::SDL2")
|
||||
ELSE()
|
||||
SET(SDL2_INCLUDE_DIR "")
|
||||
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) if you require SDL support")
|
||||
SET(SDL2_LIBRARY "")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# fallback to SDL1
|
||||
IF(WANT_SDL AND NOT LMMS_HAVE_SDL2)
|
||||
# Fallback to SDL1.2
|
||||
SET(SDL_BUILDING_LIBRARY TRUE)
|
||||
FIND_PACKAGE(SDL)
|
||||
IF(SDL_FOUND)
|
||||
SET(LMMS_HAVE_SDL TRUE)
|
||||
SET(STATUS_SDL "OK, using SDL1.2")
|
||||
# fix mingw since 53abd65
|
||||
IF(NOT SDL_INCLUDE_DIR)
|
||||
SET(SDL_INCLUDE_DIR "${CMAKE_FIND_ROOT_PATH}/include")
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) "
|
||||
"if you require SDL support")
|
||||
SET(SDL_INCLUDE_DIR "")
|
||||
SET(SDL_LIBRARY "")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# 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)
|
||||
@@ -344,13 +373,13 @@ 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(PORTAUDIO_FOUND)
|
||||
ELSE()
|
||||
SET(STATUS_PORTAUDIO "not found, please install portaudio19-dev (or similar, version >= 1.9) "
|
||||
"if you require PortAudio support")
|
||||
ENDIF(PORTAUDIO_FOUND)
|
||||
ENDIF()
|
||||
ENDIF(WANT_PORTAUDIO)
|
||||
|
||||
# check for libsoundio
|
||||
@@ -359,7 +388,7 @@ IF(WANT_SOUNDIO)
|
||||
IF(SOUNDIO_FOUND)
|
||||
SET(LMMS_HAVE_SOUNDIO TRUE)
|
||||
SET(STATUS_SOUNDIO "OK")
|
||||
INCLUDE_DIRECTORIES("${SOUNDIO_INCLUDE_DIR}")
|
||||
include_directories(SYSTEM "${SOUNDIO_INCLUDE_DIR}")
|
||||
ELSE(SOUNDIO_FOUND)
|
||||
SET(SOUNDIO_INCLUDE_DIR "")
|
||||
SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support")
|
||||
@@ -393,8 +422,6 @@ 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")
|
||||
@@ -413,13 +440,13 @@ IF(WANT_OGGVORBIS)
|
||||
ENDIF(WANT_OGGVORBIS)
|
||||
|
||||
|
||||
# check whether to enable OSS-support
|
||||
IF(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
# check for OSS
|
||||
IF(WANT_OSS AND (LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H))
|
||||
SET(LMMS_HAVE_OSS TRUE)
|
||||
SET(STATUS_OSS "OK")
|
||||
ELSE(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
ELSEIF(WANT_OSS)
|
||||
SET(STATUS_OSS "<not found or not supported on this platform>")
|
||||
ENDIF(LMMS_HAVE_SOUNDCARD_H OR LMMS_HAVE_SYS_SOUNDCARD_H)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# check for ALSA
|
||||
@@ -442,17 +469,22 @@ ENDIF(NOT LMMS_HAVE_ALSA)
|
||||
IF(WANT_JACK)
|
||||
IF(WANT_WEAKJACK)
|
||||
SET(LMMS_HAVE_WEAKJACK TRUE)
|
||||
SET(WEAKJACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack)
|
||||
SET(JACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/jack2/common)
|
||||
SET(STATUS_JACK "OK (weak linking enabled)")
|
||||
# use dlsym instead
|
||||
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
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)
|
||||
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()
|
||||
|
||||
@@ -466,6 +498,13 @@ ENDIF(WANT_JACK)
|
||||
FIND_PACKAGE(FFTW COMPONENTS fftw3f REQUIRED)
|
||||
|
||||
# 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")
|
||||
@@ -475,14 +514,18 @@ ENDIF()
|
||||
|
||||
# check for Fluidsynth
|
||||
IF(WANT_SF2)
|
||||
PKG_CHECK_MODULES(FLUIDSYNTH fluidsynth>=1.0.7)
|
||||
IF(FLUIDSYNTH_FOUND)
|
||||
find_package(FluidSynth 1.1.7)
|
||||
if(FluidSynth_FOUND)
|
||||
SET(LMMS_HAVE_FLUIDSYNTH TRUE)
|
||||
SET(STATUS_FLUIDSYNTH "OK")
|
||||
ELSE(FLUIDSYNTH_FOUND)
|
||||
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 "not found, libfluidsynth-dev (or similar)"
|
||||
"is highly recommended")
|
||||
ENDIF(FLUIDSYNTH_FOUND)
|
||||
endif()
|
||||
ENDIF(WANT_SF2)
|
||||
|
||||
# check for libgig
|
||||
@@ -513,26 +556,42 @@ IF(WANT_SNDIO)
|
||||
ENDIF(WANT_SNDIO)
|
||||
|
||||
# check for WINE
|
||||
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_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()
|
||||
endif()
|
||||
|
||||
IF(WANT_DEBUG_FPE)
|
||||
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)
|
||||
@@ -548,28 +607,6 @@ ENDIF(WANT_DEBUG_FPE)
|
||||
# check for libsamplerate
|
||||
FIND_PACKAGE(Samplerate 0.1.8 MODULE REQUIRED)
|
||||
|
||||
# set compiler flags
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
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()
|
||||
ELSEIF(MSVC)
|
||||
# Remove any existing /W flags
|
||||
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
SET(WERROR_FLAGS "/W2")
|
||||
IF(${USE_WERROR})
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} /WX")
|
||||
ENDIF()
|
||||
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)
|
||||
@@ -578,11 +615,21 @@ IF(NOT CMAKE_BUILD_TYPE)
|
||||
"MinSizeRel" "RelWithDebInfo")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${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(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)
|
||||
@@ -609,14 +656,41 @@ ENDIF()
|
||||
# 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")
|
||||
IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
ENDIF(WIN32)
|
||||
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()
|
||||
|
||||
# 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)
|
||||
|
||||
# use ccache
|
||||
include(CompileCache)
|
||||
|
||||
@@ -657,18 +731,6 @@ IF(LMMS_BUILD_LINUX)
|
||||
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
|
||||
#
|
||||
@@ -698,7 +760,6 @@ ADD_CUSTOM_TARGET(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake"
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# display configuration information
|
||||
#
|
||||
@@ -750,9 +811,11 @@ MESSAGE(
|
||||
"* 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-instrument hoster : ${STATUS_VST}\n"
|
||||
"* VST-effect hoster : ${STATUS_VST}\n"
|
||||
"* VST plugin host : ${STATUS_VST}\n"
|
||||
" * 32-bit Windows host : ${STATUS_VST_32}\n"
|
||||
" * 64-bit Windows host : ${STATUS_VST_64}\n"
|
||||
"* CALF LADSPA plugins : ${STATUS_CALF}\n"
|
||||
"* CAPS LADSPA plugins : ${STATUS_CAPS}\n"
|
||||
"* CMT LADSPA plugins : ${STATUS_CMT}\n"
|
||||
@@ -764,7 +827,11 @@ MESSAGE(
|
||||
MESSAGE(
|
||||
"Developer options\n"
|
||||
"-----------------------------------------\n"
|
||||
"* Debug FP exceptions : ${STATUS_DEBUG_FPE}\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"
|
||||
)
|
||||
|
||||
MESSAGE(
|
||||
|
||||
10
README.md
10
README.md
@@ -1,13 +1,11 @@
|
||||
#  LMMS
|
||||
#  LMMS
|
||||
|
||||
[](https://travis-ci.org/LMMS/lmms)
|
||||
[](https://github.com/LMMS/lmms/actions/workflows/build.yml)
|
||||
[](https://lmms.io/download)
|
||||
[](https://github.com/LMMS/lmms/releases)
|
||||
[](https://discord.gg/3sc5su7)
|
||||
[](https://www.transifex.com/lmms/lmms/)
|
||||
|
||||
**A soft PR-Freeze is currently underway to prepare for refactoring ([#5592](https://github.com/LMMS/lmms/issues/5592)). Please do not open non-essential PRs at this time.**
|
||||
|
||||
What is LMMS?
|
||||
--------------
|
||||
|
||||
@@ -28,9 +26,9 @@ Features
|
||||
---------
|
||||
|
||||
* Song-Editor for composing songs
|
||||
* A Beat+Bassline-Editor for creating beats and basslines
|
||||
* Pattern-Editor for creating beats and patterns
|
||||
* An easy-to-use Piano-Roll for editing patterns and melodies
|
||||
* An FX mixer with unlimited FX channels and arbitrary number of effects
|
||||
* A Mixer with unlimited mixer 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, VST(i), LADSPA, GUS Patches, and full MIDI support
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
|
||||
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}")
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
SET(CMAKE_AUTOMOC ON)
|
||||
|
||||
ADD_EXECUTABLE(benchmarks
|
||||
EXCLUDE_FROM_ALL
|
||||
benchmark.cpp
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(benchmarks lmmslib)
|
||||
|
||||
# TODO replace usages of include_directories in src/CMakeLists.txt with target_include_directories
|
||||
# and remove this line (also in tests/CMakeLists.txt)
|
||||
target_include_directories(benchmarks PRIVATE $<TARGET_PROPERTY:lmmsobjs,INCLUDE_DIRECTORIES>)
|
||||
|
||||
target_static_libraries(benchmarks PRIVATE lmmsobjs)
|
||||
target_compile_features(benchmarks PRIVATE cxx_std_17)
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "NotePlayHandle.h"
|
||||
|
||||
using namespace lmms;
|
||||
|
||||
template<typename T>
|
||||
using LocklessQueue = cds::container::VyukovMPMCCycleQueue<T>;
|
||||
|
||||
@@ -116,7 +118,6 @@ int main(int argc, char* argv[])
|
||||
constexpr size_t S = 256;
|
||||
using T = std::array<char, S>;
|
||||
benchmark_allocator("std::allocator", std::allocator<T>{}, n, 1);
|
||||
benchmark_allocator("MmAllocator", MmAllocator<T>{}, n, 1);
|
||||
benchmark_allocator("MemoryPool", MemoryPool<T>{n}, n, 1);
|
||||
}
|
||||
{
|
||||
@@ -124,7 +125,6 @@ int main(int argc, char* argv[])
|
||||
constexpr size_t S = 256;
|
||||
using T = std::array<char, S>;
|
||||
benchmark_allocator_threaded("std::allocator", std::allocator<T>{}, n, 4);
|
||||
benchmark_allocator_threaded("MmAllocator", MmAllocator<T>{}, n, 4);
|
||||
benchmark_allocator_threaded("MemoryPool", MemoryPool<T>{n}, n, 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,19 @@ 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)
|
||||
|
||||
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()
|
||||
|
||||
# DMG creation target
|
||||
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}.dmg")
|
||||
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}-${DMG_ARCH}.dmg")
|
||||
|
||||
FILE(REMOVE "${DMG_FILE}")
|
||||
ADD_CUSTOM_TARGET(removedmg
|
||||
COMMAND touch "\"${DMG_FILE}\"" && rm "\"${DMG_FILE}\""
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
# STK rawwaves directory
|
||||
STK_RAWWAVE=$(brew --prefix stk)/share/stk/rawwaves
|
||||
|
||||
# Place to create ".app" bundle
|
||||
APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app"
|
||||
|
||||
@@ -29,19 +26,15 @@ command cp "@CMAKE_BINARY_DIR@/Info.plist" "@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
|
||||
@@ -49,18 +42,9 @@ 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
|
||||
# See also plugins/CarlaBase/CMakeLists.txt
|
||||
# This MUST be done BEFORE calling macdeployqt
|
||||
install_name_tool -change @rpath/libcarlabase.dylib \
|
||||
@loader_path/libcarlabase.dylib \
|
||||
@@ -72,7 +56,6 @@ install_name_tool -change @rpath/libcarlabase.dylib \
|
||||
|
||||
# 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
|
||||
@@ -114,4 +97,8 @@ done
|
||||
|
||||
# Cleanup
|
||||
rm -rf "$APP/Contents/bin"
|
||||
|
||||
# Codesign
|
||||
codesign --force --deep --sign - "$APP"
|
||||
|
||||
echo -e "\nFinished.\n\n"
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# Accomodate both linux windows mingw locations
|
||||
if [ -z "$ARCH" ]; then
|
||||
ARCH=32
|
||||
fi
|
||||
|
||||
MINGW=/mingw$ARCH
|
||||
|
||||
if [ -z "$MSYSCON" ]; then
|
||||
MINGW=/opt$MINGW
|
||||
|
||||
DISTRO=$(lsb_release -si)
|
||||
DISTRO_VERSION=$(lsb_release -sr)
|
||||
|
||||
if [ "$DISTRO" != "Ubuntu" ]; then
|
||||
echo "This script only supports Ubuntu"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$DISTRO_VERSION" == "14.04" ]; then
|
||||
TOOLCHAIN="$DIR/toolchains/Ubuntu-MinGW-X-Trusty-$ARCH.cmake"
|
||||
else
|
||||
TOOLCHAIN="$DIR/toolchains/Ubuntu-MinGW-W64-$ARCH.cmake"
|
||||
fi
|
||||
else
|
||||
TOOLCHAIN="$DIR/toolchains/MSYS-$ARCH.cmake"
|
||||
fi
|
||||
|
||||
export PATH=$MINGW/bin:$PATH
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
if [ "$ARCH" == "32" ]; then
|
||||
export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse"
|
||||
fi
|
||||
|
||||
CMAKE_OPTS="-DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
cmake "$DIR/.." -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" $CMAKE_OPTS
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
ARCH=64 "$DIR/build_win32.sh"
|
||||
@@ -36,7 +36,21 @@ IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
|
||||
)
|
||||
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")
|
||||
install(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
|
||||
else()
|
||||
message(WARNING "Can't find STK rawwave root!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x ${CMAKE_BINARY_DIR}/install_apple.sh)")
|
||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh)")
|
||||
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh RESULT_VARIABLE EXIT_CODE)
|
||||
IF(NOT EXIT_CODE EQUAL 0)
|
||||
MESSAGE(FATAL_ERROR \"Execution of install_apple.sh failed\")
|
||||
ENDIF()
|
||||
")
|
||||
ENDIF()
|
||||
|
||||
@@ -3,17 +3,21 @@
|
||||
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
|
||||
|
||||
@@ -4,21 +4,21 @@ 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."
|
||||
echo "Carla appears to be installed on this system at $CARLAPREFIX/lib[64]/carla so we'll use it." >&2
|
||||
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."
|
||||
echo "Carla does not appear to be installed. That's OK, please ignore any related library errors." >&2
|
||||
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."
|
||||
echo "VirtualBox detected. Forcing libgl software rendering." >&2
|
||||
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."
|
||||
echo "Jack appears to be installed on this system, so we'll use it." >&2
|
||||
else
|
||||
echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead."
|
||||
echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2
|
||||
export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH
|
||||
fi
|
||||
QT_X11_NO_NATIVE_MENUBAR=1 "$DIR"/usr/bin/lmms.real "$@"
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
# 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/"
|
||||
@@ -40,8 +37,21 @@ function skipped {
|
||||
echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}"
|
||||
}
|
||||
|
||||
# Exit with error message if any command fails
|
||||
trap "error 'Failed to generate AppImage'; exit 1" ERR
|
||||
|
||||
# Run a command silently, but print output if it fails
|
||||
function run_and_log {
|
||||
echo -e "\n\n>>>>> $1" >> "$LOGFILE"
|
||||
output="$("$@" 2>&1)"
|
||||
status=$?
|
||||
echo "$output" >> "$LOGFILE"
|
||||
[[ $status != 0 ]] && echo "$output"
|
||||
return $status
|
||||
}
|
||||
|
||||
# Blindly assume system arch is appimage arch
|
||||
ARCH=$(arch)
|
||||
ARCH=$(uname -m)
|
||||
export ARCH
|
||||
|
||||
# Check for problematic install locations
|
||||
@@ -50,35 +60,39 @@ 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
|
||||
PATH="$(pwd -P)/squashfs-root/usr/bin:$(dirname "@QT_QMAKE_EXECUTABLE@")":$PATH
|
||||
PATH="$(dirname "@QT_QMAKE_EXECUTABLE@"):$PATH"
|
||||
export PATH
|
||||
|
||||
# Use linuxdeployqt from env or in PATH
|
||||
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt 2>/dev/null)" || true
|
||||
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool 2>/dev/null)" || true
|
||||
|
||||
# Fetch portable linuxdeployqt if not in PATH
|
||||
APPIMAGETOOL="squashfs-root/usr/bin/appimagetool"
|
||||
echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..."
|
||||
if env -i which linuxdeployqt > /dev/null 2>&1; then
|
||||
skipped "System already provides this utility"
|
||||
else
|
||||
filename="linuxdeployqt-continuous-$(uname -p).AppImage"
|
||||
if [[ -z $LINUXDEPLOYQT || -z $APPIMAGETOOL ]]; then
|
||||
filename="linuxdeployqt-continuous-$ARCH.AppImage"
|
||||
url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$filename"
|
||||
down_file="$(pwd)/$filename"
|
||||
if [ ! -f "$LINUXDEPLOYQT" ]; then
|
||||
ln -s "$down_file" "$LINUXDEPLOYQT"
|
||||
fi
|
||||
echo " [.......] Downloading ($(uname -p)): ${url}"
|
||||
wget -N -q "$url" || (rm "$filename" && false)
|
||||
chmod +x "$LINUXDEPLOYQT"
|
||||
success "Downloaded $LINUXDEPLOYQT"
|
||||
echo " [.......] Downloading: ${url}"
|
||||
wget -N -q "$url" && err=0 || err=$?
|
||||
case "$err" in
|
||||
0) success "Downloaded $PWD/$filename" ;;
|
||||
# 8 == server issued 4xx error
|
||||
8) error "Download failed (perhaps no package available for $ARCH)" ;;
|
||||
*) error "Download failed" ;;
|
||||
esac
|
||||
|
||||
# Extract AppImage and replace LINUXDEPLOYQT variable with extracted binary
|
||||
# to support systems without fuse
|
||||
# Also, we need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it
|
||||
# See https://github.com/probonopd/linuxdeployqt/pull/370/
|
||||
"$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1
|
||||
LINUXDEPLOYQT="squashfs-root/usr/bin/linuxdeployqt"
|
||||
success "Extracted $APPIMAGETOOL"
|
||||
chmod +x "$filename"
|
||||
./"$filename" --appimage-extract >/dev/null
|
||||
success "Extracted $filename"
|
||||
|
||||
# Use the extracted linuxdeployqt and appimagetool
|
||||
PATH="$(pwd -P)/squashfs-root/usr/bin:$PATH"
|
||||
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt)"
|
||||
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool)"
|
||||
fi
|
||||
|
||||
# Make skeleton AppDir
|
||||
@@ -135,6 +149,7 @@ fi
|
||||
|
||||
# Patch the desktop file
|
||||
sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE"
|
||||
echo "X-AppImage-Version=@VERSION@" >> "$DESKTOPFILE"
|
||||
|
||||
# Fix linking for soft-linked plugins
|
||||
for file in "${APPDIR}usr/lib/lmms/"*.so; do
|
||||
@@ -149,12 +164,14 @@ executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197.
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so"
|
||||
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so"
|
||||
|
||||
echo -e "\nWriting verbose output to \"${LOGFILE}\""
|
||||
echo -n > "$LOGFILE"
|
||||
|
||||
# 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
|
||||
run_and_log "$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP
|
||||
success "Bundled and relinked dependencies"
|
||||
|
||||
# Link to original location so lmms can find them
|
||||
@@ -185,10 +202,12 @@ fi
|
||||
rm -f "${APPDIR}/AppRun"
|
||||
ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun"
|
||||
|
||||
# Add icon
|
||||
ln -srf "${APPDIR}/lmms.png" "${APPDIR}/.DirIcon"
|
||||
|
||||
# Create AppImage
|
||||
echo -e "\nFinishing the AppImage..."
|
||||
echo -e "\n\n>>>>> appimagetool" >> "$LOGFILE"
|
||||
"$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" >> "$LOGFILE" 2>&1
|
||||
run_and_log "$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@"
|
||||
success "Created @APPIMAGE_FILE@"
|
||||
|
||||
echo -e "\nFinished"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# - 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.")
|
||||
MESSAGE(STATUS "Bash completion is not supported on this platform.")
|
||||
ELSEIF(APPLE)
|
||||
MESSAGE(STATUS "Bash completion is not yet implemented for this platform.")
|
||||
ELSE()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# 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> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE>)
|
||||
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> LINK <SHARED|MODULE>)
|
||||
|
||||
INCLUDE(GenQrc)
|
||||
|
||||
MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "LINK;EXPORT_BASE_NAME" "MOCFILES;EMBEDDED_RESOURCES;UICFILES" ${ARGN})
|
||||
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "LINK;EXPORT_BASE_NAME" "MOCFILES;EMBEDDED_RESOURCES" ${ARGN})
|
||||
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})
|
||||
|
||||
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/include")
|
||||
@@ -31,10 +31,9 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
ENDIF(ER_LEN)
|
||||
|
||||
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
|
||||
QT5_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
|
||||
|
||||
FOREACH(f ${PLUGIN_SOURCES})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT} ${plugin_UIC_out})
|
||||
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT})
|
||||
ENDFOREACH(f)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
@@ -45,10 +44,6 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
|
||||
LINK_LIBRARIES(${QT_LIBRARIES})
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Override Qt debug libraries with release versions
|
||||
SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}")
|
||||
ENDIF()
|
||||
|
||||
IF (NOT PLUGIN_LINK)
|
||||
SET(PLUGIN_LINK "MODULE")
|
||||
@@ -56,11 +51,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
|
||||
ADD_LIBRARY(${PLUGIN_NAME} ${PLUGIN_LINK} ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
|
||||
|
||||
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} lmms)
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
target_link_libraries("${PLUGIN_NAME}" lmms Qt5::Widgets Qt5::Xml)
|
||||
|
||||
INSTALL(TARGETS ${PLUGIN_NAME}
|
||||
LIBRARY DESTINATION "${PLUGIN_DIR}"
|
||||
@@ -69,16 +60,17 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
|
||||
|
||||
IF(LMMS_BUILD_APPLE)
|
||||
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
|
||||
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\"")
|
||||
TARGET_LINK_OPTIONS(${PLUGIN_NAME} PRIVATE -undefined dynamic_lookup)
|
||||
ENDIF()
|
||||
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
|
||||
ENDIF(LMMS_BUILD_APPLE)
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
IF(STRIP)
|
||||
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
|
||||
ENDIF()
|
||||
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()
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# INCLUDE(CheckSubmodules)
|
||||
#
|
||||
# Options:
|
||||
# SET(PLUGIN_LIST "zynaddsubfx;...") # skips submodules for plugins not explicitely listed
|
||||
# SET(PLUGIN_LIST "ZynAddSubFx;...") # skips submodules for plugins not explicitely listed
|
||||
#
|
||||
# Or via command line:
|
||||
# cmake -PLUGIN_LIST=foo;bar
|
||||
@@ -18,7 +18,7 @@
|
||||
# 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")
|
||||
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)
|
||||
|
||||
|
||||
@@ -1,25 +1,40 @@
|
||||
option(USE_COMPILE_CACHE "Use ccache or clcache for compilation" OFF)
|
||||
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(USE_COMPILE_CACHE)
|
||||
if(MSVC)
|
||||
set(CACHE_TOOL_NAME clcache)
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|AppleClang|Clang)")
|
||||
set(CACHE_TOOL_NAME ccache)
|
||||
else()
|
||||
message(WARNING "Compile cache only available with MSVC or GNU")
|
||||
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()
|
||||
|
||||
find_program(CACHE_TOOL ${CACHE_TOOL_NAME})
|
||||
if (CACHE_TOOL)
|
||||
message(STATUS "Using ${CACHE_TOOL} found for caching")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CACHE_TOOL})
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CACHE_TOOL})
|
||||
else()
|
||||
message(WARNING "USE_COMPILE_CACHE enabled, but no ${CACHE_TOOL_NAME} found")
|
||||
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}")
|
||||
|
||||
@@ -11,7 +11,7 @@ function(CreateTempFilePath)
|
||||
|
||||
set(file_name "${CMAKE_BINARY_DIR}/${TEMP_TAG}_${hashed_content}")
|
||||
set(${TEMP_OUTPUT_VAR} "${file_name}" PARENT_SCOPE)
|
||||
if(CONFIG_SUFFIX)
|
||||
if(TEMP_CONFIG_SUFFIX)
|
||||
set(file_name "${file_name}_$<CONFIG>")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ function(DEFINE_INSTALL_VAR)
|
||||
endif()
|
||||
else()
|
||||
if(VAR_GENERATOR_EXPRESSION)
|
||||
cmake_policy(SET CMP0087 NEW)
|
||||
cmake_policy(SET CMP0087 NEW) # install(CODE) and install(SCRIPT) support generator expressions.
|
||||
endif()
|
||||
install(CODE "set(\"${VAR_NAME}\" \"${VAR_CONTENT}\")")
|
||||
endif()
|
||||
|
||||
@@ -12,31 +12,56 @@ ELSE()
|
||||
SET(LMMS_BUILD_LINUX 1)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# LMMS_BUILD_MSYS also set in build_winXX.sh
|
||||
IF(LMMS_BUILD_WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND DEFINED ENV{MSYSCON})
|
||||
SET(LMMS_BUILD_MSYS TRUE)
|
||||
ENDIF()
|
||||
|
||||
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)
|
||||
SET(WIN64 ON)
|
||||
# TODO: This seems a bit presumptous
|
||||
SET(WIN64 ON)
|
||||
ENDIF()
|
||||
|
||||
IF(WIN32)
|
||||
IF(WIN64)
|
||||
SET(IS_X86_64 TRUE)
|
||||
SET(LMMS_BUILD_WIN64 TRUE)
|
||||
ELSE(WIN64)
|
||||
SET(IS_X86 TRUE)
|
||||
ENDIF(WIN64)
|
||||
|
||||
if(MSVC)
|
||||
SET(MSVC_VER ${CMAKE_CXX_COMPILER_VERSION})
|
||||
|
||||
IF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20)
|
||||
# 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)
|
||||
@@ -50,23 +75,70 @@ IF(WIN32)
|
||||
ENDIF()
|
||||
|
||||
unset(MSVC_VER)
|
||||
else()
|
||||
# Cross-compiled
|
||||
# TODO: Handle Windows ARM64 targets
|
||||
IF(WIN64)
|
||||
SET(IS_X86_64 TRUE)
|
||||
SET(LMMS_BUILD_WIN64 TRUE)
|
||||
ELSE(WIN64)
|
||||
SET(IS_X86 TRUE)
|
||||
ENDIF(WIN64)
|
||||
endif()
|
||||
ELSE(WIN32)
|
||||
EXEC_PROGRAM( ${CMAKE_C_COMPILER} ARGS "-dumpmachine ${CMAKE_C_FLAGS}" OUTPUT_VARIABLE Machine )
|
||||
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)
|
||||
MESSAGE("Machine: ${Machine}")
|
||||
STRING(REGEX MATCH "i.86" IS_X86 "${Machine}")
|
||||
STRING(REGEX MATCH "86_64|amd64" IS_X86_64 "${Machine}")
|
||||
ENDIF(WIN32)
|
||||
IF(Machine MATCHES "arm|aarch64")
|
||||
IF(Machine MATCHES "arm64|aarch64")
|
||||
SET(IS_ARM64 TRUE)
|
||||
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)
|
||||
ELSE()
|
||||
SET(IS_PPC32 TRUE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(IS_X86)
|
||||
MESSAGE("-- Target host is 32 bit")
|
||||
MESSAGE("-- Target host is 32 bit, Intel")
|
||||
SET(LMMS_HOST_X86 TRUE)
|
||||
ELSEIF(IS_X86_64)
|
||||
MESSAGE("-- Target host is 64 bit")
|
||||
MESSAGE("-- Target host is 64 bit, Intel")
|
||||
SET(LMMS_HOST_X86_64 TRUE)
|
||||
ELSE(IS_X86)
|
||||
ELSEIF(IS_ARM32)
|
||||
MESSAGE("-- Target host is 32 bit, ARM")
|
||||
SET(LMMS_HOST_ARM32 TRUE)
|
||||
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)
|
||||
ELSEIF(IS_PPC64)
|
||||
MESSAGE("-- Target host is 64 bit, PPC")
|
||||
SET(LMMS_HOST_PPC64 TRUE)
|
||||
ELSE()
|
||||
MESSAGE("Can't identify target host. Assuming 32 bit platform.")
|
||||
ENDIF(IS_X86)
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_INSTALL_LIBDIR)
|
||||
SET(LIB_DIR "${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
72
cmake/modules/ErrorFlags.cmake
Normal file
72
cmake/modules/ErrorFlags.cmake
Normal file
@@ -0,0 +1,72 @@
|
||||
# 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()
|
||||
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}>")
|
||||
73
cmake/modules/FindFluidSynth.cmake
Normal file
73
cmake/modules/FindFluidSynth.cmake
Normal file
@@ -0,0 +1,73 @@
|
||||
# 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"
|
||||
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,16 +1,31 @@
|
||||
# - Try to find LAME
|
||||
# Once done this will define
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
#
|
||||
# LAME_FOUND - system has liblame
|
||||
# LAME_INCLUDE_DIRS - the liblame include directory
|
||||
# LAME_LIBRARIES - The liblame libraries
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
find_path(LAME_INCLUDE_DIRS lame/lame.h)
|
||||
find_library(LAME_LIBRARIES mp3lame)
|
||||
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;
|
||||
}
|
||||
]])
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Lame DEFAULT_MSG LAME_INCLUDE_DIRS LAME_LIBRARIES)
|
||||
|
||||
list(APPEND LAME_DEFINITIONS -DHAVE_LIBMP3LAME=1)
|
||||
|
||||
mark_as_advanced(LAME_INCLUDE_DIRS LAME_LIBRARIES LAME_DEFINITIONS)
|
||||
find_package_handle_standard_args(Lame
|
||||
REQUIRED_VARS Lame_LIBRARY Lame_INCLUDE_DIRS
|
||||
VERSION_VAR Lame_VERSION
|
||||
)
|
||||
|
||||
@@ -1,86 +1,68 @@
|
||||
# - Try to find the OggVorbis libraries
|
||||
# Once done this will define
|
||||
# Copyright (c) 2023 Dominic Clark
|
||||
#
|
||||
# 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.
|
||||
# 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)
|
||||
|
||||
include (CheckLibraryExists)
|
||||
find_package_config_mode_with_fallback(Ogg Ogg::ogg
|
||||
LIBRARY_NAMES "ogg"
|
||||
INCLUDE_NAMES "ogg/ogg.h"
|
||||
PKG_CONFIG 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::vorbis
|
||||
LIBRARY_NAMES "vorbis"
|
||||
INCLUDE_NAMES "vorbis/codec.h"
|
||||
PKG_CONFIG vorbis
|
||||
DEPENDS Ogg::ogg
|
||||
)
|
||||
|
||||
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::vorbisfile
|
||||
LIBRARY_NAMES "vorbisfile"
|
||||
INCLUDE_NAMES "vorbis/vorbisfile.h"
|
||||
PKG_CONFIG vorbisfile
|
||||
DEPENDS Vorbis::vorbis
|
||||
PREFIX VorbisFile
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
|
||||
set(OGGVORBIS_FOUND TRUE)
|
||||
determine_version_from_source(Vorbis_VERSION Vorbis::vorbis [[
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <vorbis/codec.h>
|
||||
|
||||
set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
|
||||
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(_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)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
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,36 +1,34 @@
|
||||
# - 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>
|
||||
# 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)
|
||||
|
||||
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)
|
||||
find_package_config_mode_with_fallback(portaudio portaudio
|
||||
LIBRARY_NAMES "portaudio"
|
||||
INCLUDE_NAMES "portaudio.h"
|
||||
PKG_CONFIG portaudio-2.0
|
||||
PREFIX Portaudio
|
||||
)
|
||||
|
||||
# show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
|
||||
determine_version_from_source(Portaudio_VERSION portaudio [[
|
||||
#include <iostream>
|
||||
#include "portaudio.h"
|
||||
|
||||
endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS)
|
||||
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);
|
||||
}
|
||||
]])
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(Portaudio
|
||||
REQUIRED_VARS Portaudio_LIBRARY Portaudio_INCLUDE_DIRS
|
||||
VERSION_VAR Portaudio_VERSION
|
||||
)
|
||||
|
||||
@@ -18,13 +18,15 @@ 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
|
||||
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})
|
||||
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()
|
||||
ENDIF (NOT WIN32)
|
||||
|
||||
FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h
|
||||
|
||||
@@ -1,57 +1,20 @@
|
||||
|
||||
# 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
|
||||
#
|
||||
# This module responds to the the flag:
|
||||
# SDL2_BUILDING_LIBRARY
|
||||
# If this is defined, then no SDL2main will be linked in because
|
||||
# only applications need main().
|
||||
# Otherwise, it is assumed you are building an application and this
|
||||
# module will attempt to locate and set the the proper link flags
|
||||
# as part of the returned SDL2_LIBRARY variable.
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDL2main which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
#
|
||||
#
|
||||
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
|
||||
# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library
|
||||
# (SDL2.dll, libsdl2.so, SDL2.framework, etc).
|
||||
# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again.
|
||||
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
|
||||
# as appropriate. These values are used to generate the final SDL2_LIBRARY
|
||||
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
|
||||
#
|
||||
#
|
||||
# $SDL2DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDL2DIR
|
||||
# used in building SDL2.
|
||||
# l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing.
|
||||
# Added code to assist with automated building by using environmental variables
|
||||
# and providing a more controlled/consistent search behavior.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
||||
# Added a search for SDL2main which is needed by some platforms.
|
||||
# Added a search for threads which is needed by some platforms.
|
||||
# Added needed compile switches for MinGW.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
|
||||
# This needed to change because "proper" SDL convention
|
||||
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
|
||||
# reasons because not all systems place things in SDL2/ (see FreeBSD).
|
||||
|
||||
# $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.
|
||||
#
|
||||
@@ -65,109 +28,103 @@
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# message("<FindSDL2.cmake>")
|
||||
# Try config mode first - anything SDL2 itself provides is likely to be more
|
||||
# reliable than our guesses.
|
||||
find_package(SDL2 CONFIG QUIET)
|
||||
|
||||
SET(SDL2_SEARCH_PATHS
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt
|
||||
${SDL2_PATH}
|
||||
)
|
||||
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)
|
||||
|
||||
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
|
||||
HINTS
|
||||
$ENV{SDL2DIR}
|
||||
PATH_SUFFIXES SDL2 include/SDL2 include
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
# 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}
|
||||
)
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(PATH_SUFFIXES lib64 lib/x64 lib)
|
||||
else()
|
||||
set(PATH_SUFFIXES lib/x86 lib)
|
||||
endif()
|
||||
find_path(SDL2_INCLUDE_DIR
|
||||
NAMES SDL.h
|
||||
HINTS $ENV{SDL2DIR} ${SDL2_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES SDL2 include/SDL2 include
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SDL2_LIBRARY_TEMP
|
||||
NAMES SDL2
|
||||
HINTS
|
||||
$ENV{SDL2DIR}
|
||||
PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
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()
|
||||
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDL2main for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
FIND_LIBRARY(SDL2MAIN_LIBRARY
|
||||
NAMES SDL2main
|
||||
HINTS
|
||||
$ENV{SDL2DIR}
|
||||
PATH_SUFFIXES ${PATH_SUFFIXES}
|
||||
PATHS ${SDL2_SEARCH_PATHS}
|
||||
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}"
|
||||
)
|
||||
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
# 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(NOT APPLE)
|
||||
# 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()
|
||||
|
||||
# MinGW needs an additional link flag, -mwindows
|
||||
# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||
IF(MINGW)
|
||||
SET(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "mwindows for MinGW")
|
||||
ENDIF(MINGW)
|
||||
# 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(SDL2_LIBRARY_TEMP)
|
||||
# For SDL2main
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(SDL2MAIN_LIBRARY)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(SDL2MAIN_LIBRARY)
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
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()
|
||||
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
IF(APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# 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)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# For MinGW library
|
||||
IF(MINGW)
|
||||
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(MINGW)
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
ENDIF(SDL2_LIBRARY_TEMP)
|
||||
|
||||
# message("</FindSDL2.cmake>")
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SDL2
|
||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
||||
VERSION_VAR SDL2_VERSION
|
||||
)
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
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)
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_FIND_ROOT_PATH}/lib)
|
||||
# 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
|
||||
)
|
||||
|
||||
IF (STK_INCLUDE_DIR AND STK_LIBRARY)
|
||||
SET(STK_FOUND TRUE)
|
||||
ENDIF (STK_INCLUDE_DIR AND STK_LIBRARY)
|
||||
# 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}/.."
|
||||
PATH_SUFFIXES share/stk/rawwaves share/libstk/rawwaves
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
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)
|
||||
|
||||
find_package_handle_standard_args(STK
|
||||
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR
|
||||
# STK doesn't appear to expose its version, so we can't pass it here
|
||||
)
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
# 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
|
||||
# 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.
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SAMPLERATE_PKG samplerate)
|
||||
endif()
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
find_path(SAMPLERATE_INCLUDE_DIR
|
||||
NAMES samplerate.h
|
||||
PATHS ${SAMPLERATE_PKG_INCLUDE_DIRS}
|
||||
find_package_config_mode_with_fallback(SampleRate SampleRate::samplerate
|
||||
LIBRARY_NAMES "samplerate" "libsamplerate" "libsamplerate-0"
|
||||
INCLUDE_NAMES "samplerate.h"
|
||||
PKG_CONFIG samplerate
|
||||
PREFIX Samplerate
|
||||
)
|
||||
|
||||
set(SAMPLERATE_NAMES samplerate libsamplerate)
|
||||
if(Samplerate_FIND_VERSION_MAJOR)
|
||||
list(APPEND SAMPLERATE_NAMES libsamplerate-${Samplerate_FIND_VERSION_MAJOR})
|
||||
else()
|
||||
list(APPEND SAMPLERATE_NAMES libsamplerate-0)
|
||||
endif()
|
||||
determine_version_from_source(Samplerate_VERSION SampleRate::samplerate [[
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <samplerate.h>
|
||||
|
||||
find_library(SAMPLERATE_LIBRARY
|
||||
NAMES ${SAMPLERATE_NAMES}
|
||||
PATHS ${SAMPLERATE_PKG_LIBRARY_DIRS}
|
||||
)
|
||||
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 DEFAULT_MSG SAMPLERATE_LIBRARY SAMPLERATE_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(SAMPLERATE_INCLUDE_DIR SAMPLERATE_LIBRARY )
|
||||
|
||||
set(SAMPLERATE_LIBRARIES ${SAMPLERATE_LIBRARY} )
|
||||
set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE_INCLUDE_DIR})
|
||||
find_package_handle_standard_args(Samplerate
|
||||
REQUIRED_VARS Samplerate_LIBRARY Samplerate_INCLUDE_DIRS
|
||||
VERSION_VAR Samplerate_VERSION
|
||||
)
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
# FindSndFile.cmake - Try to find libsndfile
|
||||
# Copyright (c) 2018 Lukas W <lukaswhl/at/gmail.com>
|
||||
# This file is MIT licensed.
|
||||
# See http://opensource.org/licenses/MIT
|
||||
# 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.
|
||||
|
||||
# Try pkgconfig for hints
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(SNDFILE_PKG sndfile)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
set(SndFile_DEFINITIONS ${SNDFILE_PKG_CFLAGS_OTHER})
|
||||
include(ImportedTargetHelpers)
|
||||
|
||||
if(WIN32)
|
||||
# Try Vcpkg
|
||||
find_package(LibSndFile ${SndFile_FIND_VERSION} CONFIG QUIET)
|
||||
if(LibSndFile_FOUND)
|
||||
get_target_property(LibSndFile_Location sndfile-shared LOCATION)
|
||||
get_target_property(LibSndFile_Include_Path sndfile-shared INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_filename_component(LibSndFile_Path LibSndFile_Location PATH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_path(SNDFILE_INCLUDE_DIR
|
||||
NAMES sndfile.h
|
||||
PATHS ${SNDFILE_PKG_INCLUDE_DIRS} ${LibSndFile_Include_Path}
|
||||
find_package_config_mode_with_fallback(SndFile SndFile::sndfile
|
||||
LIBRARY_NAMES "sndfile" "libsndfile" "libsndfile-1"
|
||||
INCLUDE_NAMES "sndfile.h"
|
||||
PKG_CONFIG sndfile
|
||||
)
|
||||
|
||||
find_library(SNDFILE_LIBRARY
|
||||
NAMES sndfile libsndfile libsndfile-1
|
||||
PATHS ${SNDFILE_PKG_LIBRARY_DIRS} ${LibSndFile_Path}
|
||||
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
|
||||
)
|
||||
|
||||
find_package(PackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SndFile DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
|
||||
|
||||
set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
|
||||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
|
||||
|
||||
mark_as_advanced(SNDFILE_LIBRARY SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIR SNDFILE_INCLUDE_DIRS)
|
||||
|
||||
@@ -24,7 +24,7 @@ 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}")
|
||||
|
||||
@@ -11,6 +11,6 @@ find_path(SOUNDIO_INCLUDE_DIR NAMES soundio/soundio.h)
|
||||
find_library(SOUNDIO_LIBRARY NAMES soundio)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SOUNDIO DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(SoundIo DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(SOUNDIO_INCLUDE_DIR SOUNDIO_LIBRARY)
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
# Once done this will define
|
||||
#
|
||||
# WINE_FOUND - System has wine
|
||||
# WINE_INCLUDE_DIRS - The wine include directories
|
||||
# WINE_LIBRARIES - The libraries needed to use wine
|
||||
# WINE_DEFINITIONS - Compiler switches required for using wine
|
||||
#
|
||||
# WINE_INCLUDE_DIR - Wine include directory
|
||||
# WINE_BUILD - Path to winebuild
|
||||
# WINE_CXX - Path to wineg++
|
||||
# WINE_GCC - Path to winegcc
|
||||
# WINE_32_LIBRARY_DIRS - Path(s) to 32-bit wine libs
|
||||
# WINE_32_FLAGS - 32-bit linker flags
|
||||
# WINE_64_LIBRARY_DIRS - Path(s) to 64-bit wine libs
|
||||
# WINE_64_FLAGS - 64-bit linker flags
|
||||
#
|
||||
|
||||
MACRO(_findwine_find_flags output expression result)
|
||||
@@ -24,17 +30,49 @@ MACRO(_regex_replace_foreach EXPRESSION REPLACEMENT RESULT INPUT)
|
||||
ENDFOREACH()
|
||||
ENDMACRO()
|
||||
|
||||
LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging /usr/lib/wine/)
|
||||
# Prefer newest wine first
|
||||
list(APPEND WINE_LOCATIONS
|
||||
/opt/wine-staging
|
||||
/opt/wine-devel
|
||||
/opt/wine-stable
|
||||
/usr/lib/wine)
|
||||
|
||||
FIND_PROGRAM(WINE_CXX
|
||||
NAMES wineg++ winegcc winegcc64 winegcc32 winegcc-stable
|
||||
PATHS /usr/lib/wine
|
||||
# Prepare bin search
|
||||
foreach(_loc ${WINE_LOCATIONS})
|
||||
if(_loc STREQUAL /usr/lib/wine)
|
||||
# /usr/lib/wine doesn't have a "bin"
|
||||
list(APPEND WINE_CXX_LOCATIONS "${_loc}")
|
||||
else()
|
||||
# expect "bin"
|
||||
list(APPEND WINE_CXX_LOCATIONS "${_loc}/bin")
|
||||
endif()
|
||||
endforeach()
|
||||
# Fallback
|
||||
list(APPEND WINE_CXX_LOCATIONS "/usr/bin")
|
||||
|
||||
# Prefer most-common to least common
|
||||
FIND_PROGRAM(WINE_CXX NAMES
|
||||
wineg++
|
||||
wineg++-stable
|
||||
PATHS
|
||||
${WINE_CXX_LOCATIONS}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
FIND_PROGRAM(WINE_BUILD NAMES winebuild)
|
||||
|
||||
FIND_PROGRAM(WINE_GCC NAMES
|
||||
winegcc
|
||||
winegcc-stable
|
||||
PATHS
|
||||
${WINE_CXX_LOCATIONS}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
FIND_PROGRAM(WINE_BUILD NAMES winebuild PATHS ${WINE_CXX_LOCATIONS} NO_DEFAULT_PATH)
|
||||
# Detect wine paths and handle linking problems
|
||||
IF(WINE_CXX)
|
||||
EXEC_PROGRAM(${WINE_CXX} ARGS "-m32 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_32)
|
||||
EXEC_PROGRAM(${WINE_CXX} ARGS "-m64 -v /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT_64)
|
||||
# call wineg++ to obtain implied includes and libs
|
||||
execute_process(COMMAND ${WINE_CXX} -m32 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_32 ERROR_QUIET)
|
||||
execute_process(COMMAND ${WINE_CXX} -m64 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_64 ERROR_QUIET)
|
||||
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem/usr/include$" BUGGED_WINEGCC)
|
||||
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem" WINEGCC_INCLUDE_DIR)
|
||||
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "libwinecrt0\\.a.*" WINECRT_32)
|
||||
@@ -43,6 +81,9 @@ IF(WINE_CXX)
|
||||
_regex_replace_foreach("/wine/windows$" "" WINE_INCLUDE_HINT "${WINE_INCLUDE_HINT}")
|
||||
STRING(REGEX REPLACE "wine/libwinecrt0\\.a.*" "" WINE_32_LIBRARY_DIR "${WINECRT_32}")
|
||||
STRING(REGEX REPLACE "wine/libwinecrt0\\.a.*" "" WINE_64_LIBRARY_DIR "${WINECRT_64}")
|
||||
# Handle winehq
|
||||
STRING(REGEX REPLACE "/libwinecrt0\\.a.*" "/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
|
||||
STRING(REGEX REPLACE "/libwinecrt0\\.a.*" "/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
|
||||
|
||||
IF(BUGGED_WINEGCC)
|
||||
MESSAGE(WARNING "Your winegcc is unusable due to https://bugs.winehq.org/show_bug.cgi?id=46293,\n
|
||||
@@ -60,16 +101,16 @@ IF(WINE_CXX)
|
||||
# WineHQ (/opt/wine-stable, /opt/wine-devel, /opt/wine-staging)
|
||||
STRING(REGEX REPLACE "/lib64/wine/$" "/lib/wine/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
|
||||
STRING(REGEX REPLACE "/lib/wine/$" "/lib64/wine/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/.*/wine/")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib32/")
|
||||
# Systems with old multilib layout
|
||||
STRING(REPLACE "/lib32/" "/lib/" WINE_64_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/.*/wine/")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib64/")
|
||||
# We need to test if the corresponding 64bit library directory is lib or lib32
|
||||
STRING(REPLACE "/lib64/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
|
||||
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
|
||||
STRING(REPLACE "/lib64/" "/lib/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
|
||||
ENDIF()
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/.*/wine/")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "/lib/")
|
||||
# Test if this directory is for 32bit or 64bit
|
||||
STRING(REPLACE "/lib/" "/lib32/" WINE_32_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
|
||||
IF(NOT EXISTS "${WINE_32_LIBRARY_DIR}")
|
||||
@@ -89,41 +130,49 @@ FIND_PATH(WINE_INCLUDE_DIR wine/exception.h
|
||||
|
||||
SET(_ARCHITECTURE ${CMAKE_LIBRARY_ARCHITECTURE})
|
||||
|
||||
FIND_LIBRARY(WINE_LIBRARY NAMES wine
|
||||
PATH_SUFFIXES wine i386-linux-gnu/wine
|
||||
HINTS "${WINE_32_LIBRARY_DIR}" "${WINE_64_LIBRARY_DIR}"
|
||||
)
|
||||
|
||||
SET(CMAKE_LIBRARY_ARCHITECTURE ${_ARCHITECTURE})
|
||||
|
||||
SET(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} )
|
||||
SET(WINE_LIBRARIES ${WINE_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_LIBRARIES WINE_INCLUDE_DIRS)
|
||||
find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)
|
||||
|
||||
IF(WINE_32_LIBRARY_DIR)
|
||||
IF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
|
||||
# winehq uses a singular lib directory
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
|
||||
ELSE()
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR}")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
|
||||
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/")
|
||||
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}wine/")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(WINE_64_LIBRARY_DIR)
|
||||
IF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
|
||||
# winehq uses a singular lib directory
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
|
||||
ELSEIF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
|
||||
ELSE()
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR}")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
|
||||
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/")
|
||||
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}wine/")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Create winegcc wrapper
|
||||
message(STATUS " WINE_INCLUDE_DIR: ${WINE_INCLUDE_DIR}")
|
||||
message(STATUS " WINE_CXX: ${WINE_CXX}")
|
||||
message(STATUS " WINE_GCC: ${WINE_GCC}")
|
||||
message(STATUS " WINE_32_FLAGS: ${WINE_32_FLAGS}")
|
||||
message(STATUS " WINE_64_FLAGS: ${WINE_64_FLAGS}")
|
||||
|
||||
# Create winegcc (technically, wineg++) wrapper
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/winegcc_wrapper.in winegcc_wrapper @ONLY)
|
||||
SET(WINEGCC "${CMAKE_CURRENT_BINARY_DIR}/winegcc_wrapper")
|
||||
|
||||
@@ -1,48 +1,80 @@
|
||||
# GenQrc.cmake - Copyright (c) 2015 Lukas W <lukaswhl/at/gmail.com>
|
||||
|
||||
# Generates a simple qrc file containing the given resource files ${ARGN}:
|
||||
# GEN_QRC(resources.qrc artwork.png icon.png PREFIX /icons)
|
||||
# Files may also be added using a pattern with the GLOB keyword, e.g.:
|
||||
# GEN_QRC(resources.qrc GLOB *.png)
|
||||
FUNCTION(GEN_QRC OUT_FILE)
|
||||
CMAKE_PARSE_ARGUMENTS(RC "" "PREFIX;GLOB" "" ${ARGN})
|
||||
|
||||
IF(DEFINED RC_GLOB)
|
||||
FILE(GLOB GLOB_FILES ${RC_GLOB})
|
||||
ENDIF()
|
||||
|
||||
# Set the standard prefix to "/" if none is given
|
||||
IF(NOT DEFINED RC_PREFIX)
|
||||
SET(RC_PREFIX "/")
|
||||
ENDIF()
|
||||
|
||||
# We need to convert our list to a string in order to pass it to the script
|
||||
# on the command line.
|
||||
STRING(REPLACE ";" "\;" FILES "${RC_UNPARSED_ARGUMENTS};${GLOB_FILES}")
|
||||
|
||||
SET(GENQRC_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/scripts/GenQrc.cmake")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${OUT_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -D OUT_FILE=${OUT_FILE} -D RC_PREFIX=${RC_PREFIX} -D FILES:list=${FILES} -D DIR=${CMAKE_CURRENT_SOURCE_DIR} -P "${GENQRC_SCRIPT}"
|
||||
DEPENDS ${GENQRC_SCRIPT}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
ENDFUNCTION()
|
||||
|
||||
# Generates a qrc file named ${QRC_OUT} from ${ARGN}, rccs it and returns Qt's
|
||||
# output file.
|
||||
# Generates a simple qrc file named ${QRC_NAME} containing the given resource
|
||||
# files ${ARGN}, rccs it, and returns Qt's output file.
|
||||
# Must only be run once per CMakeLists.txt.
|
||||
# Usage example:
|
||||
# ADD_GEN_QRC(RCC_OUTPUT resources.qrc icon.png manual.pdf)
|
||||
# ADD_EXECUTABLE(myexe main.cpp ${RCC_OUTPUT})
|
||||
MACRO(ADD_GEN_QRC RCCOUT QRC_OUT)
|
||||
IF(NOT IS_ABSOLUTE ${QRC_OUT})
|
||||
SET(QRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/${QRC_OUT}")
|
||||
ELSE()
|
||||
SET(QRC_FILE ${QRC_OUT})
|
||||
ENDIF()
|
||||
# add_gen_qrc(RCC_OUTPUT resources.qrc artwork.png icon.png PREFIX /icons)
|
||||
# add_executable(myexe main.cpp ${RCC_OUTPUT})
|
||||
# Files may also be added using a pattern with the GLOB keyword, e.g.:
|
||||
# add_gen_qrc(RCC_OUTPUT resources.qrc GLOB *.png)
|
||||
function(add_gen_qrc RCC_OUT QRC_NAME)
|
||||
cmake_parse_arguments(RC "" "PREFIX;GLOB" "" ${ARGN})
|
||||
|
||||
GEN_QRC(${QRC_FILE} "${ARGN}")
|
||||
QT5_ADD_RESOURCES(${RCCOUT} ${QRC_FILE})
|
||||
ENDMACRO()
|
||||
# Get the absolute paths for the generated files
|
||||
if(IS_ABSOLUTE "${QRC_NAME}")
|
||||
set(QRC_FILE "${QRC_NAME}")
|
||||
else()
|
||||
set(QRC_FILE "${CMAKE_CURRENT_BINARY_DIR}/${QRC_NAME}")
|
||||
endif()
|
||||
get_filename_component(RESOURCE_NAME "${QRC_FILE}" NAME_WE)
|
||||
get_filename_component(OUTPUT_DIR "${QRC_FILE}" DIRECTORY)
|
||||
set(CPP_FILE "${OUTPUT_DIR}/qrc_${RESOURCE_NAME}.cpp")
|
||||
|
||||
# Set the standard prefix to "/" if none is given
|
||||
if(NOT DEFINED RC_PREFIX)
|
||||
set(RC_PREFIX "/")
|
||||
endif()
|
||||
|
||||
# Determine input files
|
||||
set(FILES ${RC_UNPARSED_ARGUMENTS})
|
||||
if(DEFINED RC_GLOB)
|
||||
file(GLOB GLOB_FILES "${RC_GLOB}")
|
||||
list(APPEND FILES ${GLOB_FILES})
|
||||
endif()
|
||||
|
||||
# Add the command to generate the QRC file
|
||||
set(GENQRC_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/scripts/GenQrc.cmake")
|
||||
add_custom_command(
|
||||
OUTPUT "${QRC_FILE}"
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "OUT_FILE=${QRC_FILE}"
|
||||
-D "RC_PREFIX=${RC_PREFIX}"
|
||||
-D "FILES:list=${FILES}"
|
||||
-D "DIR=${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
-P "${GENQRC_SCRIPT}"
|
||||
DEPENDS "${GENQRC_SCRIPT}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Add the command to compile the QRC file
|
||||
# Note: we can't use `qt5_add_resources` or `AUTORCC` here; we have to add
|
||||
# the command ourselves instead. This is in order to handle dependencies
|
||||
# correctly: the QRC file is generated at build time, so the dependencies
|
||||
# of the compiled file can't be automatically determined at configure time.
|
||||
# Additionally, `qt5_add_resources` adds unnecessary dependencies for
|
||||
# generated QRC files, which can cause dependency cycles with some
|
||||
# generators. See issue #6177.
|
||||
add_custom_command(
|
||||
OUTPUT "${CPP_FILE}"
|
||||
COMMAND Qt5::rcc
|
||||
--name "${RESOURCE_NAME}"
|
||||
--output "${CPP_FILE}"
|
||||
"${QRC_FILE}"
|
||||
DEPENDS "${QRC_FILE}" ${FILES}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Flag the generated files to be ignored by automatic tool processing
|
||||
set_source_files_properties("${QRC_FILE}" PROPERTIES
|
||||
SKIP_AUTORCC ON # We added the rcc command for this manually
|
||||
)
|
||||
set_source_files_properties("${CPP_FILE}" PROPERTIES
|
||||
SKIP_AUTOMOC ON # The rcc output file has no need for moc or uic
|
||||
SKIP_AUTOUIC ON
|
||||
)
|
||||
|
||||
# Return the rcc output file
|
||||
set("${RCC_OUT}" "${CPP_FILE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
228
cmake/modules/ImportedTargetHelpers.cmake
Normal file
228
cmake/modules/ImportedTargetHelpers.cmake
Normal file
@@ -0,0 +1,228 @@
|
||||
# ImportedTargetHelpers.cmake - various helper functions for use in find modules.
|
||||
#
|
||||
# Copyright (c) 2022-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.
|
||||
|
||||
# If the version variable is not yet set, build the source linked to the target,
|
||||
# run it, and set the version variable to the output. Useful for libraries which
|
||||
# do not expose the version information in a header where it can be extracted
|
||||
# with regular expressions, but do provide a function to get the version.
|
||||
#
|
||||
# Usage:
|
||||
# determine_version_from_source(
|
||||
# <output variable> # The cache variable in which to store the computed version
|
||||
# <target> # The target which the source will link to
|
||||
# <source> # The source code to determine the version
|
||||
# )
|
||||
function(determine_version_from_source _version_out _target _source)
|
||||
# Return if we already know the version, or the target was not found
|
||||
if(NOT "${${_version_out}}" STREQUAL "" OR NOT TARGET "${_target}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Return with a notice if cross-compiling, since we are unlikely to be able
|
||||
# to run the compiled source
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
message(
|
||||
"${_target} was found but the version could not be determined automatically.\n"
|
||||
"Set the cache variable `${_version_out}` to the version you have installed."
|
||||
)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Write the source code to a temporary file
|
||||
string(SHA1 _source_hash "${_source}")
|
||||
set(_source_file "${CMAKE_CURRENT_BINARY_DIR}/${_source_hash}.cpp")
|
||||
file(WRITE "${_source_file}" "${_source}")
|
||||
|
||||
# Build and run the temporary file to get the version
|
||||
# TODO CMake 3.25: Use the new signature for try_run which has a NO_CACHE
|
||||
# option and doesn't require separate file management.
|
||||
try_run(
|
||||
_dvfs_run_result _dvfs_compile_result "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
SOURCES "${_source_file}"
|
||||
LINK_LIBRARIES "${_target}"
|
||||
CXX_STANDARD 17
|
||||
RUN_OUTPUT_VARIABLE _run_output
|
||||
COMPILE_OUTPUT_VARIABLE _compile_output
|
||||
)
|
||||
|
||||
# Clean up the temporary file
|
||||
file(REMOVE "${_source_file}")
|
||||
|
||||
# Set the version if the run was successful, using a cache variable since
|
||||
# this version check may be relatively expensive. Otherwise, log the error
|
||||
# and inform the user.
|
||||
if(_dvfs_run_result EQUAL "0")
|
||||
set("${_version_out}" "${_run_output}" CACHE INTERNAL "Version of ${_target}")
|
||||
else()
|
||||
message(DEBUG "${_compile_output}")
|
||||
message(
|
||||
"${_target} was found but the version could not be determined automatically.\n"
|
||||
"Set the cache variable `${_version_out}` to the version you have installed."
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Search for a package using config mode. If this fails to find the desired
|
||||
# target, use the specified fallbacks and add the target if they succeed. Set
|
||||
# the variables `prefix_LIBRARY`, `prefix_INCLUDE_DIRS`, and `prefix_VERSION`
|
||||
# if found for the caller to pass to `find_package_handle_standard_args`.
|
||||
#
|
||||
# Usage:
|
||||
# find_package_config_mode_with_fallback(
|
||||
# <package_name> # The package to search for with config mode
|
||||
# <target_name> # The target to expect from config mode, or define if not found
|
||||
# LIBRARY_NAMES names... # Possible library names to search for as a fallback
|
||||
# INCLUDE_NAMES names... # Possible header names to search for as a fallback
|
||||
# [PKG_CONFIG <pkg_config_name>] # The pkg-config name to search for as a fallback
|
||||
# [LIBRARY_HINTS hints...] # Locations to look for libraries
|
||||
# [INCLUDE_HINTS hints...] # Locations to look for headers
|
||||
# [DEPENDS dependencies...] # Dependencies of the target - added to INTERFACE_LINK_LIBRARIES, and will fail if not found
|
||||
# [PREFIX <prefix>] # The prefix for result variables - defaults to the package name
|
||||
# )
|
||||
function(find_package_config_mode_with_fallback _fpcmwf_PACKAGE_NAME _fpcmwf_TARGET_NAME)
|
||||
# Parse remaining arguments
|
||||
set(_options "")
|
||||
set(_one_value_args "PKG_CONFIG" "PREFIX")
|
||||
set(_multi_value_args "LIBRARY_NAMES" "LIBRARY_HINTS" "INCLUDE_NAMES" "INCLUDE_HINTS" "DEPENDS")
|
||||
cmake_parse_arguments(PARSE_ARGV 2 _fpcmwf "${_options}" "${_one_value_args}" "${_multi_value_args}")
|
||||
|
||||
# Compute result variable names
|
||||
if(NOT DEFINED _fpcmwf_PREFIX)
|
||||
set(_fpcmwf_PREFIX "${_fpcmwf_PACKAGE_NAME}")
|
||||
endif()
|
||||
set(_version_var "${_fpcmwf_PREFIX}_VERSION")
|
||||
set(_library_var "${_fpcmwf_PREFIX}_LIBRARY")
|
||||
set(_include_var "${_fpcmwf_PREFIX}_INCLUDE_DIRS")
|
||||
|
||||
# Try config mode if possible
|
||||
find_package("${_fpcmwf_PACKAGE_NAME}" CONFIG QUIET)
|
||||
|
||||
if(TARGET "${_fpcmwf_TARGET_NAME}")
|
||||
# Extract package details from existing target
|
||||
get_target_property("${_library_var}" "${_fpcmwf_TARGET_NAME}" LOCATION)
|
||||
get_target_property("${_include_var}" "${_fpcmwf_TARGET_NAME}" INTERFACE_INCLUDE_DIRECTORIES)
|
||||
if(DEFINED "${_fpcmwf_PACKAGE_NAME}_VERSION")
|
||||
set("${_version_var}" "${${_fpcmwf_PACKAGE_NAME}_VERSION}")
|
||||
endif()
|
||||
else()
|
||||
# Check whether the dependencies exist
|
||||
foreach(_dependency IN LISTS _fpcmwf_DEPENDS)
|
||||
if(NOT TARGET "${_dependency}")
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Attempt to find the package using pkg-config, if we have it and it was requested
|
||||
set(_pkg_config_prefix "${_fpcmwf_PKG_CONFIG}_PKG")
|
||||
if(DEFINED _fpcmwf_PKG_CONFIG)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules("${_pkg_config_prefix}" QUIET "${_fpcmwf_PKG_CONFIG}")
|
||||
if("${${_pkg_config_prefix}_FOUND}")
|
||||
set("${_version_var}" "${${_pkg_config_prefix}_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Find the library and headers using the results from pkg-config as a guide
|
||||
find_library("${_library_var}"
|
||||
NAMES ${_fpcmwf_LIBRARY_NAMES}
|
||||
HINTS ${${_pkg_config_prefix}_LIBRARY_DIRS} ${_fpcmwf_LIBRARY_HINTS}
|
||||
)
|
||||
|
||||
find_path("${_include_var}"
|
||||
NAMES ${_fpcmwf_INCLUDE_NAMES}
|
||||
HINTS ${${_pkg_config_prefix}_INCLUDE_DIRS} ${_fpcmwf_INCLUDE_HINTS}
|
||||
)
|
||||
|
||||
# Create an imported target if we succeeded in finding the package
|
||||
if(${_library_var} AND ${_include_var})
|
||||
add_library("${_fpcmwf_TARGET_NAME}" UNKNOWN IMPORTED)
|
||||
set_target_properties("${_fpcmwf_TARGET_NAME}" PROPERTIES
|
||||
IMPORTED_LOCATION "${${_library_var}}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${_include_var}}"
|
||||
INTERFACE_LINK_LIBRARIES "${_fpcmwf_DEPENDS}"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced("${_library_var}" "${_include_var}")
|
||||
endif()
|
||||
|
||||
# Return results to caller
|
||||
if(DEFINED "${_version_var}")
|
||||
set("${_version_var}" "${${_version_var}}" PARENT_SCOPE)
|
||||
else()
|
||||
unset("${_version_var}" PARENT_SCOPE)
|
||||
endif()
|
||||
set("${_library_var}" "${${_library_var}}" PARENT_SCOPE)
|
||||
set("${_include_var}" "${${_include_var}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Given a library in vcpkg, find appropriate debug and release versions. If only
|
||||
# one version exists, use it as the release version, and do not set the debug
|
||||
# version.
|
||||
#
|
||||
# Usage:
|
||||
# get_vcpkg_library_configs(
|
||||
# <release library> # Variable in which to store the path to the release version of the library
|
||||
# <debug library> # Variable in which to store the path to the debug version of the library
|
||||
# <base library> # Known path to some version of the library
|
||||
# )
|
||||
function(get_vcpkg_library_configs _release_out _debug_out _library)
|
||||
# We want to do all operations within the vcpkg directory
|
||||
file(RELATIVE_PATH _lib_relative "${VCPKG_INSTALLED_DIR}" "${_library}")
|
||||
|
||||
# Return early if we're not using vcpkg
|
||||
if(IS_ABSOLUTE _lib_relative OR _lib_relative MATCHES "^\\.\\./")
|
||||
set("${_release_out}" "${_library}" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
string(REPLACE "/" ";" _path_bits "${_lib_relative}")
|
||||
|
||||
# Determine whether we were given the debug or release version
|
||||
list(FIND _path_bits "debug" _debug_index)
|
||||
if(_debug_index EQUAL -1)
|
||||
# We have the release version, so use it
|
||||
set(_release_lib "${_library}")
|
||||
|
||||
# Try to find a debug version too
|
||||
list(FIND _path_bits "lib" _lib_index)
|
||||
if(_lib_index GREATER_EQUAL 0)
|
||||
list(INSERT _path_bits "${_lib_index}" "debug")
|
||||
list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}")
|
||||
string(REPLACE ";" "/" _debug_lib "${_path_bits}")
|
||||
|
||||
if(NOT EXISTS "${_debug_lib}")
|
||||
# Debug version does not exist - only use given version
|
||||
unset(_debug_lib)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
# We have the debug version, so try to find a release version too
|
||||
list(REMOVE_AT _path_bits "${_debug_index}")
|
||||
list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}")
|
||||
string(REPLACE ";" "/" _release_lib "${_path_bits}")
|
||||
|
||||
if(NOT EXISTS "${_release_lib}")
|
||||
# Release version does not exist - only use given version
|
||||
set(_release_lib "${_library}")
|
||||
else()
|
||||
# Release version exists, so use given version as debug
|
||||
set(_debug_lib "${_library}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set output variables appropriately
|
||||
if(_debug_lib)
|
||||
set("${_release_out}" "${_release_lib}" PARENT_SCOPE)
|
||||
set("${_debug_out}" "${_debug_lib}" PARENT_SCOPE)
|
||||
else()
|
||||
set("${_release_out}" "${_release_lib}" PARENT_SCOPE)
|
||||
unset("${_debug_out}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,8 +1,9 @@
|
||||
include(GetPrerequisites)
|
||||
include(CMakeParseArguments)
|
||||
|
||||
CMAKE_POLICY(SET CMP0011 NEW)
|
||||
CMAKE_POLICY(SET CMP0057 NEW)
|
||||
# Project's cmake_minimum_required doesn't propagate to install scripts
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0057 NEW) # Support new if() IN_LIST operator.
|
||||
|
||||
function(make_absolute var)
|
||||
get_filename_component(abs "${${var}}" ABSOLUTE BASE_DIR "${CMAKE_INSTALL_PREFIX}")
|
||||
@@ -182,3 +183,5 @@ function(FIND_PREREQUISITES target RESULT_VAR exclude_system recurse
|
||||
|
||||
set(${RESULT_VAR} ${RESULTS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
cmake_policy(POP)
|
||||
|
||||
@@ -5,9 +5,9 @@ OPTION(LMMS_MINIMAL "Build a minimal list of plug-ins" OFF)
|
||||
OPTION(LIST_PLUGINS "Lists the available plugins for building" OFF)
|
||||
|
||||
SET(MINIMAL_LIST
|
||||
audio_file_processor
|
||||
kicker
|
||||
triple_oscillator
|
||||
AudioFileProcessor
|
||||
Kicker
|
||||
TripleOscillator
|
||||
)
|
||||
|
||||
IF(LMMS_MINIMAL)
|
||||
@@ -25,51 +25,57 @@ SET(LMMS_PLUGIN_LIST
|
||||
${MINIMAL_LIST}
|
||||
Amplifier
|
||||
BassBooster
|
||||
bit_invader
|
||||
BitInvader
|
||||
Bitcrush
|
||||
carlabase
|
||||
carlapatchbay
|
||||
carlarack
|
||||
CarlaBase
|
||||
CarlaPatchbay
|
||||
CarlaRack
|
||||
Compressor
|
||||
CrossoverEQ
|
||||
Delay
|
||||
Dispersion
|
||||
DualFilter
|
||||
dynamics_processor
|
||||
DynamicsProcessor
|
||||
Eq
|
||||
Flanger
|
||||
GranularPitchShifter
|
||||
HydrogenImport
|
||||
ladspa_browser
|
||||
LadspaBrowser
|
||||
LadspaEffect
|
||||
LOMM
|
||||
Lv2Effect
|
||||
Lv2Instrument
|
||||
lb302
|
||||
Lb302
|
||||
MidiImport
|
||||
MidiExport
|
||||
MultitapEcho
|
||||
monstro
|
||||
nes
|
||||
Monstro
|
||||
Nes
|
||||
OpulenZ
|
||||
organic
|
||||
Organic
|
||||
FreeBoy
|
||||
patman
|
||||
peak_controller_effect
|
||||
Patman
|
||||
PeakControllerEffect
|
||||
GigPlayer
|
||||
ReverbSC
|
||||
sf2_player
|
||||
sfxr
|
||||
Sf2Player
|
||||
Sfxr
|
||||
Sid
|
||||
SlicerT
|
||||
SpectrumAnalyzer
|
||||
stereo_enhancer
|
||||
stereo_matrix
|
||||
stk
|
||||
vst_base
|
||||
vestige
|
||||
StereoEnhancer
|
||||
StereoMatrix
|
||||
Stk
|
||||
TapTempo
|
||||
VstBase
|
||||
Vestige
|
||||
VstEffect
|
||||
watsyn
|
||||
waveshaper
|
||||
Watsyn
|
||||
WaveShaper
|
||||
Vectorscope
|
||||
vibed
|
||||
Vibed
|
||||
Xpressive
|
||||
zynaddsubfx
|
||||
ZynAddSubFx
|
||||
)
|
||||
|
||||
IF("${PLUGIN_LIST}" STREQUAL "")
|
||||
@@ -95,13 +101,3 @@ IF(LIST_PLUGINS)
|
||||
UNSET(LIST_PLUGINS CACHE)
|
||||
LIST_ALL_PLUGINS()
|
||||
ENDIF()
|
||||
|
||||
IF(MSVC)
|
||||
SET(MSVC_INCOMPATIBLE_PLUGINS
|
||||
LadspaEffect
|
||||
zynaddsubfx
|
||||
)
|
||||
message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}")
|
||||
LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS})
|
||||
ENDIF()
|
||||
|
||||
|
||||
141
cmake/modules/StaticDependencies.cmake
Normal file
141
cmake/modules/StaticDependencies.cmake
Normal file
@@ -0,0 +1,141 @@
|
||||
# StaticDependencies.cmake - adds features similar to interface properties that
|
||||
# are only transitive over static dependencies.
|
||||
#
|
||||
# Copyright (c) 2024 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.
|
||||
|
||||
define_property(TARGET
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
BRIEF_DOCS "Compile definitions to be used by targets linking statically to this one"
|
||||
FULL_DOCS "Behaves similarly to INTERFACE_COMPILE_DEFINITIONS, but only over static dependencies."
|
||||
"Effectively becomes private once an executable module is reached."
|
||||
)
|
||||
|
||||
define_property(TARGET
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
BRIEF_DOCS "Link libraries to be included in targets linking statically to this one"
|
||||
FULL_DOCS "Behaves similarly to INTERFACE_LINK_LIBRARIES, but only over static dependencies."
|
||||
"Effectively becomes private once an executable module is reached."
|
||||
)
|
||||
|
||||
# Link a target statically to a set of libraries. Forward the given arguments to
|
||||
# `target_link_libraries`, but also perform two additional functions. Firstly,
|
||||
# ensure that the given libraries will be linked into any module that also
|
||||
# links the given target (allowing, for example, object libraries and private
|
||||
# static libraries to be used transitively). Secondly, add any static compile
|
||||
# definitions from the given libraries to the set of compile definitions used
|
||||
# to build the given target.
|
||||
#
|
||||
# This function must be used in order for static requirements as defined in this
|
||||
# module to be inherited transitively. Using `target_link_libraries` instead
|
||||
# will break the chain for static link libraries and static compile definitions.
|
||||
#
|
||||
# Usage:
|
||||
# target_static_libraries(
|
||||
# <target> # The target to which to add the libraries
|
||||
# [<PRIVATE|PUBLIC|INTERFACE>] # Optionally, the scope to use for the following libraries
|
||||
# <item>... # The libraries to which to link
|
||||
# [<PRIVATE|PUBLIC|INTERFACE> <item>...]...
|
||||
# )
|
||||
function(target_static_libraries target)
|
||||
# Target types that have a link step
|
||||
set(linked_target_types "MODULE_LIBRARY" "SHARED_LIBRARY" "EXECUTABLE")
|
||||
# Possible scopes for dependencies
|
||||
set(scopes "PRIVATE" "PUBLIC" "INTERFACE")
|
||||
|
||||
get_target_property(target_type "${target}" TYPE)
|
||||
set(scope "")
|
||||
|
||||
# Iterate over the dependencies (and possibly scopes) that we were given
|
||||
foreach(dependency IN LISTS ARGN)
|
||||
# If we have a scope, store it so we can apply it to upcoming libraries
|
||||
if(dependency IN_LIST scopes)
|
||||
set(scope "${dependency}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# Link the target to the current dependency. (Note: `${scope}` is
|
||||
# unquoted so that the argument disappears if no scope was given.)
|
||||
target_link_libraries("${target}" ${scope} "${dependency}")
|
||||
|
||||
# Store the dependency so it can be linked in with this target later
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
"${dependency}"
|
||||
)
|
||||
|
||||
# If the dependency is a target, it may have some of our custom
|
||||
# properties defined on it, so we have a bit more work to do
|
||||
if(TARGET "${dependency}")
|
||||
# Ensure it makes sense to link statically to this dependency
|
||||
get_target_property(dependency_type "${dependency}" TYPE)
|
||||
if(dependency_type IN_LIST linked_target_types)
|
||||
message(SEND_ERROR "Cannot link statically to shared module ${dependency}")
|
||||
endif()
|
||||
|
||||
# Transitively include static definitions and libraries
|
||||
set(defs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_COMPILE_DEFINITIONS>>")
|
||||
set(libs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_LINK_LIBRARIES>>")
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
"${defs}"
|
||||
)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
"${libs}"
|
||||
)
|
||||
|
||||
# Add the dependency's transitive static compile definitions.
|
||||
# (Note: definitions are private so dynamically linked dependents
|
||||
# won't pick them up; a static dependent will have them set when
|
||||
# this function is called for it.)
|
||||
target_compile_definitions("${target}" PRIVATE "${defs}")
|
||||
|
||||
# If the target has a link step, add the transitive static
|
||||
# dependencies. (Note: we use `LINK_ONLY` so the caller can still
|
||||
# control usage requirements through the normal use of scopes. Only
|
||||
# transitive dependencies are needed here: the direct dependency was
|
||||
# added earlier on. We have to append to `LINK_LIBRARIES` directly,
|
||||
# rather than use `target_link_libraries(PRIVATE)`, in order to
|
||||
# remain compatible with the scopeless signature of that command.)
|
||||
if(target_type IN_LIST linked_target_types)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY LINK_LIBRARIES
|
||||
"$<LINK_ONLY:${libs}>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Add compile definitions to a target only for use with dependents linking
|
||||
# statically to it.
|
||||
#
|
||||
# Behaves like `target_compile_definitions(INTERFACE)`, except the definitions
|
||||
# will not be inherited beyond any executable module into which the target is
|
||||
# actually linked. The definitions are added to the `STATIC_COMPILE_DEFINITIONS`
|
||||
# property on the target.
|
||||
#
|
||||
# Usage:
|
||||
# target_static_definitions(
|
||||
# <target> # The target to which to add the definitions
|
||||
# <definition>... # The definitions to add to the target
|
||||
# )
|
||||
function(target_static_definitions target)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
"${ARGN}"
|
||||
)
|
||||
endfunction()
|
||||
@@ -3,6 +3,13 @@ IF(GIT_FOUND AND NOT FORCE_VERSION)
|
||||
SET(MAJOR_VERSION 0)
|
||||
SET(MINOR_VERSION 0)
|
||||
SET(PATCH_VERSION 0)
|
||||
|
||||
# If this is a GitHub Actions pull request build, get the pull request
|
||||
# number from the environment and add it to the build metadata
|
||||
if("$ENV{GITHUB_REF}" MATCHES "refs/pull/([0-9]+)/merge")
|
||||
list(APPEND BUILD_METADATA "pr${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
|
||||
# Look for git tag information (e.g. Tagged: "v1.0.0", Untagged: "v1.0.0-123-a1b2c3d")
|
||||
# Untagged format: [latest tag]-[number of commits]-[latest commit hash]
|
||||
EXECUTE_PROCESS(
|
||||
@@ -30,28 +37,43 @@ IF(GIT_FOUND AND NOT FORCE_VERSION)
|
||||
ENDIF()
|
||||
# 1 dash total: Dash in latest tag, no additional commits => pre-release
|
||||
IF(TAG_LIST_LENGTH EQUAL 2)
|
||||
# Get the pre-release stage
|
||||
LIST(GET TAG_LIST 1 VERSION_STAGE)
|
||||
SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}")
|
||||
list(APPEND PRERELEASE_DATA "${VERSION_STAGE}")
|
||||
# 2 dashes: Assume untagged with no dashes in latest tag name => stable + commits
|
||||
ELSEIF(TAG_LIST_LENGTH EQUAL 3)
|
||||
# Get the number of commits and latest commit hash
|
||||
LIST(GET TAG_LIST 1 EXTRA_COMMITS)
|
||||
LIST(GET TAG_LIST 2 COMMIT_HASH)
|
||||
# Bump the patch version
|
||||
list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}")
|
||||
list(APPEND BUILD_METADATA "${COMMIT_HASH}")
|
||||
# Bump the patch version, since a pre-release (as specified by the extra
|
||||
# commits) compares lower than the main version alone
|
||||
MATH(EXPR PATCH_VERSION "${PATCH_VERSION}+1")
|
||||
# Set the version to MAJOR.MINOR.PATCH-EXTRA_COMMITS+COMMIT_HASH
|
||||
SET(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
SET(FORCE_VERSION "${FORCE_VERSION}-${EXTRA_COMMITS}+${COMMIT_HASH}")
|
||||
# Reassemble the main version using the new patch version
|
||||
set(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
# 3 dashes: Assume untagged with 1 dash in latest tag name => pre-release + commits
|
||||
ELSEIF(TAG_LIST_LENGTH EQUAL 4)
|
||||
# Get pre-release stage, number of commits, and latest commit hash
|
||||
# Get the pre-release stage, number of commits, and latest commit hash
|
||||
LIST(GET TAG_LIST 1 VERSION_STAGE)
|
||||
LIST(GET TAG_LIST 2 EXTRA_COMMITS)
|
||||
LIST(GET TAG_LIST 3 COMMIT_HASH)
|
||||
# Set the version to MAJOR.MINOR.PATCH-VERSION_STAGE.EXTRA_COMMITS+COMMIT_HASH
|
||||
SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}")
|
||||
SET(FORCE_VERSION "${FORCE_VERSION}.${EXTRA_COMMITS}+${COMMIT_HASH}")
|
||||
list(APPEND PRERELEASE_DATA "${VERSION_STAGE}")
|
||||
list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}")
|
||||
list(APPEND BUILD_METADATA "${COMMIT_HASH}")
|
||||
ENDIF()
|
||||
|
||||
# If there is any pre-release data, append it after a hyphen
|
||||
if(PRERELEASE_DATA)
|
||||
string(REPLACE ";" "." PRERELEASE_DATA "${PRERELEASE_DATA}")
|
||||
set(FORCE_VERSION "${FORCE_VERSION}-${PRERELEASE_DATA}")
|
||||
endif()
|
||||
|
||||
# If there is any build metadata, append it after a plus
|
||||
if(BUILD_METADATA)
|
||||
string(REPLACE ";" "." BUILD_METADATA "${BUILD_METADATA}")
|
||||
set(FORCE_VERSION "${FORCE_VERSION}+${BUILD_METADATA}")
|
||||
endif()
|
||||
ENDIF()
|
||||
|
||||
IF(FORCE_VERSION STREQUAL "internal")
|
||||
|
||||
@@ -49,8 +49,9 @@ extra_args="-I@WINE_INCLUDE_DIR@ -I@WINE_INCLUDE_DIR@/wine/windows"
|
||||
extra_args="$extra_args @WINE_CXX_FLAGS@"
|
||||
|
||||
# Apply -m32 library fix if necessary
|
||||
# Additionally, apply "-z notext" to fix an inconsistency in ld.lld vs ld.bfd and ld.gold
|
||||
if [ "$win32" = true ] && [ "$no_link" != true ]; then
|
||||
extra_args="$extra_args @WINE_32_FLAGS@"
|
||||
extra_args="$extra_args @WINE_32_FLAGS@ -z notext"
|
||||
fi
|
||||
|
||||
# Apply -m64 library fix if necessary
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
ppa_dir=./ppa/
|
||||
|
||||
pushd $ppa_dir
|
||||
|
||||
for f in *.deb; do
|
||||
echo "Extracting $f..."
|
||||
ar xv "$f"
|
||||
rm debian-binary
|
||||
rm control.tar.*
|
||||
tar xf data.tar.* --exclude=*mingw*/bin/fluid
|
||||
rm data.tar.*
|
||||
done
|
||||
|
||||
popd
|
||||
|
||||
echo "Your extracted files should be located in $ppa_dir"
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Trusty=14.04, Precise=12.04
|
||||
PPA_DISTRO=trusty
|
||||
|
||||
# Architecture=i386, amd64
|
||||
PPA_ARCH=amd64
|
||||
|
||||
# These shouldn't change
|
||||
PPA_HOST=http://ppa.launchpad.net
|
||||
PPA_USER=tobydox
|
||||
PPA_PROJECT=mingw-x-trusty
|
||||
PPA_ROOT=$PPA_HOST/$PPA_USER/$PPA_PROJECT/ubuntu
|
||||
|
||||
PPA_URL=$PPA_ROOT/dists/$PPA_DISTRO/main/binary-$PPA_ARCH/Packages.gz
|
||||
|
||||
ppa_dir=./ppa/
|
||||
|
||||
temp_file=/tmp/ppa_listing_$$
|
||||
temp_temp_file=/tmp/ppa_listing_temp_$$
|
||||
|
||||
skip_files="binutils openssl flac libgig libogg libvorbis x-bootstrap zlib"
|
||||
skip_files="$skip_files x-runtime gcc qt_4 qt5 x-stk pkgconfig"
|
||||
skip_files="$skip_files glib2 libpng"
|
||||
|
||||
echo "Connecting to $PPA_URL to get list of packages..."
|
||||
wget -qO- $PPA_URL | gzip -d -c | grep "Filename:" > $temp_file
|
||||
|
||||
for j in $skip_files ; do
|
||||
grep -v "$j" $temp_file > $temp_temp_file
|
||||
mv $temp_temp_file $temp_file
|
||||
done
|
||||
|
||||
line_count=$(wc -l $temp_file |awk '{print $1}')
|
||||
|
||||
echo "Found $line_count packages for download..."
|
||||
|
||||
echo "Downloading packages. They will be saved to $ppa_dir"
|
||||
|
||||
mkdir $ppa_dir
|
||||
|
||||
while read -r j
|
||||
do
|
||||
echo "Downloading $j..."
|
||||
echo "$PPA_ROOT/$j"
|
||||
wget -qO "$ppa_dir$(basename "$j")" "$(echo "$PPA_ROOT/$j" | sed 's/\/Filename: /\//gi')"
|
||||
done < $temp_file
|
||||
|
||||
|
||||
echo "Cleaning up temporary files..."
|
||||
rm -rf $temp_file
|
||||
|
||||
echo "Packages have been saved to $ppa_dir. Please run extract_debs.sh"
|
||||
@@ -1,226 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
# Git repo information
|
||||
fork="lmms" # i.e. "lmms" or "tobydox"
|
||||
branch="master" # i.e. "master" or "stable-1.2"
|
||||
|
||||
# Console colors
|
||||
red="\\x1B[1;31m"
|
||||
green="\\x1B[1;32m"
|
||||
yellow="\\x1B[1;33m"
|
||||
plain="\\x1B[0m"
|
||||
|
||||
function info() { echo -e "\n${green}$1${plain}"; }
|
||||
function warn() { echo -e "\n${yellow}$1${plain}"; }
|
||||
function err() { echo -e "\n${red}$1${plain}"; exit 1;}
|
||||
|
||||
info "Checking for mingw environment"
|
||||
if ! env | grep MINGW; then
|
||||
err " - Failed. Please relaunch using MinGW shell"
|
||||
fi
|
||||
|
||||
info "Preparing the git directory..."
|
||||
mkdir "$HOME/.git" || true
|
||||
touch "$HOME/.git/config" > /dev/null 2>&1
|
||||
git config --global http.sslverify false
|
||||
|
||||
info "Cloning the repository..."
|
||||
if [ -d ./lmms ]; then
|
||||
warn " - Skipping, ./lmms already exists"
|
||||
else
|
||||
git clone -b $branch https://github.com/$fork/lmms.git
|
||||
fi
|
||||
|
||||
info "Fetching ppa using cmake/msys/fetch_ppas.sh..."
|
||||
if [ -d "$HOME/ppa" ]; then
|
||||
warn " - Skipping, $HOME/ppa already exists"
|
||||
else
|
||||
lmms/cmake/msys/fetch_ppa.sh
|
||||
fi
|
||||
|
||||
info "Extracting debs to $HOME/ppa/opt/, etc..."
|
||||
if [ -d "$HOME/ppa/opt" ]; then
|
||||
warn " - Skipping, $HOME/ppa/opt already exists"
|
||||
else
|
||||
lmms/cmake/msys/extract_debs.sh
|
||||
fi
|
||||
|
||||
info "Preparing library merge, making all qt headers writable..."
|
||||
chmod u+w /mingw64/include/qt4 -R
|
||||
chmod u+w /mingw32/include/qt4 -R
|
||||
|
||||
info "Merging mingw headers and libraries from ppa over existing system libraries..."
|
||||
if ! find /mingw64 | grep sndfile.h; then
|
||||
command cp -r "$HOME/ppa/opt/mingw"* /
|
||||
else
|
||||
warn " - Skipping, sndfile.h has already been merged"
|
||||
fi
|
||||
|
||||
fltkver="1.3.3"
|
||||
oggver="1.3.2"
|
||||
vorbisver="1.3.5"
|
||||
flacver="1.3.2"
|
||||
gigver="4.0.0"
|
||||
stkver="4.5.1"
|
||||
|
||||
mingw_root="/$(echo "$MSYSTEM"|tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
info "Downloading and building fltk $fltkver"
|
||||
if ! command -v fluid; then
|
||||
wget http://fltk.org/pub/fltk/$fltkver/fltk-$fltkver-source.tar.gz -O "$HOME/fltk-source.tar.gz"
|
||||
tar zxf "$HOME/fltk-source.tar.gz" -C "$HOME/"
|
||||
pushd "$HOME/fltk-$fltkver"
|
||||
|
||||
info " - Compiling fltk $fltkver..."
|
||||
./configure --prefix="$mingw_root" --enable-shared
|
||||
make
|
||||
|
||||
info " - Installing fltk..."
|
||||
make install
|
||||
|
||||
# ln -s $mingw_root/usr/local/bin/fluid.exe $mingw_root/bin/fluid.exe
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, fluid binary already exists"
|
||||
fi
|
||||
|
||||
info "Downloading and building libogg $oggver"
|
||||
if [ ! -e "$mingw_root/lib/libogg.dll.a" ]; then
|
||||
wget http://downloads.xiph.org/releases/ogg/libogg-$oggver.tar.xz -O "$HOME/libogg-source.tar.xz"
|
||||
tar xf "$HOME/libogg-source.tar.xz" -C "$HOME/"
|
||||
pushd "$HOME/libogg-$oggver"
|
||||
|
||||
info " - Compiling libogg $oggver..."
|
||||
./configure --prefix="$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing libogg..."
|
||||
make install
|
||||
# for some reason libgig needs this
|
||||
./configure --prefix="/opt$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing libogg..."
|
||||
make install
|
||||
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, libogg binary already exists"
|
||||
fi
|
||||
|
||||
info "Downloading and building libvorbis $vorbisver"
|
||||
if [ ! -e "$mingw_root/lib/libvorbis.dll.a" ]; then
|
||||
wget http://downloads.xiph.org/releases/vorbis/libvorbis-$vorbisver.tar.xz -O "$HOME/libvorbis-source.tar.xz"
|
||||
tar xf "$HOME/libvorbis-source.tar.xz" -C "$HOME/"
|
||||
pushd "$HOME/libvorbis-$vorbisver"
|
||||
|
||||
info " - Compiling libvorbis $vorbisver..."
|
||||
./configure --prefix="$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing libvorbis..."
|
||||
make install
|
||||
|
||||
# for some reason libgig needs this
|
||||
./configure --prefix="/opt$mingw_root"
|
||||
make
|
||||
info " - Installing libvorbis..."
|
||||
make install
|
||||
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, libvorbis binary already exists"
|
||||
fi
|
||||
|
||||
info "Downloading and building flac $flacver"
|
||||
|
||||
if [ ! -e "$mingw_root/lib/libFLAC.dll.a" ]; then
|
||||
|
||||
wget http://downloads.xiph.org/releases/flac/flac-$flacver.tar.xz -O "$HOME/flac-source.tar.xz"
|
||||
tar xf "$HOME/flac-source.tar.xz" -C "$HOME/"
|
||||
pushd "$HOME/flac-$flacver"
|
||||
|
||||
info " - Compiling flac $flacver..."
|
||||
./configure --prefix="$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing flac..."
|
||||
make install
|
||||
|
||||
# for some reason libgig needs this
|
||||
./configure --prefix="/opt$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing flac..."
|
||||
make install
|
||||
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, libvorbis flac already exists"
|
||||
fi
|
||||
|
||||
info "Downloading and building libgig $gigver"
|
||||
|
||||
if [ ! -e "$mingw_root/lib/libgig/libgig.dll.a" ]; then
|
||||
wget http://download.linuxsampler.org/packages/libgig-$gigver.tar.bz2 -O "$HOME/gig-source.tar.xz"
|
||||
tar xf "$HOME/gig-source.tar.xz" -C "$HOME/"
|
||||
pushd "$HOME/libgig-$gigver"
|
||||
|
||||
info " - Compiling libgig $gigver..."
|
||||
./configure --prefix="$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing libgig..."
|
||||
make install
|
||||
|
||||
mv "$mingw_root/lib/bin/libakai-0.dll" "$mingw_root/bin"
|
||||
mv "$mingw_root/lib/bin/libgig-7.dll" "$mingw_root/bin"
|
||||
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, libgig binary already exists"
|
||||
fi
|
||||
|
||||
info "Downloading and building stk $stkver"
|
||||
|
||||
if [ ! -e "$mingw_root/lib/libstk.dll" ]; then
|
||||
wget http://ccrma.stanford.edu/software/stk/release/stk-$stkver.tar.gz -O "$HOME/stk-source.tar.xz"
|
||||
tar xf "$HOME/stk-source.tar.xz" -C "$HOME/"
|
||||
pushd "$HOME/stk-$stkver"
|
||||
|
||||
info " - Compiling stk $stkver..."
|
||||
./configure --prefix="$mingw_root"
|
||||
make
|
||||
|
||||
info " - Installing stk..."
|
||||
make install
|
||||
|
||||
mv "$mingw_root/lib/libstk.so" "$mingw_root/lib/libstk.dll"
|
||||
mv "$mingw_root/lib/libstk-$stkver.so" "$mingw_root/lib/libstk-$stkver.dll"
|
||||
|
||||
popd
|
||||
else
|
||||
warn " - Skipping, stk binary already exists"
|
||||
fi
|
||||
|
||||
# make a symlink to make cmake happy
|
||||
if [ "$mingw_root" = "/mingw64" ]; then
|
||||
if [ ! -e /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config ]; then
|
||||
ln -s /usr/bin/pkg-config /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config
|
||||
fi
|
||||
elif [ "$mingw_root" = "/mingw32" ]; then
|
||||
if [ ! -e /opt/mingw32/bin/i686-w64-mingw32-pkg-config ]; then
|
||||
ln -s /usr/bin/pkg-config /opt/mingw32/bin/i686-w64-mingw32-pkg-config
|
||||
fi
|
||||
fi
|
||||
|
||||
info "Cleaning up..."
|
||||
rm -rf "$HOME/fltk-$fltkver"
|
||||
rm -rf "$HOME/libogg-$oggver"
|
||||
rm -rf "$HOME/libvorbis-$vorbisver"
|
||||
rm -rf "$HOME/flac-$flacver"
|
||||
rm -rf "$HOME/libgig-$gigver"
|
||||
rm -rf "$HOME/stk-$stkver"
|
||||
info "Done."
|
||||
@@ -3,10 +3,9 @@ if(LMMS_MSVC_YEAR)
|
||||
SET(WIN_PLATFORM "msvc${LMMS_MSVC_YEAR}")
|
||||
endif()
|
||||
|
||||
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/nsis_branding.bmp")
|
||||
IF(MSVC)
|
||||
STRING(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON})
|
||||
ENDIF(MSVC)
|
||||
# the final slash needs to be flipped for CPACK_PACKAGE_ICON to work:
|
||||
# https://cmake.org/pipermail/cmake/2008-June/022085.html
|
||||
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\nsis_branding.bmp")
|
||||
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/icon.ico")
|
||||
SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe" PARENT_SCOPE)
|
||||
SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME_UCASE} ${VERSION}" PARENT_SCOPE)
|
||||
@@ -44,25 +43,6 @@ IF(WIN64)
|
||||
")
|
||||
ENDIF()
|
||||
|
||||
# Fix windows paths for msys
|
||||
IF(LMMS_BUILD_MSYS)
|
||||
STRING(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON "${CPACK_PACKAGE_ICON}")
|
||||
STRING(REPLACE "/" "\\\\" CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}")
|
||||
STRING(REPLACE "/" "\\\\" CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}")
|
||||
STRING(REPLACE "/" "\\\\" CMAKE_BINARY_DIR_FIX "${CMAKE_BINARY_DIR}")
|
||||
|
||||
# FIXME: there's no easy way to fix $INST_DIR, so we'll redefine it manually
|
||||
IF(WIN64)
|
||||
SET(NSIS_ARCH "win64")
|
||||
ELSE()
|
||||
SET(NSIS_ARCH "win32")
|
||||
ENDIF()
|
||||
SET(CPACK_NSIS_DEFINES "
|
||||
${CPACK_NSIS_DEFINES}
|
||||
!define /redef INST_DIR ${CMAKE_BINARY_DIR_FIX}\\\\_CPack_Packages\\\\${NSIS_ARCH}\\\\NSIS\\\\${CPACK_PACKAGE_FILE_NAME}
|
||||
")
|
||||
ENDIF()
|
||||
|
||||
# Setup missing parent scopes
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
|
||||
SET(CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}" PARENT_SCOPE)
|
||||
@@ -71,13 +51,7 @@ SET(CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}" PARENT_SCOPE)
|
||||
|
||||
# Windows resource compilers
|
||||
CONFIGURE_FILE("lmms.rc.in" "${CMAKE_BINARY_DIR}/lmms.rc")
|
||||
CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/zynaddsubfx/zynaddsubfx.rc")
|
||||
|
||||
IF(LMMS_HAVE_STK)
|
||||
FILE(GLOB RAWWAVES "${MINGW_PREFIX}/share/stk/rawwaves/*.raw")
|
||||
LIST(SORT RAWWAVES)
|
||||
INSTALL(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
|
||||
ENDIF()
|
||||
CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/ZynAddSubFx/zynaddsubfx.rc")
|
||||
|
||||
INSTALL(FILES "lmms.exe.manifest" DESTINATION .)
|
||||
INSTALL(FILES "lmms.VisualElementsManifest.xml" DESTINATION .)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win32.cmake)
|
||||
|
||||
SET(MINGW_PREFIX /mingw32)
|
||||
@@ -1,5 +0,0 @@
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win64.cmake)
|
||||
|
||||
SET(MINGW_PREFIX /mingw64)
|
||||
SET(MINGW_PREFIX32 /mingw32)
|
||||
6
cmake/toolchains/MinGW-W64-32.cmake
Normal file
6
cmake/toolchains/MinGW-W64-32.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
set(WIN64 FALSE)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)
|
||||
9
cmake/toolchains/MinGW-W64-64.cmake
Normal file
9
cmake/toolchains/MinGW-W64-64.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
set(WIN64 TRUE)
|
||||
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
set(CMAKE_SYSTEM_PROCESSOR32 i686)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/MinGW-W64-32.cmake")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)
|
||||
@@ -1,2 +0,0 @@
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win32.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-W64.cmake)
|
||||
@@ -1,4 +0,0 @@
|
||||
SET(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/Ubuntu-MinGW-W64-32.cmake")
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win64.cmake)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-W64.cmake)
|
||||
@@ -1,3 +0,0 @@
|
||||
SET(MINGW_PREFIX /opt/mingw32)
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-X-Trusty.cmake)
|
||||
@@ -1,9 +0,0 @@
|
||||
SET(MINGW_PREFIX /opt/mingw64)
|
||||
SET(MINGW_PREFIX32 /opt/mingw32)
|
||||
|
||||
SET(WIN64 TRUE)
|
||||
|
||||
SET(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/Ubuntu-MinGW-X-Trusty-32.cmake")
|
||||
SET(CMAKE_PREFIX_PATH_32 "${MINGW_PREFIX32}")
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-X-Trusty.cmake)
|
||||
@@ -1,22 +0,0 @@
|
||||
# The target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
|
||||
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX})
|
||||
|
||||
# Windows msys mingw ships with a mostly-suitable preconfigured environment
|
||||
SET(STRIP ${MINGW_PREFIX}/bin/strip)
|
||||
SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}/bin/windres)
|
||||
SET(CMAKE_C_COMPILER ${MINGW_PREFIX}/bin/gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}/bin/g++)
|
||||
|
||||
# For 32-bit vst support
|
||||
IF(WIN64)
|
||||
# Specify the 32-bit cross compiler
|
||||
SET(CMAKE_C_COMPILER32 ${MINGW_PREFIX32}/bin/gcc)
|
||||
SET(CMAKE_CXX_COMPILER32 ${MINGW_PREFIX32}/bin/g++)
|
||||
ENDIF()
|
||||
|
||||
# Msys compiler does not support @CMakeFiles/Include syntax
|
||||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
|
||||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
|
||||
|
||||
SET(LMMS_BUILD_MSYS 1)
|
||||
24
cmake/toolchains/common/MinGW-W64.cmake
Normal file
24
cmake/toolchains/common/MinGW-W64.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
# Toolchain for MinGW compiler
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32)
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
set(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)
|
||||
|
||||
if(WIN64)
|
||||
set(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
|
||||
set(CMAKE_C_COMPILER32 ${TOOLCHAIN_PREFIX32}-gcc)
|
||||
set(CMAKE_CXX_COMPILER32 ${TOOLCHAIN_PREFIX32}-g++)
|
||||
endif()
|
||||
|
||||
# Search for programs in the build host directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# Search for libraries and headers in the target directories
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
@@ -1,17 +0,0 @@
|
||||
# Toolchain for Ubuntu MinGw compiler shipped with the mingw-w64 and
|
||||
# g++-mingw-w64 packages
|
||||
SET(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32)
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
SET(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)
|
||||
|
||||
IF(WIN64)
|
||||
SET(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
|
||||
SET(CMAKE_C_COMPILER32 ${TOOLCHAIN_PREFIX32}-gcc)
|
||||
SET(CMAKE_CXX_COMPILER32 ${TOOLCHAIN_PREFIX32}-g++)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/WinCrossCompile.cmake)
|
||||
@@ -1,58 +0,0 @@
|
||||
IF(WIN64)
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/Win64.cmake)
|
||||
ELSE()
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/Win32.cmake)
|
||||
ENDIF()
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/WinCrossCompile.cmake)
|
||||
|
||||
# The target environment
|
||||
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
|
||||
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX})
|
||||
|
||||
# Linux mingw requires explicitly defined tools to prevent clash with native system tools
|
||||
SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)
|
||||
|
||||
# Specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++)
|
||||
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres)
|
||||
|
||||
# Mingw tools
|
||||
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
|
||||
SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config)
|
||||
|
||||
# For 32-bit vst support
|
||||
IF(WIN64)
|
||||
# Specify the 32-bit cross compiler
|
||||
SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-)
|
||||
SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc)
|
||||
SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include)
|
||||
|
||||
LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin)
|
||||
|
||||
# Qt tools
|
||||
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin)
|
||||
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
|
||||
|
||||
# Echo modified cmake vars to screen for debugging purposes
|
||||
IF(NOT DEFINED ENV{MINGW_DEBUG_INFO})
|
||||
MESSAGE("")
|
||||
MESSAGE("Custom cmake vars: (blank = system default)")
|
||||
MESSAGE("-----------------------------------------")
|
||||
MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
|
||||
MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}")
|
||||
MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}")
|
||||
MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
|
||||
MESSAGE("* MINGW_TOOL_PREFIX32 : ${MINGW_TOOL_PREFIX32}")
|
||||
MESSAGE("* CMAKE_C_COMPILER32 : ${CMAKE_C_COMPILER32}")
|
||||
MESSAGE("* CMAKE_CXX_COMPILER32 : ${CMAKE_CXX_COMPILER32}")
|
||||
MESSAGE("* STRIP : ${STRIP}")
|
||||
MESSAGE("* QT_BINARY_DIR : ${QT_BINARY_DIR}")
|
||||
MESSAGE("* QT_QMAKE_EXECUTABLE : ${QT_QMAKE_EXECUTABLE}")
|
||||
MESSAGE("")
|
||||
# So that the debug info only appears once
|
||||
SET(ENV{MINGW_DEBUG_INFO} SHOWN)
|
||||
ENDIF()
|
||||
@@ -1,6 +0,0 @@
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
|
||||
SET(WIN64 FALSE)
|
||||
@@ -1,7 +0,0 @@
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
SET(CMAKE_SYSTEM_PROCESSOR32 i686)
|
||||
|
||||
SET(WIN64 TRUE)
|
||||
@@ -1,9 +0,0 @@
|
||||
# Required by cmake if `uname -s` is inadaquate
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
# Search for programs in the build host directories
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
# For libraries and headers in the target directories
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user