├── .github ├── .gitignore ├── workflows │ └── c-cpp.yml └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── .llvmenv ├── logo.png ├── src └── main.cpp ├── .clang-format ├── .gitignore ├── juce ├── JuceLibraryCode │ ├── include_juce_core.mm │ ├── include_juce_core.cpp │ ├── include_juce_events.cpp │ ├── include_juce_events.mm │ ├── include_juce_opengl.cpp │ ├── include_juce_opengl.mm │ ├── include_juce_graphics.cpp │ ├── include_juce_graphics.mm │ ├── include_juce_gui_extra.mm │ ├── include_juce_gui_basics.cpp │ ├── include_juce_gui_basics.mm │ ├── include_juce_gui_extra.cpp │ ├── include_juce_audio_basics.mm │ ├── include_juce_audio_utils.cpp │ ├── include_juce_audio_utils.mm │ ├── include_juce_cryptography.mm │ ├── include_juce_audio_basics.cpp │ ├── include_juce_audio_devices.cpp │ ├── include_juce_audio_devices.mm │ ├── include_juce_audio_formats.cpp │ ├── include_juce_audio_formats.mm │ ├── include_juce_cryptography.cpp │ ├── include_juce_data_structures.cpp │ ├── include_juce_data_structures.mm │ ├── include_juce_audio_processors.cpp │ ├── include_juce_audio_processors.mm │ ├── ReadMe.txt │ ├── JuceHeader.h │ └── AppConfig.h ├── Builds │ ├── CodeBlocksWindows │ │ └── resources.rc │ ├── VisualStudio2019 │ │ ├── resources.rc │ │ └── tgtracker.sln │ └── LinuxMakefile │ │ └── Makefile ├── Source │ ├── MainComponent.h │ ├── MainComponent.cpp │ └── Main.cpp └── tgtracker.jucer ├── justfile ├── .vscode ├── tasks.json ├── c_cpp_properties.json ├── launch.json └── settings.json ├── scripts ├── getdeps.sh └── builddeps.sh ├── .travis.yml ├── README.md ├── cmake └── modules │ ├── UsePkgConfig.cmake │ ├── FindAlsa.cmake │ ├── FindQt.cmake │ ├── FindThreads.cmake │ ├── FindLua.cmake │ ├── InstallRequiredSystemLibraries.cmake │ ├── FindPkgConfig.cmake │ └── GetPrerequisites.cmake ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md └── LICENSE.md /.github/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.llvmenv: -------------------------------------------------------------------------------- 1 | system -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tonal-glyph/tgtracker/HEAD/logo.png -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int, char **) { 4 | std::cout << "Hello, world!\n"; 5 | } 6 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | IndentWidth: 4 2 | AccessModifierOffset: -2 3 | UseTab: Never 4 | ColumnLimit: 0 5 | NamespaceIndentation: All 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.a 2 | **/*.chug 3 | **/*.d 4 | **/.deps 5 | **/*.o 6 | **/*.so* 7 | build 8 | *.code-workspace 9 | .dist 10 | .vscode/browse.vc.* 11 | 3rdparty/**/* -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_core.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_core.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_events.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_events.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_opengl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_opengl.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_graphics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_graphics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_gui_extra.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_gui_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_gui_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_gui_extra.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_basics.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_utils.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_cryptography.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_basics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_devices.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_devices.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_formats.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_formats.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_cryptography.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_data_structures.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_data_structures.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_processors.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/include_juce_audio_processors.mm: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | */ 7 | 8 | #include "AppConfig.h" 9 | #include 10 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | #build 2 | build: 3 | @cmake -Wnodev -B build/ -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang . && /usr/bin/ninja -C build 4 | #clean project 5 | clean: 6 | @rm -rf build/* .dist 7 | @rm -rf 3rdparty/* 8 | #delete logs 9 | dlog: 10 | @rm -v **/*.log 11 | #get deps 12 | getd: 13 | @bash scripts/getdeps.sh 14 | @bash scripts/builddeps.sh 15 | #kill running chuck vms 16 | killck: 17 | @sudo killall chuck 18 | #run tokei 19 | toke: 20 | @tokei 21 | # Local Variables: 22 | # mode: makefile 23 | # End: 24 | # vim: set ft=make : 25 | -------------------------------------------------------------------------------- /.github/workflows/c-cpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: install apt packages 17 | run: sudo apt install gcc-7 g++-7 chuck cmake faust libasound2-dev liblo-dev libpulse-dev libsamplerate0-dev librtaudio-dev librtmidi-dev libsndfile1-dev ninja-build 18 | - name: run cmake 19 | run: cmake -GNinja . 20 | - name: run ninja 21 | run: ninja 22 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "build", 8 | "type": "shell", 9 | "command": "cd build;rm -rf * .*;cmake -GNinja ..;/usr/bin/ninja;/usr/bin/ninja -t compdb > compile_commands.json" 10 | }, 11 | { 12 | "label": "clean", 13 | "type": "shell", 14 | "command": "rm -rf ${workspaceFolder}/build/*;rm -rf ${workspaceFolder}/build/.*;rm -rf ${workspaceFolder}/3rdparty/*" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /juce/JuceLibraryCode/ReadMe.txt: -------------------------------------------------------------------------------- 1 | 2 | Important Note!! 3 | ================ 4 | 5 | The purpose of this folder is to contain files that are auto-generated by the Projucer, 6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever 7 | the Projucer saves your project. 8 | 9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to 10 | put any of your own files in here if you don't want to lose them. (Of course you may choose 11 | to add the folder's contents to your version-control system so that you can re-merge your own 12 | modifications after the Projucer has saved its changes). 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | --- 5 | 6 | **Is your feature request related to a problem? Please describe.** 7 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 8 | 9 | **Describe the solution you'd like** 10 | A clear and concise description of what you want to happen. 11 | 12 | **Describe alternatives you've considered** 13 | A clear and concise description of any alternative solutions or features you've considered. 14 | 15 | **Additional context** 16 | Add any other context or screenshots about the feature request here. 17 | -------------------------------------------------------------------------------- /juce/Builds/CodeBlocksWindows/resources.rc: -------------------------------------------------------------------------------- 1 | #ifdef JUCE_USER_DEFINED_RC_FILE 2 | #include JUCE_USER_DEFINED_RC_FILE 3 | #else 4 | 5 | #undef WIN32_LEAN_AND_MEAN 6 | #define WIN32_LEAN_AND_MEAN 7 | #include 8 | 9 | VS_VERSION_INFO VERSIONINFO 10 | FILEVERSION 0,1,0-alpha,0 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904E4" 15 | BEGIN 16 | VALUE "CompanyName", "tonal glyph\0" 17 | VALUE "LegalCopyright", "(C) 2020 tonal glyph\0" 18 | VALUE "FileDescription", "tgtracker\0" 19 | VALUE "FileVersion", "0.1.0-alpha\0" 20 | VALUE "ProductName", "tgtracker\0" 21 | VALUE "ProductVersion", "0.1.0-alpha\0" 22 | END 23 | END 24 | 25 | BLOCK "VarFileInfo" 26 | BEGIN 27 | VALUE "Translation", 0x409, 1252 28 | END 29 | END 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /juce/Builds/VisualStudio2019/resources.rc: -------------------------------------------------------------------------------- 1 | #ifdef JUCE_USER_DEFINED_RC_FILE 2 | #include JUCE_USER_DEFINED_RC_FILE 3 | #else 4 | 5 | #undef WIN32_LEAN_AND_MEAN 6 | #define WIN32_LEAN_AND_MEAN 7 | #include 8 | 9 | VS_VERSION_INFO VERSIONINFO 10 | FILEVERSION 0,1,0-alpha,0 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904E4" 15 | BEGIN 16 | VALUE "CompanyName", "tonal glyph\0" 17 | VALUE "LegalCopyright", "(C) 2020 tonal glyph\0" 18 | VALUE "FileDescription", "tgtracker\0" 19 | VALUE "FileVersion", "0.1.0-alpha\0" 20 | VALUE "ProductName", "tgtracker\0" 21 | VALUE "ProductVersion", "0.1.0-alpha\0" 22 | END 23 | END 24 | 25 | BLOCK "VarFileInfo" 26 | BEGIN 27 | VALUE "Translation", 0x409, 1252 28 | END 29 | END 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /scripts/getdeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mkdir -pv ../3rdparty 4 | cd ../3rdparty || exit 5 | rm -rf * 6 | git clone --recursive https://github.com/ccrma/chuck 7 | git clone --recursive https://github.com/grame-cncm/faust 8 | git clone --recursive https://github.com/McMartin/FRUT frut 9 | git clone --recursive https://github.com/erikd/libsamplerate 10 | git clone --recursive https://github.com/erikd/libsndfile 11 | git clone --recursive https://git.code.sf.net/p/rakarrack/git rakarrack 12 | git clone --recursive https://github.com/thestk/rtaudio 13 | git clone --recursive https://github.com/thestk/rtmidi 14 | git clone --recursive https://github.com/breakfastquay/rubberband 15 | git clone --recursive https://github.com/paulbatchelor/Soundpipe soundpipe 16 | git clone --recursive https://github.com/PaulBatchelor/Sporth.git sporth 17 | git clone --recursive https://github.com/thestk/stk 18 | git clone --recursive https://github.com/Tracktion/tracktion_engine 19 | clear -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "/home/dark/proj/tgtracker/src/**/*.h", 7 | "/home/dark/proj/tgtracker/src/**/*.hh", 8 | "/home/dark/proj/tgtracker/src/**/*.hpp" 9 | ], 10 | "defines": [], 11 | "compilerPath": "clang", 12 | "cStandard": "c11", 13 | "cppStandard": "c++20", 14 | "intelliSenseMode": "clang-x64", 15 | "configurationProvider": "go2sh.cmake-integration", 16 | "browse": { 17 | "path": [ 18 | "/usr/include", 19 | "/usr/local/include" 20 | ], 21 | "limitSymbolsToIncludedHeaders": true, 22 | "databaseFilename": "${workspaceFolder}/.vscode/browse.vc.db" 23 | } 24 | } 25 | ], 26 | "version": 4 27 | } -------------------------------------------------------------------------------- /juce/Builds/VisualStudio2019/tgtracker.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2019 3 | 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tgtracker - App", "tgtracker_App.vcxproj", "{42551D72-13BF-687D-832A-A2F1F0305273}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x64 = Debug|x64 9 | Release|x64 = Release|x64 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {42551D72-13BF-687D-832A-A2F1F0305273}.Debug|x64.ActiveCfg = Debug|x64 13 | {42551D72-13BF-687D-832A-A2F1F0305273}.Debug|x64.Build.0 = Debug|x64 14 | {42551D72-13BF-687D-832A-A2F1F0305273}.Release|x64.ActiveCfg = Release|x64 15 | {42551D72-13BF-687D-832A-A2F1F0305273}.Release|x64.Build.0 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "(gdb) Launch", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${workspaceFolder}/tgtracker", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "${workspaceFolder}", 15 | "environment": [], 16 | "externalConsole": false, 17 | "MIMode": "gdb", 18 | "setupCommands": [ 19 | { 20 | "description": "Enable pretty-printing for gdb", 21 | "text": "-enable-pretty-printing", 22 | "ignoreFailures": true 23 | } 24 | ] 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | after_success: 3 | - echo "Build succeeded!" 4 | after_failure: 5 | - echo "Something went wrong..." 6 | before_install: 7 | - eval "${MATRIX_EVAL}" 8 | script: 9 | - mkdir -p build && cd build && cmake -G Ninja .. && ninja 10 | matrix: 11 | include: 12 | - os: linux 13 | dist: bionic 14 | sudo: required 15 | compiler: 16 | - clang 17 | - gcc 18 | addons: 19 | apt: 20 | update: true 21 | sources: 22 | - ubuntu-toolchain-r-test 23 | packages: 24 | - gcc-7 25 | - g++-7 26 | - cmake 27 | - chuck 28 | - faust 29 | - ninja-build 30 | - libsndfile1-dev 31 | - libpulse-dev 32 | - libasound2-dev 33 | - liblo-dev 34 | - libsamplerate0-dev 35 | - librtaudio-dev 36 | env: 37 | - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" 38 | 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | --- 5 | 6 | **Describe the bug** 7 | A clear and concise description of what the bug is. 8 | 9 | **To Reproduce** 10 | Steps to reproduce the behavior: 11 | 1\. Go to '...' 12 | 2\. Click on '....' 13 | 3\. Scroll down to '....' 14 | 4\. See error 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Desktop (please complete the following information):** 23 | 24 | - OS: [e.g. iOS] 25 | - Browser [e.g. chrome, safari] 26 | - Version [e.g. 22] 27 | 28 | **Smartphone (please complete the following information):** 29 | 30 | - Device: [e.g. iPhone6] 31 | - OS: [e.g. iOS8.1] 32 | - Browser [e.g. stock browser, safari] 33 | - Version [e.g. 22] 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /juce/Source/MainComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file was auto-generated! 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #pragma once 10 | 11 | #include 12 | 13 | //============================================================================== 14 | /* 15 | This component lives inside our window, and this is where you should put all 16 | your controls and content. 17 | */ 18 | class MainComponent : public AudioAppComponent 19 | { 20 | public: 21 | //============================================================================== 22 | MainComponent(); 23 | ~MainComponent(); 24 | 25 | //============================================================================== 26 | void prepareToPlay (int samplesPerBlockExpected, double sampleRate) override; 27 | void getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) override; 28 | void releaseResources() override; 29 | 30 | //============================================================================== 31 | void paint (Graphics& g) override; 32 | void resized() override; 33 | 34 | private: 35 | //============================================================================== 36 | // Your private member variables go here... 37 | 38 | 39 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainComponent) 40 | }; 41 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "breadcrumbs.enabled": true, 3 | "ccls.launch.args": [ 4 | "-std=C11" 5 | ], 6 | "C_Cpp.clang_format_fallbackStyle": "LLVM", 7 | "C_Cpp.clang_format_sortIncludes": true, 8 | "C_Cpp.clang_format_style": "LLVM", 9 | "C_Cpp.autocomplete": "Disabled", 10 | "C_Cpp.formatting": "Disabled", 11 | "C_Cpp.errorSquiggles": "Disabled", 12 | "C_Cpp.intelliSenseEngine": "Disabled", 13 | // "codeui.targetingMode": "themeSpecific", 14 | // "clang.cflags": [ 15 | // "-std=c11", 16 | // ], 17 | // "clang.cxxflags": [ 18 | // "-std=c++11" 19 | // ], 20 | "cmake.cmakePath": "/usr/bin/cmake", 21 | "cpplint.cpplintPath": "/usr/bin/cpplint", 22 | // "c-cpp-flylint.clang.executable": "clang", 23 | "editor.fontSize": 14, 24 | "editor.largeFileOptimizations": false, 25 | "editor.minimap.enabled": true, 26 | "editor.minimap.renderCharacters": true, 27 | "editor.scrollBeyondLastLine": false, 28 | "editor.snippetSuggestions": "top", 29 | "editor.suggestSelection": "first", 30 | "editor.wordWrap": "on", 31 | "explorer.confirmDelete": false, 32 | "files.associations": { 33 | "justfile": "makefile", 34 | "*.lex": "lex", 35 | "*.gw": "chuck", 36 | "*.tidal": "haskell", 37 | "conky-i3statusbar": "lua", 38 | "system-overview": "lua" 39 | }, 40 | "files.enableTrash": true, 41 | "files.autoSave": "afterDelay", 42 | "git.confirmSync": false, 43 | "git.enableSmartCommit": true, 44 | "licenser.author": "Andrew Prentice", 45 | "licenser.license": "MIT", 46 | "licenser.projectName": "tgtracker", 47 | "licenser.useSingleLineStyle": true, 48 | "ccls.codeLens.renderInline": true, 49 | "ccls.codeLens.localVariables": true, 50 | "ccls.completion.detailedLabel": true, 51 | "ccls.diagnostics.spellChecking": false, 52 | "ccls.index.threads": 8, 53 | "ccls.misc.compilationDatabaseCommand": "compiledb", 54 | "cmake.configureOnOpen": true, 55 | "cmake.generator": "Ninja", 56 | "cmake.installPrefix": "build", 57 | "cmake.cpptools.intelliSenseMode": "gcc-x64", 58 | "cmake.reconfigureOnChange": true, 59 | } -------------------------------------------------------------------------------- /juce/JuceLibraryCode/JuceHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | This is the header file that your files should include in order to get all the 7 | JUCE library headers. You should avoid including the JUCE headers directly in 8 | your own source files, because that wouldn't pick up the correct configuration 9 | options for your app. 10 | 11 | */ 12 | 13 | #pragma once 14 | 15 | #include "AppConfig.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION 33 | /** If you've hit this error then the version of the Projucer that was used to generate this project is 34 | older than the version of the JUCE modules being included. To fix this error, re-save your project 35 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project, 36 | remove the JUCE_PROJUCER_VERSION define from the AppConfig.h file. 37 | */ 38 | #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error." 39 | #endif 40 | 41 | #if ! DONT_SET_USING_JUCE_NAMESPACE 42 | // If your code uses a lot of JUCE classes, then this will obviously save you 43 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE. 44 | using namespace juce; 45 | #endif 46 | 47 | #if ! JUCE_DONT_DECLARE_PROJECTINFO 48 | namespace ProjectInfo 49 | { 50 | const char* const projectName = "tgtracker"; 51 | const char* const companyName = "tonal glyph"; 52 | const char* const versionString = "0.1.0-alpha"; 53 | const int versionNumber = 0x100; 54 | } 55 | #endif 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tonal glyph tracker 2 | 3 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/2b4d117015214886905691720955eb85)](https://app.codacy.com/app/scalarwaves/tgtracker?utm_source=github.com&utm_medium=referral&utm_content=tonal-glyph/tgtracker&utm_campaign=Badge_Grade_Dashboard) 4 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ftonal-glyph%2Ftgtracker.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Ftonal-glyph%2Ftgtracker?ref=badge_shield) 5 | 6 | [![Build Status](https://travis-ci.org/tonal-glyph/tgtracker.svg?branch=master)](https://travis-ci.org/tonal-glyph/tgtracker) 7 | 8 | IMPORTANT: This project is still in the planning and sandbox phase. Please see Projects and Issues for current progress. 9 | 10 | tgtracker will be a digital audio workstation with a tracker-inspired interface. When I originally had the idea, I wanted it to be written in Rust as much as possible. After much research into Rust audio libraries and GUI programming, I've realized that a pure Rust tracker would be very hard to pull off right now with Rust having such a young ecosystem. Ideally Rust could replace C++ in some parts, but frameworks like JUCE are just light years ahead of Rust when it comes to native interfaces and audio routing. Other possible features like VST support, Lua scripting, and Qt widgets also pushed me towards C++. Current sandbox efforts are thus focused on these ends. 11 | 12 | ## Inspiration & History 13 | 14 | I first encountered the demoscene in 1996. I used FastTracker and MadTracker to take apart existing modules and make my own. I have wanted since those years to make a tracker of my own. I am new to systems programming so I need all the help I can get for this project. I'm taking inspiration from several existing trackers/DAWs like FastTracker II, MadTracker 2, BuzzTracker, Cockos Reaper, Renoise, and many others. 15 | 16 | ## Goals 17 | 18 | - Cross-platform 19 | - Embeddable in game engines/music applications 20 | - Low latency 21 | - MIDI and OSC support 22 | - Portable/serializable data 23 | - Unique interface and document format 24 | 25 | ## Non-goals 26 | 27 | - Backwards compatability w/ existing modules (XM, IT, etc.) but import to native format would be nice 28 | 29 | ## License 30 | 31 | All libraries and frameworks used to make tgtracker are used under their respective open source licenses. 32 | 33 | [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ftonal-glyph%2Ftgtracker.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ftonal-glyph%2Ftgtracker?ref=badge_large) -------------------------------------------------------------------------------- /cmake/modules/UsePkgConfig.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | UsePkgConfig 6 | ------------ 7 | 8 | Obsolete pkg-config module for CMake, use FindPkgConfig instead. 9 | 10 | 11 | 12 | This module defines the following macro: 13 | 14 | PKGCONFIG(package includedir libdir linkflags cflags) 15 | 16 | Calling PKGCONFIG will fill the desired information into the 4 given 17 | arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR 18 | LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config was NOT 19 | found or the specified software package doesn't exist, the variable 20 | will be empty when the function returns, otherwise they will contain 21 | the respective information 22 | #]=======================================================================] 23 | 24 | find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config ) 25 | 26 | macro(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags) 27 | message(STATUS 28 | "WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig") 29 | # reset the variables at the beginning 30 | set(${_include_DIR}) 31 | set(${_link_DIR}) 32 | set(${_link_FLAGS}) 33 | set(${_cflags}) 34 | 35 | # if pkg-config has been found 36 | if(PKGCONFIG_EXECUTABLE) 37 | 38 | exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) 39 | 40 | # and if the package of interest also exists for pkg-config, then get the information 41 | if(NOT _return_VALUE) 42 | 43 | exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir 44 | OUTPUT_VARIABLE ${_include_DIR} ) 45 | string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}") 46 | 47 | 48 | exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir 49 | OUTPUT_VARIABLE ${_link_DIR} ) 50 | string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}") 51 | 52 | exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs 53 | OUTPUT_VARIABLE ${_link_FLAGS} ) 54 | string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}") 55 | 56 | exec_program(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags 57 | OUTPUT_VARIABLE ${_cflags} ) 58 | string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}") 59 | 60 | else() 61 | 62 | message(STATUS "PKGCONFIG() indicates that ${_package} is not installed (install the package which contains ${_package}.pc if you want to support this feature)") 63 | 64 | endif() 65 | 66 | # if pkg-config has NOT been found, INFORM the user 67 | else() 68 | 69 | message(STATUS "WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.") 70 | 71 | endif() 72 | 73 | endmacro() 74 | 75 | mark_as_advanced(PKGCONFIG_EXECUTABLE) 76 | -------------------------------------------------------------------------------- /scripts/builddeps.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export FROOT="$(pwd)/../3rdparty" 4 | echo "Building tgtracker dependencies..." 5 | 6 | yay -S alsa autogen figlet figlet-fonts fftw cmake ninja ladspa libsoundio flac speex sqlite3 libvorbis opus pkgconf pulseaudio pulseaudio-alsa jack2 libmicrohttpd fltk libxpm fontconfig libxrender 7 | 8 | figlet -t -f doom samplerate 9 | cd "$FROOT"/libsamplerate || exit 10 | git pull 11 | mkdir -pv build 12 | cd build || exit 13 | cmake -GNinja -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLIBSAMPLERATE_INSTALL=ON -DCMAKE_INSTALL_PREFIX=/usr/local .. 14 | /usr/bin/ninja 15 | sudo /usr/bin/ninja install 16 | cd .. || exit 17 | rm -rf build 18 | 19 | figlet -t -f doom sndfile 20 | cd "$FROOT"/libsndfile || exit 21 | git pull 22 | ./autogen.sh 23 | ./configure 24 | make -j8 25 | sudo make install 26 | make clean 27 | 28 | figlet -t -f doom rtaudio 29 | cd "$FROOT"/rtaudio || exit 30 | git pull 31 | mkdir -pv build 32 | cd build || exit 33 | cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. 34 | /usr/bin/ninja 35 | sudo /usr/bin/ninja install 36 | cd .. || exit 37 | rm -rf build 38 | 39 | figlet -t -f doom rtmidi 40 | cd "$FROOT"/rtmidi || exit 41 | git pull 42 | mkdir -pv build 43 | cd build || exit 44 | cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. 45 | /usr/bin/ninja 46 | sudo /usr/bin/ninja install 47 | cd .. || exit 48 | rm -rf build 49 | 50 | figlet -t -f doom rubberband 51 | cd "$FROOT"/rubberband || exit 52 | git pull 53 | ./configure 54 | make -j8 55 | sudo make install 56 | make clean 57 | rm -rf config.log config.status Makefile bin/rubberband lib 58 | 59 | figlet -t -f doom chuck 60 | cd "$FROOT"/chuck/src || exit 61 | git pull 62 | make linux-alsa 63 | sudo make install 64 | make clean 65 | 66 | figlet -t -f doom faust 67 | cd "$FROOT"/faust || exit 68 | git pull 69 | cd build || exit 70 | mkdir -pv faustdir 71 | cd faustdir || exit 72 | cmake -GNinja -Wno-dev -DCMAKE_BUILD_TYPE=Release .. 73 | /usr/bin/ninja 74 | sudo /usr/bin/ninja install 75 | cd .. || exit 76 | make distclean 77 | 78 | figlet -t -f doom frut 79 | cd "$FROOT"/frut || exit 80 | git pull 81 | mkdir -pv build 82 | cd build || exit 83 | cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DJUCE_ROOT=../../tracktion_engine/modules/juce 84 | /usr/bin/ninja 85 | sudo /usr/bin/ninja install 86 | cd .. 87 | rm -rf build 88 | 89 | figlet -t -f doom rakarrack 90 | cd "$FROOT"/rakarrack || exit 91 | git pull 92 | ./autogen.sh 93 | ./configure 94 | make -j8 95 | sudo make install 96 | make clean 97 | 98 | figlet -t -f doom soundpipe 99 | cd "$FROOT"/soundpipe || exit 100 | git pull 101 | git checkout dev 102 | make -j8 103 | sudo make install 104 | make clean 105 | rm config.mk 106 | 107 | figlet -t -f doom sporth 108 | cd "$FROOT"/sporth || exit 109 | git pull 110 | make -j8 111 | sudo make install 112 | make clean 113 | 114 | figlet -t -f doom stk 115 | cd "$FROOT"/stk || exit 116 | git pull 117 | autoconf 118 | ./configure --with-alsa --with-jack 119 | make -j8 120 | sudo make install 121 | make distclean 122 | rm -f configure 123 | 124 | echo "done." -------------------------------------------------------------------------------- /cmake/modules/FindAlsa.cmake: -------------------------------------------------------------------------------- 1 | # Alsa check, based on libkmid/configure.in.in. 2 | # Only the support for Alsa >= 0.9.x was included; 0.5.x was dropped (but feel free to re-add it if you need it) 3 | # It defines ... 4 | # It offers the following macros: 5 | # ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage: 6 | # ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h) 7 | # ALSA_VERSION_STRING(version_string) looks for alsa/version.h and reads the version string into 8 | # the first argument passed to the macro 9 | 10 | # Copyright (c) 2006, David Faure, 11 | # Copyright (c) 2007, Matthias Kretz 12 | # 13 | # Redistribution and use is allowed according to the terms of the BSD license. 14 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 15 | 16 | include(CheckIncludeFiles) 17 | include(CheckIncludeFileCXX) 18 | include(CheckLibraryExists) 19 | 20 | # Already done by toplevel 21 | find_library(ASOUND_LIBRARY asound) 22 | set(ASOUND_LIBRARY_DIR "") 23 | if(ASOUND_LIBRARY) 24 | get_filename_component(ASOUND_LIBRARY_DIR ${ASOUND_LIBRARY} PATH) 25 | endif(ASOUND_LIBRARY) 26 | 27 | check_library_exists(asound snd_seq_create_simple_port "${ASOUND_LIBRARY_DIR}" HAVE_LIBASOUND2) 28 | if(HAVE_LIBASOUND2) 29 | message(STATUS "Found ALSA: ${ASOUND_LIBRARY}") 30 | else(HAVE_LIBASOUND2) 31 | message(STATUS "ALSA not found") 32 | endif(HAVE_LIBASOUND2) 33 | set(ALSA_FOUND ${HAVE_LIBASOUND2}) 34 | 35 | find_path(ALSA_INCLUDES alsa/version.h) 36 | 37 | macro(ALSA_VERSION_STRING _result) 38 | # check for version in alsa/version.h 39 | if(ALSA_INCLUDES) 40 | file(READ "${ALSA_INCLUDES}/alsa/version.h" _ALSA_VERSION_CONTENT) 41 | string(REGEX REPLACE ".*SND_LIB_VERSION_STR.*\"(.*)\".*" "\\1" ${_result} "${_ALSA_VERSION_CONTENT}") 42 | else(ALSA_INCLUDES) 43 | message(STATUS "ALSA version not known. ALSA output will probably not work correctly.") 44 | endif(ALSA_INCLUDES) 45 | endmacro(ALSA_VERSION_STRING _result) 46 | 47 | 48 | get_filename_component(_FIND_ALSA_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) 49 | macro(ALSA_CONFIGURE_FILE _destFile) 50 | check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H) 51 | check_include_files(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H) 52 | 53 | check_include_files(linux/awe_voice.h HAVE_LINUX_AWE_VOICE_H) 54 | check_include_files(awe_voice.h HAVE_AWE_VOICE_H) 55 | check_include_files(/usr/src/sys/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H) 56 | check_include_files(/usr/src/sys/gnu/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H) 57 | 58 | check_include_file_cxx(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H) 59 | check_include_file_cxx(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H) 60 | 61 | check_library_exists(asound snd_pcm_resume "${ASOUND_LIBRARY_DIR}" ASOUND_HAS_SND_PCM_RESUME) 62 | if(ASOUND_HAS_SND_PCM_RESUME) 63 | set(HAVE_SND_PCM_RESUME 1) 64 | endif(ASOUND_HAS_SND_PCM_RESUME) 65 | 66 | configure_file(${_FIND_ALSA_MODULE_DIR}/config-alsa.h.cmake ${_destFile}) 67 | endmacro(ALSA_CONFIGURE_FILE _destFile) 68 | 69 | mark_as_advanced(ALSA_INCLUDES ASOUND_LIBRARY) 70 | -------------------------------------------------------------------------------- /juce/Source/MainComponent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file was auto-generated! 5 | 6 | ============================================================================== 7 | */ 8 | 9 | #include "MainComponent.h" 10 | 11 | //============================================================================== 12 | MainComponent::MainComponent() 13 | { 14 | // Make sure you set the size of the component after 15 | // you add any child components. 16 | setSize (800, 600); 17 | 18 | // Some platforms require permissions to open input channels so request that here 19 | if (RuntimePermissions::isRequired (RuntimePermissions::recordAudio) 20 | && ! RuntimePermissions::isGranted (RuntimePermissions::recordAudio)) 21 | { 22 | RuntimePermissions::request (RuntimePermissions::recordAudio, 23 | [&] (bool granted) { if (granted) setAudioChannels (2, 2); }); 24 | } 25 | else 26 | { 27 | // Specify the number of input and output channels that we want to open 28 | setAudioChannels (2, 2); 29 | } 30 | } 31 | 32 | MainComponent::~MainComponent() 33 | { 34 | // This shuts down the audio device and clears the audio source. 35 | shutdownAudio(); 36 | } 37 | 38 | //============================================================================== 39 | void MainComponent::prepareToPlay (int samplesPerBlockExpected, double sampleRate) 40 | { 41 | // This function will be called when the audio device is started, or when 42 | // its settings (i.e. sample rate, block size, etc) are changed. 43 | 44 | // You can use this function to initialise any resources you might need, 45 | // but be careful - it will be called on the audio thread, not the GUI thread. 46 | 47 | // For more details, see the help for AudioProcessor::prepareToPlay() 48 | } 49 | 50 | void MainComponent::getNextAudioBlock (const AudioSourceChannelInfo& bufferToFill) 51 | { 52 | // Your audio-processing code goes here! 53 | 54 | // For more details, see the help for AudioProcessor::getNextAudioBlock() 55 | 56 | // Right now we are not producing any data, in which case we need to clear the buffer 57 | // (to prevent the output of random noise) 58 | bufferToFill.clearActiveBufferRegion(); 59 | } 60 | 61 | void MainComponent::releaseResources() 62 | { 63 | // This will be called when the audio device stops, or when it is being 64 | // restarted due to a setting change. 65 | 66 | // For more details, see the help for AudioProcessor::releaseResources() 67 | } 68 | 69 | //============================================================================== 70 | void MainComponent::paint (Graphics& g) 71 | { 72 | // (Our component is opaque, so we must completely fill the background with a solid colour) 73 | g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId)); 74 | 75 | // You can add your drawing code here! 76 | } 77 | 78 | void MainComponent::resized() 79 | { 80 | // This is called when the MainContentComponent is resized. 81 | // If you add any child components, this is where you should 82 | // update their positions. 83 | } 84 | -------------------------------------------------------------------------------- /juce/Source/Main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | This file was auto-generated! 5 | 6 | It contains the basic startup code for a JUCE application. 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #include 12 | #include "MainComponent.h" 13 | 14 | //============================================================================== 15 | class tgtrackerApplication : public JUCEApplication 16 | { 17 | public: 18 | //============================================================================== 19 | tgtrackerApplication() {} 20 | 21 | const String getApplicationName() override { return ProjectInfo::projectName; } 22 | const String getApplicationVersion() override { return ProjectInfo::versionString; } 23 | bool moreThanOneInstanceAllowed() override { return true; } 24 | 25 | //============================================================================== 26 | void initialise (const String& commandLine) override 27 | { 28 | // This method is where you should put your application's initialisation code.. 29 | 30 | mainWindow.reset (new MainWindow (getApplicationName())); 31 | } 32 | 33 | void shutdown() override 34 | { 35 | // Add your application's shutdown code here.. 36 | 37 | mainWindow = nullptr; // (deletes our window) 38 | } 39 | 40 | //============================================================================== 41 | void systemRequestedQuit() override 42 | { 43 | // This is called when the app is being asked to quit: you can ignore this 44 | // request and let the app carry on running, or call quit() to allow the app to close. 45 | quit(); 46 | } 47 | 48 | void anotherInstanceStarted (const String& commandLine) override 49 | { 50 | // When another instance of the app is launched while this one is running, 51 | // this method is invoked, and the commandLine parameter tells you what 52 | // the other instance's command-line arguments were. 53 | } 54 | 55 | //============================================================================== 56 | /* 57 | This class implements the desktop window that contains an instance of 58 | our MainComponent class. 59 | */ 60 | class MainWindow : public DocumentWindow 61 | { 62 | public: 63 | MainWindow (String name) : DocumentWindow (name, 64 | Desktop::getInstance().getDefaultLookAndFeel() 65 | .findColour (ResizableWindow::backgroundColourId), 66 | DocumentWindow::allButtons) 67 | { 68 | setUsingNativeTitleBar (true); 69 | setContentOwned (new MainComponent(), true); 70 | 71 | #if JUCE_IOS || JUCE_ANDROID 72 | setFullScreen (true); 73 | #else 74 | setResizable (true, true); 75 | centreWithSize (getWidth(), getHeight()); 76 | #endif 77 | 78 | setVisible (true); 79 | } 80 | 81 | void closeButtonPressed() override 82 | { 83 | // This is called when the user tries to close this window. Here, we'll just 84 | // ask the app to quit when this happens, but you can change this to do 85 | // whatever you need. 86 | JUCEApplication::getInstance()->systemRequestedQuit(); 87 | } 88 | 89 | /* Note: Be careful if you override any DocumentWindow methods - the base 90 | class uses a lot of them, so by overriding you might break its functionality. 91 | It's best to do all your work in your content component instead, but if 92 | you really have to override any DocumentWindow methods, make sure your 93 | subclass also calls the superclass's method. 94 | */ 95 | 96 | private: 97 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow) 98 | }; 99 | 100 | private: 101 | std::unique_ptr mainWindow; 102 | }; 103 | 104 | //============================================================================== 105 | // This macro generates the main() routine that launches the app. 106 | START_JUCE_APPLICATION (tgtrackerApplication) 107 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file was generated by Jucer2Reprojucer from "tgtracker.jucer" 2 | 3 | cmake_minimum_required(VERSION 3.4) 4 | 5 | project("tgtracker") 6 | 7 | 8 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../../usr/local/FRUT/cmake") 9 | include(Reprojucer) 10 | 11 | 12 | set(tgtracker_jucer_FILE 13 | "${CMAKE_CURRENT_LIST_DIR}/juce/tgtracker.jucer" 14 | ) 15 | 16 | 17 | set(JUCE_MODULES_GLOBAL_PATH "/usr/share/juce/modules") 18 | 19 | 20 | jucer_project_begin( 21 | JUCER_VERSION "5.4.7" 22 | PROJECT_FILE "${tgtracker_jucer_FILE}" 23 | PROJECT_ID "VYUQOU" 24 | ) 25 | 26 | jucer_project_settings( 27 | PROJECT_NAME "tgtracker" 28 | PROJECT_VERSION "0.1.0-alpha" 29 | COMPANY_NAME "tonal glyph" 30 | COMPANY_COPYRIGHT "(C) 2020 tonal glyph" 31 | COMPANY_EMAIL "scalarwaves@null.net" 32 | REPORT_JUCE_APP_USAGE ON # Required for closed source applications without an Indie or Pro JUCE license 33 | DISPLAY_THE_JUCE_SPLASH_SCREEN ON # Required for closed source applications without an Indie or Pro JUCE license 34 | PROJECT_TYPE "GUI Application" 35 | BUNDLE_IDENTIFIER "com.tonal-glyph.tgtracker" 36 | BINARYDATACPP_SIZE_LIMIT "20.0 MB" 37 | BINARYDATA_NAMESPACE "TGBinary" 38 | CXX_LANGUAGE_STANDARD "Use Latest" 39 | ) 40 | 41 | jucer_project_files("tgtracker/Source" 42 | # Compile Xcode Binary File 43 | # Resource Resource 44 | . . . "Source/MainComponent.h" 45 | x . . "Source/MainComponent.cpp" 46 | x . . "Source/Main.cpp" 47 | ) 48 | 49 | jucer_project_module( 50 | juce_audio_basics 51 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 52 | ) 53 | 54 | jucer_project_module( 55 | juce_audio_devices 56 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 57 | # JUCE_USE_WINRT_MIDI 58 | # JUCE_ASIO 59 | # JUCE_WASAPI 60 | # JUCE_WASAPI_EXCLUSIVE 61 | # JUCE_DIRECTSOUND 62 | # JUCE_ALSA 63 | # JUCE_JACK 64 | # JUCE_BELA 65 | # JUCE_USE_ANDROID_OBOE 66 | # JUCE_USE_ANDROID_OPENSLES 67 | # JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 68 | ) 69 | 70 | jucer_project_module( 71 | juce_audio_formats 72 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 73 | # JUCE_USE_FLAC 74 | # JUCE_USE_OGGVORBIS 75 | # JUCE_USE_MP3AUDIOFORMAT 76 | # JUCE_USE_LAME_AUDIO_FORMAT 77 | # JUCE_USE_WINDOWS_MEDIA_FORMAT 78 | ) 79 | 80 | jucer_project_module( 81 | juce_audio_processors 82 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 83 | # JUCE_PLUGINHOST_VST 84 | # JUCE_PLUGINHOST_VST3 85 | # JUCE_PLUGINHOST_AU 86 | # JUCE_PLUGINHOST_LADSPA 87 | ) 88 | 89 | jucer_project_module( 90 | juce_audio_utils 91 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 92 | # JUCE_USE_CDREADER 93 | # JUCE_USE_CDBURNER 94 | ) 95 | 96 | jucer_project_module( 97 | juce_core 98 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 99 | # JUCE_FORCE_DEBUG 100 | # JUCE_LOG_ASSERTIONS 101 | # JUCE_CHECK_MEMORY_LEAKS 102 | # JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 103 | # JUCE_INCLUDE_ZLIB_CODE 104 | # JUCE_USE_CURL 105 | # JUCE_LOAD_CURL_SYMBOLS_LAZILY 106 | # JUCE_CATCH_UNHANDLED_EXCEPTIONS 107 | # JUCE_ALLOW_STATIC_NULL_VARIABLES 108 | JUCE_STRICT_REFCOUNTEDPOINTER ON 109 | ) 110 | 111 | jucer_project_module( 112 | juce_cryptography 113 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 114 | ) 115 | 116 | jucer_project_module( 117 | juce_data_structures 118 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 119 | ) 120 | 121 | jucer_project_module( 122 | juce_events 123 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 124 | # JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 125 | ) 126 | 127 | jucer_project_module( 128 | juce_graphics 129 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 130 | # JUCE_USE_COREIMAGE_LOADER 131 | # JUCE_USE_DIRECTWRITE 132 | # JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 133 | ) 134 | 135 | jucer_project_module( 136 | juce_gui_basics 137 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 138 | # JUCE_ENABLE_REPAINT_DEBUGGING 139 | # JUCE_USE_XRANDR 140 | # JUCE_USE_XINERAMA 141 | # JUCE_USE_XSHM 142 | # JUCE_USE_XRENDER 143 | # JUCE_USE_XCURSOR 144 | # JUCE_WIN_PER_MONITOR_DPI_AWARE 145 | ) 146 | 147 | jucer_project_module( 148 | juce_gui_extra 149 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 150 | # JUCE_WEB_BROWSER 151 | # JUCE_ENABLE_LIVE_CONSTANT_EDITOR 152 | ) 153 | 154 | jucer_project_module( 155 | juce_opengl 156 | PATH "${JUCE_MODULES_GLOBAL_PATH}" 157 | ) 158 | 159 | jucer_export_target( 160 | "Visual Studio 2019" 161 | ) 162 | 163 | jucer_export_target_configuration( 164 | "Visual Studio 2019" 165 | NAME "Debug" 166 | DEBUG_MODE ON 167 | ) 168 | 169 | jucer_export_target_configuration( 170 | "Visual Studio 2019" 171 | NAME "Release" 172 | DEBUG_MODE OFF 173 | ) 174 | 175 | jucer_export_target( 176 | "Linux Makefile" 177 | ) 178 | 179 | jucer_export_target_configuration( 180 | "Linux Makefile" 181 | NAME "Debug" 182 | DEBUG_MODE ON 183 | ) 184 | 185 | jucer_export_target_configuration( 186 | "Linux Makefile" 187 | NAME "Release" 188 | DEBUG_MODE OFF 189 | ) 190 | 191 | jucer_export_target( 192 | "Code::Blocks (Windows)" 193 | ) 194 | 195 | jucer_export_target_configuration( 196 | "Code::Blocks (Windows)" 197 | NAME "Debug" 198 | DEBUG_MODE ON 199 | ARCHITECTURE "64-bit (-m64)" 200 | ) 201 | 202 | jucer_export_target_configuration( 203 | "Code::Blocks (Windows)" 204 | NAME "Release" 205 | DEBUG_MODE OFF 206 | ARCHITECTURE "64-bit (-m64)" 207 | ) 208 | 209 | jucer_project_end() 210 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Conduct 8 | 9 | - We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic. 10 | - Please be kind and courteous. There’s no need to be mean or rude. 11 | - Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer. 12 | - Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works. 13 | - We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the Citizen Code of Conduct; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don’t tolerate behavior that excludes people in socially marginalized groups. 14 | - Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the tonal glyph moderation team immediately. Whether you’re a regular contributor or a newcomer, we care about making this community a safe place for you and we’ve got your back. 15 | - Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome. 16 | 17 | ## Moderation 18 | 19 | These are the policies for upholding our community’s standards of conduct. If you feel that a thread needs moderation, please contact [Andrew Prentice](scalarwaves@null.net) 20 | 21 | 1. Remarks that violate the tonal glyph standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.) 22 | 2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed. 23 | 3. Moderators will first respond to such remarks with a warning. 24 | 4. If the warning is unheeded, the user will be “kicked,” i.e., kicked out of the communication channel to cool off. 25 | 5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded. 26 | 6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology. 27 | 7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, in private. Complaints about bans in-channel are not allowed. 28 | 8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others. 29 | 30 | In the tonal glyph community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely. 31 | 32 | And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make your fellow members of the community comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust. 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 37 | 38 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 39 | 40 | ## Scope 41 | 42 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 43 | 44 | ## Enforcement 45 | 46 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at scalarwaves@null.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 47 | 48 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 49 | 50 | ## Attribution 51 | 52 | This Code of Conduct is adapted from [nannou-org](https://github.com/nannou-org), the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] as well as the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html) 53 | 54 | [homepage]: http://contributor-covenant.org 55 | 56 | [version]: http://contributor-covenant.org/version/1/4/ 57 | -------------------------------------------------------------------------------- /juce/tgtracker.jucer: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /cmake/modules/FindQt.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | FindQt 6 | ------ 7 | 8 | Searches for all installed versions of Qt3 or Qt4. 9 | 10 | This module cannot handle Qt5 or any later versions. 11 | For those, see :manual:`cmake-qt(7)`. 12 | 13 | This module exists for the :command:`find_package` command only if 14 | policy :policy:`CMP0084` is not set to ``NEW``. 15 | 16 | This module should only be used if your project can work with multiple 17 | versions of Qt. If not, you should just directly use FindQt4 or 18 | FindQt3. If multiple versions of Qt are found on the machine, then 19 | The user must set the option DESIRED_QT_VERSION to the version they 20 | want to use. If only one version of qt is found on the machine, then 21 | the DESIRED_QT_VERSION is set to that version and the matching FindQt3 22 | or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION, 23 | then the FindQt3 or FindQt4 module is included. 24 | 25 | :: 26 | 27 | QT_REQUIRED if this is set to TRUE then if CMake can 28 | not find Qt4 or Qt3 an error is raised 29 | and a message is sent to the user. 30 | 31 | 32 | 33 | :: 34 | 35 | DESIRED_QT_VERSION OPTION is created 36 | QT4_INSTALLED is set to TRUE if qt4 is found. 37 | QT3_INSTALLED is set to TRUE if qt3 is found. 38 | #]=======================================================================] 39 | 40 | if(_findqt_testing) 41 | set(_findqt_included TRUE) 42 | return() 43 | endif() 44 | 45 | # look for signs of qt3 installations 46 | file(GLOB GLOB_TEMP_VAR /usr/lib*/qt-3*/bin/qmake /usr/lib*/qt3*/bin/qmake) 47 | if(GLOB_TEMP_VAR) 48 | set(QT3_INSTALLED TRUE) 49 | endif() 50 | set(GLOB_TEMP_VAR) 51 | 52 | file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-3*/bin/qmake) 53 | if(GLOB_TEMP_VAR) 54 | set(QT3_INSTALLED TRUE) 55 | endif() 56 | set(GLOB_TEMP_VAR) 57 | 58 | file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt3/bin/qmake) 59 | if(GLOB_TEMP_VAR) 60 | set(QT3_INSTALLED TRUE) 61 | endif() 62 | set(GLOB_TEMP_VAR) 63 | 64 | # look for qt4 installations 65 | file(GLOB GLOB_TEMP_VAR /usr/local/qt-x11-commercial-4*/bin/qmake) 66 | if(GLOB_TEMP_VAR) 67 | set(QT4_INSTALLED TRUE) 68 | endif() 69 | set(GLOB_TEMP_VAR) 70 | 71 | file(GLOB GLOB_TEMP_VAR /usr/local/Trolltech/Qt-4*/bin/qmake) 72 | if(GLOB_TEMP_VAR) 73 | set(QT4_INSTALLED TRUE) 74 | endif() 75 | set(GLOB_TEMP_VAR) 76 | 77 | file(GLOB GLOB_TEMP_VAR /usr/local/lib/qt4/bin/qmake) 78 | if(GLOB_TEMP_VAR) 79 | set(QT4_INSTALLED TRUE) 80 | endif() 81 | set(GLOB_TEMP_VAR) 82 | 83 | if (Qt_FIND_VERSION) 84 | if (Qt_FIND_VERSION MATCHES "^([34])(\\.[0-9]+.*)?$") 85 | set(DESIRED_QT_VERSION ${CMAKE_MATCH_1}) 86 | else () 87 | message(FATAL_ERROR "FindQt was called with invalid version '${Qt_FIND_VERSION}'. Only Qt major versions 3 or 4 are supported. If you do not need to support both Qt3 and Qt4 in your source consider calling find_package(Qt3) or find_package(Qt4) instead of find_package(Qt) instead.") 88 | endif () 89 | endif () 90 | 91 | # now find qmake 92 | find_program(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin") 93 | if(QT_QMAKE_EXECUTABLE_FINDQT) 94 | exec_program(${QT_QMAKE_EXECUTABLE_FINDQT} ARGS "-query QT_VERSION" 95 | OUTPUT_VARIABLE QTVERSION) 96 | if(QTVERSION MATCHES "4") 97 | set(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt4 qmake program.") 98 | set(QT4_INSTALLED TRUE) 99 | endif() 100 | if(QTVERSION MATCHES "Unknown") 101 | set(QT3_INSTALLED TRUE) 102 | endif() 103 | endif() 104 | 105 | if(QT_QMAKE_EXECUTABLE_FINDQT) 106 | exec_program( ${QT_QMAKE_EXECUTABLE_FINDQT} 107 | ARGS "-query QT_INSTALL_HEADERS" 108 | OUTPUT_VARIABLE qt_headers ) 109 | endif() 110 | 111 | find_file( QT4_QGLOBAL_H_FILE qglobal.h 112 | "${QT_SEARCH_PATH}/Qt/include" 113 | "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/include/Qt" 114 | "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/include/Qt" 115 | ${qt_headers}/Qt 116 | $ENV{QTDIR}/include/Qt 117 | /usr/lib/qt/include/Qt 118 | /usr/share/qt4/include/Qt 119 | /usr/local/include/X11/qt4/Qt 120 | C:/Progra~1/qt/include/Qt 121 | PATH_SUFFIXES qt/include/Qt include/Qt) 122 | 123 | if(QT4_QGLOBAL_H_FILE) 124 | set(QT4_INSTALLED TRUE) 125 | endif() 126 | 127 | find_file( QT3_QGLOBAL_H_FILE qglobal.h 128 | "${QT_SEARCH_PATH}/Qt/include" 129 | "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" 130 | "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" 131 | "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" 132 | C:/Qt/3.3.3Educational/include 133 | $ENV{QTDIR}/include 134 | /usr/include/qt3/Qt 135 | /usr/share/qt3/include 136 | /usr/local/include/X11/qt3 137 | C:/Progra~1/qt/include 138 | PATH_SUFFIXES qt/include include/qt3) 139 | 140 | if(QT3_QGLOBAL_H_FILE) 141 | set(QT3_INSTALLED TRUE) 142 | endif() 143 | 144 | if(QT3_INSTALLED AND QT4_INSTALLED AND NOT DESIRED_QT_VERSION) 145 | # force user to pick if we have both 146 | set(DESIRED_QT_VERSION 0 CACHE STRING "Pick a version of Qt to use: 3 or 4") 147 | else() 148 | # if only one found then pick that one 149 | if(QT3_INSTALLED AND NOT DESIRED_QT_VERSION EQUAL 4) 150 | set(DESIRED_QT_VERSION 3 CACHE STRING "Pick a version of Qt to use: 3 or 4") 151 | endif() 152 | if(QT4_INSTALLED AND NOT DESIRED_QT_VERSION EQUAL 3) 153 | set(DESIRED_QT_VERSION 4 CACHE STRING "Pick a version of Qt to use: 3 or 4") 154 | endif() 155 | endif() 156 | 157 | if(DESIRED_QT_VERSION EQUAL 3) 158 | set(Qt3_FIND_REQUIRED ${Qt_FIND_REQUIRED}) 159 | set(Qt3_FIND_QUIETLY ${Qt_FIND_QUIETLY}) 160 | include(${CMAKE_CURRENT_LIST_DIR}/FindQt3.cmake) 161 | endif() 162 | if(DESIRED_QT_VERSION EQUAL 4) 163 | set(Qt4_FIND_REQUIRED ${Qt_FIND_REQUIRED}) 164 | set(Qt4_FIND_QUIETLY ${Qt_FIND_QUIETLY}) 165 | include(${CMAKE_CURRENT_LIST_DIR}/FindQt4.cmake) 166 | endif() 167 | 168 | if(NOT QT3_INSTALLED AND NOT QT4_INSTALLED) 169 | if(QT_REQUIRED) 170 | message(SEND_ERROR "CMake was unable to find any Qt versions, put qmake in your path, or set QT_QMAKE_EXECUTABLE.") 171 | endif() 172 | else() 173 | if(NOT QT_FOUND AND NOT DESIRED_QT_VERSION) 174 | if(QT_REQUIRED) 175 | message(SEND_ERROR "Multiple versions of Qt found please set DESIRED_QT_VERSION") 176 | else() 177 | message("Multiple versions of Qt found please set DESIRED_QT_VERSION") 178 | endif() 179 | endif() 180 | if(NOT QT_FOUND AND DESIRED_QT_VERSION) 181 | if(QT_REQUIRED) 182 | message(FATAL_ERROR "CMake was unable to find Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_H_FILE, if those are set then QT_QT_LIBRARY or QT_LIBRARY_DIR.") 183 | else() 184 | message( "CMake was unable to find desired Qt version: ${DESIRED_QT_VERSION}. Set advanced values QT_QMAKE_EXECUTABLE and QT${DESIRED_QT_VERSION}_QGLOBAL_H_FILE.") 185 | endif() 186 | endif() 187 | endif() 188 | mark_as_advanced(QT3_QGLOBAL_H_FILE QT4_QGLOBAL_H_FILE QT_QMAKE_EXECUTABLE_FINDQT) 189 | -------------------------------------------------------------------------------- /juce/JuceLibraryCode/AppConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | IMPORTANT! This file is auto-generated each time you save your 4 | project - if you alter its contents, your changes may be overwritten! 5 | 6 | There's a section below where you can add your own custom code safely, and the 7 | Projucer will preserve the contents of that block, but the best way to change 8 | any of these definitions is by using the Projucer's project settings. 9 | 10 | Any commented-out settings will assume their default values. 11 | 12 | */ 13 | 14 | #pragma once 15 | 16 | //============================================================================== 17 | // [BEGIN_USER_CODE_SECTION] 18 | 19 | // (You can add your own code in this section, and the Projucer will not overwrite it) 20 | 21 | // [END_USER_CODE_SECTION] 22 | 23 | /* 24 | ============================================================================== 25 | 26 | In accordance with the terms of the JUCE 5 End-Use License Agreement, the 27 | JUCE Code in SECTION A cannot be removed, changed or otherwise rendered 28 | ineffective unless you have a JUCE Indie or Pro license, or are using JUCE 29 | under the GPL v3 license. 30 | 31 | End User License Agreement: www.juce.com/juce-5-licence 32 | 33 | ============================================================================== 34 | */ 35 | 36 | // BEGIN SECTION A 37 | 38 | #ifndef JUCE_DISPLAY_SPLASH_SCREEN 39 | #define JUCE_DISPLAY_SPLASH_SCREEN 0 40 | #endif 41 | 42 | #ifndef JUCE_REPORT_APP_USAGE 43 | #define JUCE_REPORT_APP_USAGE 0 44 | #endif 45 | 46 | // END SECTION A 47 | 48 | #define JUCE_USE_DARK_SPLASH_SCREEN 1 49 | 50 | #define JUCE_PROJUCER_VERSION 0x50407 51 | 52 | //============================================================================== 53 | #define JUCE_MODULE_AVAILABLE_juce_audio_basics 1 54 | #define JUCE_MODULE_AVAILABLE_juce_audio_devices 1 55 | #define JUCE_MODULE_AVAILABLE_juce_audio_formats 1 56 | #define JUCE_MODULE_AVAILABLE_juce_audio_processors 1 57 | #define JUCE_MODULE_AVAILABLE_juce_audio_utils 1 58 | #define JUCE_MODULE_AVAILABLE_juce_core 1 59 | #define JUCE_MODULE_AVAILABLE_juce_cryptography 1 60 | #define JUCE_MODULE_AVAILABLE_juce_data_structures 1 61 | #define JUCE_MODULE_AVAILABLE_juce_events 1 62 | #define JUCE_MODULE_AVAILABLE_juce_graphics 1 63 | #define JUCE_MODULE_AVAILABLE_juce_gui_basics 1 64 | #define JUCE_MODULE_AVAILABLE_juce_gui_extra 1 65 | #define JUCE_MODULE_AVAILABLE_juce_opengl 1 66 | 67 | #define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1 68 | 69 | //============================================================================== 70 | // juce_audio_devices flags: 71 | 72 | #ifndef JUCE_USE_WINRT_MIDI 73 | //#define JUCE_USE_WINRT_MIDI 0 74 | #endif 75 | 76 | #ifndef JUCE_ASIO 77 | //#define JUCE_ASIO 0 78 | #endif 79 | 80 | #ifndef JUCE_WASAPI 81 | //#define JUCE_WASAPI 1 82 | #endif 83 | 84 | #ifndef JUCE_WASAPI_EXCLUSIVE 85 | //#define JUCE_WASAPI_EXCLUSIVE 0 86 | #endif 87 | 88 | #ifndef JUCE_DIRECTSOUND 89 | //#define JUCE_DIRECTSOUND 1 90 | #endif 91 | 92 | #ifndef JUCE_ALSA 93 | //#define JUCE_ALSA 1 94 | #endif 95 | 96 | #ifndef JUCE_JACK 97 | //#define JUCE_JACK 0 98 | #endif 99 | 100 | #ifndef JUCE_BELA 101 | //#define JUCE_BELA 0 102 | #endif 103 | 104 | #ifndef JUCE_USE_ANDROID_OBOE 105 | //#define JUCE_USE_ANDROID_OBOE 0 106 | #endif 107 | 108 | #ifndef JUCE_USE_ANDROID_OPENSLES 109 | //#define JUCE_USE_ANDROID_OPENSLES 0 110 | #endif 111 | 112 | #ifndef JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 113 | //#define JUCE_DISABLE_AUDIO_MIXING_WITH_OTHER_APPS 0 114 | #endif 115 | 116 | //============================================================================== 117 | // juce_audio_formats flags: 118 | 119 | #ifndef JUCE_USE_FLAC 120 | //#define JUCE_USE_FLAC 1 121 | #endif 122 | 123 | #ifndef JUCE_USE_OGGVORBIS 124 | //#define JUCE_USE_OGGVORBIS 1 125 | #endif 126 | 127 | #ifndef JUCE_USE_MP3AUDIOFORMAT 128 | //#define JUCE_USE_MP3AUDIOFORMAT 0 129 | #endif 130 | 131 | #ifndef JUCE_USE_LAME_AUDIO_FORMAT 132 | //#define JUCE_USE_LAME_AUDIO_FORMAT 0 133 | #endif 134 | 135 | #ifndef JUCE_USE_WINDOWS_MEDIA_FORMAT 136 | //#define JUCE_USE_WINDOWS_MEDIA_FORMAT 1 137 | #endif 138 | 139 | //============================================================================== 140 | // juce_audio_processors flags: 141 | 142 | #ifndef JUCE_PLUGINHOST_VST 143 | //#define JUCE_PLUGINHOST_VST 0 144 | #endif 145 | 146 | #ifndef JUCE_PLUGINHOST_VST3 147 | //#define JUCE_PLUGINHOST_VST3 0 148 | #endif 149 | 150 | #ifndef JUCE_PLUGINHOST_AU 151 | //#define JUCE_PLUGINHOST_AU 0 152 | #endif 153 | 154 | #ifndef JUCE_PLUGINHOST_LADSPA 155 | //#define JUCE_PLUGINHOST_LADSPA 0 156 | #endif 157 | 158 | //============================================================================== 159 | // juce_audio_utils flags: 160 | 161 | #ifndef JUCE_USE_CDREADER 162 | //#define JUCE_USE_CDREADER 0 163 | #endif 164 | 165 | #ifndef JUCE_USE_CDBURNER 166 | //#define JUCE_USE_CDBURNER 0 167 | #endif 168 | 169 | //============================================================================== 170 | // juce_core flags: 171 | 172 | #ifndef JUCE_FORCE_DEBUG 173 | //#define JUCE_FORCE_DEBUG 0 174 | #endif 175 | 176 | #ifndef JUCE_LOG_ASSERTIONS 177 | //#define JUCE_LOG_ASSERTIONS 0 178 | #endif 179 | 180 | #ifndef JUCE_CHECK_MEMORY_LEAKS 181 | //#define JUCE_CHECK_MEMORY_LEAKS 1 182 | #endif 183 | 184 | #ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 185 | //#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0 186 | #endif 187 | 188 | #ifndef JUCE_INCLUDE_ZLIB_CODE 189 | //#define JUCE_INCLUDE_ZLIB_CODE 1 190 | #endif 191 | 192 | #ifndef JUCE_USE_CURL 193 | //#define JUCE_USE_CURL 1 194 | #endif 195 | 196 | #ifndef JUCE_LOAD_CURL_SYMBOLS_LAZILY 197 | //#define JUCE_LOAD_CURL_SYMBOLS_LAZILY 0 198 | #endif 199 | 200 | #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS 201 | //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 0 202 | #endif 203 | 204 | #ifndef JUCE_ALLOW_STATIC_NULL_VARIABLES 205 | //#define JUCE_ALLOW_STATIC_NULL_VARIABLES 0 206 | #endif 207 | 208 | #ifndef JUCE_STRICT_REFCOUNTEDPOINTER 209 | #define JUCE_STRICT_REFCOUNTEDPOINTER 1 210 | #endif 211 | 212 | //============================================================================== 213 | // juce_events flags: 214 | 215 | #ifndef JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 216 | //#define JUCE_EXECUTE_APP_SUSPEND_ON_BACKGROUND_TASK 0 217 | #endif 218 | 219 | //============================================================================== 220 | // juce_graphics flags: 221 | 222 | #ifndef JUCE_USE_COREIMAGE_LOADER 223 | //#define JUCE_USE_COREIMAGE_LOADER 1 224 | #endif 225 | 226 | #ifndef JUCE_USE_DIRECTWRITE 227 | //#define JUCE_USE_DIRECTWRITE 1 228 | #endif 229 | 230 | #ifndef JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 231 | //#define JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 0 232 | #endif 233 | 234 | //============================================================================== 235 | // juce_gui_basics flags: 236 | 237 | #ifndef JUCE_ENABLE_REPAINT_DEBUGGING 238 | //#define JUCE_ENABLE_REPAINT_DEBUGGING 0 239 | #endif 240 | 241 | #ifndef JUCE_USE_XRANDR 242 | //#define JUCE_USE_XRANDR 1 243 | #endif 244 | 245 | #ifndef JUCE_USE_XINERAMA 246 | //#define JUCE_USE_XINERAMA 1 247 | #endif 248 | 249 | #ifndef JUCE_USE_XSHM 250 | //#define JUCE_USE_XSHM 1 251 | #endif 252 | 253 | #ifndef JUCE_USE_XRENDER 254 | //#define JUCE_USE_XRENDER 0 255 | #endif 256 | 257 | #ifndef JUCE_USE_XCURSOR 258 | //#define JUCE_USE_XCURSOR 1 259 | #endif 260 | 261 | #ifndef JUCE_WIN_PER_MONITOR_DPI_AWARE 262 | //#define JUCE_WIN_PER_MONITOR_DPI_AWARE 1 263 | #endif 264 | 265 | //============================================================================== 266 | // juce_gui_extra flags: 267 | 268 | #ifndef JUCE_WEB_BROWSER 269 | //#define JUCE_WEB_BROWSER 1 270 | #endif 271 | 272 | #ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR 273 | //#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0 274 | #endif 275 | 276 | //============================================================================== 277 | #ifndef JUCE_STANDALONE_APPLICATION 278 | #if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone) 279 | #define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone 280 | #else 281 | #define JUCE_STANDALONE_APPLICATION 1 282 | #endif 283 | #endif 284 | -------------------------------------------------------------------------------- /cmake/modules/FindThreads.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | FindThreads 6 | ----------- 7 | 8 | This module determines the thread library of the system. 9 | 10 | Imported Targets 11 | ^^^^^^^^^^^^^^^^ 12 | 13 | This module defines the following :prop_tgt:`IMPORTED` target: 14 | 15 | ``Threads::Threads`` 16 | The thread library, if found. 17 | 18 | Result Variables 19 | ^^^^^^^^^^^^^^^^ 20 | 21 | The following variables are set: 22 | 23 | ``Threads_FOUND`` 24 | If a supported thread library was found. 25 | ``CMAKE_THREAD_LIBS_INIT`` 26 | The thread library to use. This may be empty if the thread functions 27 | are provided by the system libraries and no special flags are needed 28 | to use them. 29 | ``CMAKE_USE_WIN32_THREADS_INIT`` 30 | If the found thread library is the win32 one. 31 | ``CMAKE_USE_PTHREADS_INIT`` 32 | If the found thread library is pthread compatible. 33 | ``CMAKE_HP_PTHREADS_INIT`` 34 | If the found thread library is the HP thread library. 35 | 36 | Variables Affecting Behavior 37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 38 | 39 | .. variable:: THREADS_PREFER_PTHREAD_FLAG 40 | 41 | If the use of the -pthread compiler and linker flag is preferred then 42 | the caller can set this variable to TRUE. The compiler flag can only be 43 | used with the imported target. Use of both the imported target as well 44 | as this switch is highly recommended for new code. 45 | 46 | This variable has no effect if the system libraries provide the 47 | thread functions, i.e. when ``CMAKE_THREAD_LIBS_INIT`` will be empty. 48 | #]=======================================================================] 49 | 50 | include (CheckLibraryExists) 51 | set(Threads_FOUND FALSE) 52 | set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET}) 53 | set(CMAKE_REQUIRED_QUIET ${Threads_FIND_QUIETLY}) 54 | 55 | if(CMAKE_C_COMPILER_LOADED) 56 | include (CheckIncludeFile) 57 | include (CheckCSourceCompiles) 58 | elseif(CMAKE_CXX_COMPILER_LOADED) 59 | include (CheckIncludeFileCXX) 60 | include (CheckCXXSourceCompiles) 61 | else() 62 | message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled") 63 | endif() 64 | 65 | # simple pthread test code 66 | set(PTHREAD_C_CXX_TEST_SOURCE [====[ 67 | #include 68 | 69 | void* test_func(void* data) 70 | { 71 | return data; 72 | } 73 | 74 | int main(void) 75 | { 76 | pthread_t thread; 77 | pthread_create(&thread, NULL, test_func, NULL); 78 | pthread_detach(thread); 79 | pthread_cancel(thread); 80 | pthread_join(thread, NULL); 81 | pthread_atfork(NULL, NULL, NULL); 82 | pthread_exit(NULL); 83 | 84 | return 0; 85 | } 86 | ]====]) 87 | 88 | # Internal helper macro. 89 | # Do NOT even think about using it outside of this file! 90 | macro(_check_threads_lib LIBNAME FUNCNAME VARNAME) 91 | if(NOT Threads_FOUND) 92 | CHECK_LIBRARY_EXISTS(${LIBNAME} ${FUNCNAME} "" ${VARNAME}) 93 | if(${VARNAME}) 94 | set(CMAKE_THREAD_LIBS_INIT "-l${LIBNAME}") 95 | set(CMAKE_HAVE_THREADS_LIBRARY 1) 96 | set(Threads_FOUND TRUE) 97 | endif() 98 | endif () 99 | endmacro() 100 | 101 | # Internal helper macro. 102 | # Do NOT even think about using it outside of this file! 103 | macro(_check_pthreads_flag) 104 | if(NOT Threads_FOUND) 105 | # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread 106 | if(NOT DEFINED THREADS_HAVE_PTHREAD_ARG) 107 | message(CHECK_START "Check if compiler accepts -pthread") 108 | if(CMAKE_C_COMPILER_LOADED) 109 | set(_threads_src ${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c) 110 | elseif(CMAKE_CXX_COMPILER_LOADED) 111 | set(_threads_src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindThreads/CheckForPthreads.cxx) 112 | configure_file(${CMAKE_CURRENT_LIST_DIR}/CheckForPthreads.c "${_threads_src}" COPYONLY) 113 | endif() 114 | try_compile(THREADS_HAVE_PTHREAD_ARG 115 | ${CMAKE_BINARY_DIR} 116 | ${_threads_src} 117 | CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread 118 | OUTPUT_VARIABLE OUTPUT) 119 | unset(_threads_src) 120 | 121 | if(THREADS_HAVE_PTHREAD_ARG) 122 | set(Threads_FOUND TRUE) 123 | message(CHECK_PASS "yes") 124 | else() 125 | message(CHECK_FAIL "no") 126 | file(APPEND 127 | ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 128 | "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n") 129 | endif() 130 | 131 | endif() 132 | 133 | if(THREADS_HAVE_PTHREAD_ARG) 134 | set(Threads_FOUND TRUE) 135 | set(CMAKE_THREAD_LIBS_INIT "-pthread") 136 | endif() 137 | endif() 138 | endmacro() 139 | 140 | # Do we have pthreads? 141 | if(CMAKE_C_COMPILER_LOADED) 142 | CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H) 143 | else() 144 | CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H) 145 | endif() 146 | 147 | if(CMAKE_HAVE_PTHREAD_H) 148 | # 149 | # We have pthread.h 150 | # Let's check for the library now. 151 | # 152 | set(CMAKE_HAVE_THREADS_LIBRARY) 153 | if(NOT THREADS_HAVE_PTHREAD_ARG) 154 | # Check if pthread functions are in normal C library. 155 | # We list some pthread functions in PTHREAD_C_CXX_TEST_SOURCE test code. 156 | # If the pthread functions already exist in C library, we could just use 157 | # them instead of linking to the additional pthread library. 158 | if(CMAKE_C_COMPILER_LOADED) 159 | CHECK_C_SOURCE_COMPILES("${PTHREAD_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_PTHREAD) 160 | elseif(CMAKE_CXX_COMPILER_LOADED) 161 | CHECK_CXX_SOURCE_COMPILES("${PTHREAD_C_CXX_TEST_SOURCE}" CMAKE_HAVE_LIBC_PTHREAD) 162 | endif() 163 | if(CMAKE_HAVE_LIBC_PTHREAD) 164 | set(CMAKE_THREAD_LIBS_INIT "") 165 | set(CMAKE_HAVE_THREADS_LIBRARY 1) 166 | set(Threads_FOUND TRUE) 167 | else() 168 | # Check for -pthread first if enabled. This is the recommended 169 | # way, but not backwards compatible as one must also pass -pthread 170 | # as compiler flag then. 171 | if (THREADS_PREFER_PTHREAD_FLAG) 172 | _check_pthreads_flag() 173 | endif () 174 | 175 | if(CMAKE_SYSTEM MATCHES "GHS-MULTI") 176 | _check_threads_lib(posix pthread_create CMAKE_HAVE_PTHREADS_CREATE) 177 | endif() 178 | _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE) 179 | _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE) 180 | if(CMAKE_SYSTEM_NAME MATCHES "SunOS") 181 | # On sun also check for -lthread 182 | _check_threads_lib(thread thr_create CMAKE_HAVE_THR_CREATE) 183 | endif() 184 | endif() 185 | endif() 186 | 187 | _check_pthreads_flag() 188 | endif() 189 | 190 | if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_PTHREAD) 191 | set(CMAKE_USE_PTHREADS_INIT 1) 192 | set(Threads_FOUND TRUE) 193 | endif() 194 | 195 | if(CMAKE_SYSTEM_NAME MATCHES "Windows") 196 | set(CMAKE_USE_WIN32_THREADS_INIT 1) 197 | set(Threads_FOUND TRUE) 198 | endif() 199 | 200 | if(CMAKE_USE_PTHREADS_INIT) 201 | if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") 202 | # Use libcma if it exists and can be used. It provides more 203 | # symbols than the plain pthread library. CMA threads 204 | # have actually been deprecated: 205 | # http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395 206 | # http://docs.hp.com/en/947/d8.html 207 | # but we need to maintain compatibility here. 208 | # The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads 209 | # are available. 210 | CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA) 211 | if(CMAKE_HAVE_HP_CMA) 212 | set(CMAKE_THREAD_LIBS_INIT "-lcma") 213 | set(CMAKE_HP_PTHREADS_INIT 1) 214 | set(Threads_FOUND TRUE) 215 | endif() 216 | set(CMAKE_USE_PTHREADS_INIT 1) 217 | endif() 218 | 219 | if(CMAKE_SYSTEM MATCHES "OSF1-V") 220 | set(CMAKE_USE_PTHREADS_INIT 0) 221 | set(CMAKE_THREAD_LIBS_INIT ) 222 | endif() 223 | 224 | if(CMAKE_SYSTEM MATCHES "CYGWIN_NT") 225 | set(CMAKE_USE_PTHREADS_INIT 1) 226 | set(Threads_FOUND TRUE) 227 | set(CMAKE_THREAD_LIBS_INIT ) 228 | set(CMAKE_USE_WIN32_THREADS_INIT 0) 229 | endif() 230 | endif() 231 | 232 | set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE}) 233 | include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) 234 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND) 235 | 236 | if(THREADS_FOUND AND NOT TARGET Threads::Threads) 237 | add_library(Threads::Threads INTERFACE IMPORTED) 238 | 239 | if(THREADS_HAVE_PTHREAD_ARG) 240 | set_property(TARGET Threads::Threads 241 | PROPERTY INTERFACE_COMPILE_OPTIONS "$<$:SHELL:-Xcompiler -pthread>" 242 | "$<$>:-pthread>") 243 | endif() 244 | 245 | if(CMAKE_THREAD_LIBS_INIT) 246 | set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") 247 | endif() 248 | endif() 249 | -------------------------------------------------------------------------------- /juce/Builds/LinuxMakefile/Makefile: -------------------------------------------------------------------------------- 1 | # Automatically generated makefile, created by the Projucer 2 | # Don't edit this file! Your changes will be overwritten when you re-save the Projucer project! 3 | 4 | # build with "V=1" for verbose builds 5 | ifeq ($(V), 1) 6 | V_AT = 7 | else 8 | V_AT = @ 9 | endif 10 | 11 | # (this disables dependency generation if multiple architectures are set) 12 | DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD) 13 | 14 | ifndef STRIP 15 | STRIP=strip 16 | endif 17 | 18 | ifndef AR 19 | AR=ar 20 | endif 21 | 22 | ifndef CONFIG 23 | CONFIG=Debug 24 | endif 25 | 26 | JUCE_ARCH_LABEL := $(shell uname -m) 27 | 28 | ifeq ($(CONFIG),Debug) 29 | JUCE_BINDIR := build 30 | JUCE_LIBDIR := build 31 | JUCE_OBJDIR := build/intermediate/Debug 32 | JUCE_OUTDIR := build 33 | 34 | ifeq ($(TARGET_ARCH),) 35 | TARGET_ARCH := 36 | endif 37 | 38 | JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DDEBUG=1 -D_DEBUG=1 -DJUCER_LINUX_MAKE_6D53C8B4=1 -DJUCE_APP_VERSION=0.1.0-alpha -DJUCE_APP_VERSION_HEX=0x100 $(shell pkg-config --cflags alsa x11 xinerama xext freetype2 webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -pthread -I../../JuceLibraryCode -I$(HOME)/JUCE/modules -IC:/Program\ Files\ (x86)/Windows\ Kits/10/Include $(CPPFLAGS) 39 | JUCE_CPPFLAGS_APP := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 -DJucePlugin_Build_Unity=0 40 | JUCE_TARGET_APP := tgtracker 41 | 42 | JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0 $(CFLAGS) 43 | JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++17 $(CXXFLAGS) 44 | JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa x11 xinerama xext freetype2 webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -lrt -ldl -lpthread -lGL $(LDFLAGS) 45 | 46 | CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR) 47 | endif 48 | 49 | ifeq ($(CONFIG),Release) 50 | JUCE_BINDIR := build 51 | JUCE_LIBDIR := build 52 | JUCE_OBJDIR := build/intermediate/Release 53 | JUCE_OUTDIR := build 54 | 55 | ifeq ($(TARGET_ARCH),) 56 | TARGET_ARCH := 57 | endif 58 | 59 | JUCE_CPPFLAGS := $(DEPFLAGS) -DLINUX=1 -DNDEBUG=1 -DJUCER_LINUX_MAKE_6D53C8B4=1 -DJUCE_APP_VERSION=0.1.0-alpha -DJUCE_APP_VERSION_HEX=0x100 $(shell pkg-config --cflags alsa x11 xinerama xext freetype2 webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -pthread -I../../JuceLibraryCode -I$(HOME)/JUCE/modules -IC:/Program\ Files\ (x86)/Windows\ Kits/10/Include $(CPPFLAGS) 60 | JUCE_CPPFLAGS_APP := -DJucePlugin_Build_VST=0 -DJucePlugin_Build_VST3=0 -DJucePlugin_Build_AU=0 -DJucePlugin_Build_AUv3=0 -DJucePlugin_Build_RTAS=0 -DJucePlugin_Build_AAX=0 -DJucePlugin_Build_Standalone=0 -DJucePlugin_Build_Unity=0 61 | JUCE_TARGET_APP := tgtracker 62 | 63 | JUCE_CFLAGS += $(JUCE_CPPFLAGS) $(TARGET_ARCH) -O3 $(CFLAGS) 64 | JUCE_CXXFLAGS += $(JUCE_CFLAGS) -std=c++17 $(CXXFLAGS) 65 | JUCE_LDFLAGS += $(TARGET_ARCH) -L$(JUCE_BINDIR) -L$(JUCE_LIBDIR) $(shell pkg-config --libs alsa x11 xinerama xext freetype2 webkit2gtk-4.0 gtk+-x11-3.0 libcurl) -fvisibility=hidden -lrt -ldl -lpthread -lGL $(LDFLAGS) 66 | 67 | CLEANCMD = rm -rf $(JUCE_OUTDIR)/$(TARGET) $(JUCE_OBJDIR) 68 | endif 69 | 70 | OBJECTS_APP := \ 71 | $(JUCE_OBJDIR)/MainComponent_a6ffb4a5.o \ 72 | $(JUCE_OBJDIR)/Main_90ebc5c2.o \ 73 | $(JUCE_OBJDIR)/include_juce_audio_basics_8a4e984a.o \ 74 | $(JUCE_OBJDIR)/include_juce_audio_devices_63111d02.o \ 75 | $(JUCE_OBJDIR)/include_juce_audio_formats_15f82001.o \ 76 | $(JUCE_OBJDIR)/include_juce_audio_processors_10c03666.o \ 77 | $(JUCE_OBJDIR)/include_juce_audio_utils_9f9fb2d6.o \ 78 | $(JUCE_OBJDIR)/include_juce_core_f26d17db.o \ 79 | $(JUCE_OBJDIR)/include_juce_cryptography_8cb807a8.o \ 80 | $(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o \ 81 | $(JUCE_OBJDIR)/include_juce_events_fd7d695.o \ 82 | $(JUCE_OBJDIR)/include_juce_graphics_f817e147.o \ 83 | $(JUCE_OBJDIR)/include_juce_gui_basics_e3f79785.o \ 84 | $(JUCE_OBJDIR)/include_juce_gui_extra_6dee1c1a.o \ 85 | $(JUCE_OBJDIR)/include_juce_opengl_a8a032b.o \ 86 | 87 | .PHONY: clean all strip 88 | 89 | all : $(JUCE_OUTDIR)/$(JUCE_TARGET_APP) 90 | 91 | $(JUCE_OUTDIR)/$(JUCE_TARGET_APP) : $(OBJECTS_APP) $(RESOURCES) 92 | @command -v pkg-config >/dev/null 2>&1 || { echo >&2 "pkg-config not installed. Please, install it."; exit 1; } 93 | @pkg-config --print-errors alsa x11 xinerama xext freetype2 webkit2gtk-4.0 gtk+-x11-3.0 libcurl 94 | @echo Linking "tgtracker - App" 95 | -$(V_AT)mkdir -p $(JUCE_BINDIR) 96 | -$(V_AT)mkdir -p $(JUCE_LIBDIR) 97 | -$(V_AT)mkdir -p $(JUCE_OUTDIR) 98 | $(V_AT)$(CXX) -o $(JUCE_OUTDIR)/$(JUCE_TARGET_APP) $(OBJECTS_APP) $(JUCE_LDFLAGS) $(JUCE_LDFLAGS_APP) $(RESOURCES) $(TARGET_ARCH) 99 | 100 | $(JUCE_OBJDIR)/MainComponent_a6ffb4a5.o: ../../Source/MainComponent.cpp 101 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 102 | @echo "Compiling MainComponent.cpp" 103 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 104 | 105 | $(JUCE_OBJDIR)/Main_90ebc5c2.o: ../../Source/Main.cpp 106 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 107 | @echo "Compiling Main.cpp" 108 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 109 | 110 | $(JUCE_OBJDIR)/include_juce_audio_basics_8a4e984a.o: ../../JuceLibraryCode/include_juce_audio_basics.cpp 111 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 112 | @echo "Compiling include_juce_audio_basics.cpp" 113 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 114 | 115 | $(JUCE_OBJDIR)/include_juce_audio_devices_63111d02.o: ../../JuceLibraryCode/include_juce_audio_devices.cpp 116 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 117 | @echo "Compiling include_juce_audio_devices.cpp" 118 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 119 | 120 | $(JUCE_OBJDIR)/include_juce_audio_formats_15f82001.o: ../../JuceLibraryCode/include_juce_audio_formats.cpp 121 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 122 | @echo "Compiling include_juce_audio_formats.cpp" 123 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 124 | 125 | $(JUCE_OBJDIR)/include_juce_audio_processors_10c03666.o: ../../JuceLibraryCode/include_juce_audio_processors.cpp 126 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 127 | @echo "Compiling include_juce_audio_processors.cpp" 128 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 129 | 130 | $(JUCE_OBJDIR)/include_juce_audio_utils_9f9fb2d6.o: ../../JuceLibraryCode/include_juce_audio_utils.cpp 131 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 132 | @echo "Compiling include_juce_audio_utils.cpp" 133 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 134 | 135 | $(JUCE_OBJDIR)/include_juce_core_f26d17db.o: ../../JuceLibraryCode/include_juce_core.cpp 136 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 137 | @echo "Compiling include_juce_core.cpp" 138 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 139 | 140 | $(JUCE_OBJDIR)/include_juce_cryptography_8cb807a8.o: ../../JuceLibraryCode/include_juce_cryptography.cpp 141 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 142 | @echo "Compiling include_juce_cryptography.cpp" 143 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 144 | 145 | $(JUCE_OBJDIR)/include_juce_data_structures_7471b1e3.o: ../../JuceLibraryCode/include_juce_data_structures.cpp 146 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 147 | @echo "Compiling include_juce_data_structures.cpp" 148 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 149 | 150 | $(JUCE_OBJDIR)/include_juce_events_fd7d695.o: ../../JuceLibraryCode/include_juce_events.cpp 151 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 152 | @echo "Compiling include_juce_events.cpp" 153 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 154 | 155 | $(JUCE_OBJDIR)/include_juce_graphics_f817e147.o: ../../JuceLibraryCode/include_juce_graphics.cpp 156 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 157 | @echo "Compiling include_juce_graphics.cpp" 158 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 159 | 160 | $(JUCE_OBJDIR)/include_juce_gui_basics_e3f79785.o: ../../JuceLibraryCode/include_juce_gui_basics.cpp 161 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 162 | @echo "Compiling include_juce_gui_basics.cpp" 163 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 164 | 165 | $(JUCE_OBJDIR)/include_juce_gui_extra_6dee1c1a.o: ../../JuceLibraryCode/include_juce_gui_extra.cpp 166 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 167 | @echo "Compiling include_juce_gui_extra.cpp" 168 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 169 | 170 | $(JUCE_OBJDIR)/include_juce_opengl_a8a032b.o: ../../JuceLibraryCode/include_juce_opengl.cpp 171 | -$(V_AT)mkdir -p $(JUCE_OBJDIR) 172 | @echo "Compiling include_juce_opengl.cpp" 173 | $(V_AT)$(CXX) $(JUCE_CXXFLAGS) $(JUCE_CPPFLAGS_APP) $(JUCE_CFLAGS_APP) -o "$@" -c "$<" 174 | 175 | clean: 176 | @echo Cleaning tgtracker 177 | $(V_AT)$(CLEANCMD) 178 | 179 | strip: 180 | @echo Stripping tgtracker 181 | -$(V_AT)$(STRIP) --strip-unneeded $(JUCE_OUTDIR)/$(TARGET) 182 | 183 | -include $(OBJECTS_APP:%.o=%.d) 184 | -------------------------------------------------------------------------------- /cmake/modules/FindLua.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | FindLua 6 | ------- 7 | 8 | 9 | 10 | Locate Lua library. 11 | 12 | This module defines:: 13 | 14 | :: 15 | 16 | LUA_FOUND - if false, do not try to link to Lua 17 | LUA_LIBRARIES - both lua and lualib 18 | LUA_INCLUDE_DIR - where to find lua.h 19 | LUA_VERSION_STRING - the version of Lua found 20 | LUA_VERSION_MAJOR - the major version of Lua 21 | LUA_VERSION_MINOR - the minor version of Lua 22 | LUA_VERSION_PATCH - the patch version of Lua 23 | 24 | 25 | 26 | Note that the expected include convention is 27 | 28 | :: 29 | 30 | #include "lua.h" 31 | 32 | and not 33 | 34 | :: 35 | 36 | #include 37 | 38 | This is because, the lua location is not standardized and may exist in 39 | locations other than lua/ 40 | #]=======================================================================] 41 | 42 | cmake_policy(PUSH) # Policies apply to functions at definition-time 43 | cmake_policy(SET CMP0012 NEW) # For while(TRUE) 44 | 45 | unset(_lua_include_subdirs) 46 | unset(_lua_library_names) 47 | unset(_lua_append_versions) 48 | 49 | # this is a function only to have all the variables inside go away automatically 50 | function(_lua_get_versions) 51 | set(LUA_VERSIONS5 5.3 5.2 5.1 5.0) 52 | 53 | if (Lua_FIND_VERSION_EXACT) 54 | if (Lua_FIND_VERSION_COUNT GREATER 1) 55 | set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}) 56 | endif () 57 | elseif (Lua_FIND_VERSION) 58 | # once there is a different major version supported this should become a loop 59 | if (NOT Lua_FIND_VERSION_MAJOR GREATER 5) 60 | if (Lua_FIND_VERSION_COUNT EQUAL 1) 61 | set(_lua_append_versions ${LUA_VERSIONS5}) 62 | else () 63 | foreach (subver IN LISTS LUA_VERSIONS5) 64 | if (NOT subver VERSION_LESS ${Lua_FIND_VERSION}) 65 | list(APPEND _lua_append_versions ${subver}) 66 | endif () 67 | endforeach () 68 | # New version -> Search for it (heuristic only! Defines in include might have changed) 69 | if (NOT _lua_append_versions) 70 | set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}) 71 | endif() 72 | endif () 73 | endif () 74 | else () 75 | # once there is a different major version supported this should become a loop 76 | set(_lua_append_versions ${LUA_VERSIONS5}) 77 | endif () 78 | 79 | if (LUA_Debug) 80 | message(STATUS "Considering following Lua versions: ${_lua_append_versions}") 81 | endif() 82 | 83 | set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE) 84 | endfunction() 85 | 86 | function(_lua_set_version_vars) 87 | set(_lua_include_subdirs_raw "lua") 88 | 89 | foreach (ver IN LISTS _lua_append_versions) 90 | string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}") 91 | list(APPEND _lua_include_subdirs_raw 92 | lua${CMAKE_MATCH_1}${CMAKE_MATCH_2} 93 | lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2} 94 | lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} 95 | ) 96 | endforeach () 97 | 98 | # Prepend "include/" to each path directly after the path 99 | set(_lua_include_subdirs "include") 100 | foreach (dir IN LISTS _lua_include_subdirs_raw) 101 | list(APPEND _lua_include_subdirs "${dir}" "include/${dir}") 102 | endforeach () 103 | 104 | set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE) 105 | endfunction(_lua_set_version_vars) 106 | 107 | function(_lua_get_header_version) 108 | unset(LUA_VERSION_STRING PARENT_SCOPE) 109 | set(_hdr_file "${LUA_INCLUDE_DIR}/lua.h") 110 | 111 | if (NOT EXISTS "${_hdr_file}") 112 | return() 113 | endif () 114 | 115 | # At least 5.[012] have different ways to express the version 116 | # so all of them need to be tested. Lua 5.2 defines LUA_VERSION 117 | # and LUA_RELEASE as joined by the C preprocessor, so avoid those. 118 | file(STRINGS "${_hdr_file}" lua_version_strings 119 | REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") 120 | 121 | string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};") 122 | if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$") 123 | string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};") 124 | string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};") 125 | set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") 126 | else () 127 | string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") 128 | if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$") 129 | string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") 130 | endif () 131 | string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}") 132 | string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}") 133 | string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}") 134 | endif () 135 | foreach (ver IN LISTS _lua_append_versions) 136 | if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") 137 | set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE) 138 | set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE) 139 | set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE) 140 | set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE) 141 | return() 142 | endif () 143 | endforeach () 144 | endfunction(_lua_get_header_version) 145 | 146 | function(_lua_find_header) 147 | _lua_set_version_vars() 148 | 149 | # Initialize as local variable 150 | set(CMAKE_IGNORE_PATH ${CMAKE_IGNORE_PATH}) 151 | while (TRUE) 152 | # Find the next header to test. Check each possible subdir in order 153 | # This prefers e.g. higher versions as they are earlier in the list 154 | # It is also consistent with previous versions of FindLua 155 | foreach (subdir IN LISTS _lua_include_subdirs) 156 | find_path(LUA_INCLUDE_DIR lua.h 157 | HINTS ENV LUA_DIR 158 | PATH_SUFFIXES ${subdir} 159 | ) 160 | if (LUA_INCLUDE_DIR) 161 | break() 162 | endif() 163 | endforeach() 164 | # Did not found header -> Fail 165 | if (NOT LUA_INCLUDE_DIR) 166 | return() 167 | endif() 168 | _lua_get_header_version() 169 | # Found accepted version -> Ok 170 | if (LUA_VERSION_STRING) 171 | if (LUA_Debug) 172 | message(STATUS "Found suitable version ${LUA_VERSION_STRING} in ${LUA_INCLUDE_DIR}/lua.h") 173 | endif() 174 | return() 175 | endif() 176 | # Found wrong version -> Ignore this path and retry 177 | if (LUA_Debug) 178 | message(STATUS "Ignoring unsuitable version in ${LUA_INCLUDE_DIR}") 179 | endif() 180 | list(APPEND CMAKE_IGNORE_PATH "${LUA_INCLUDE_DIR}") 181 | unset(LUA_INCLUDE_DIR CACHE) 182 | unset(LUA_INCLUDE_DIR) 183 | unset(LUA_INCLUDE_DIR PARENT_SCOPE) 184 | endwhile () 185 | endfunction() 186 | 187 | _lua_get_versions() 188 | _lua_find_header() 189 | _lua_get_header_version() 190 | unset(_lua_append_versions) 191 | 192 | if (LUA_VERSION_STRING) 193 | set(_lua_library_names 194 | lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR} 195 | lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} 196 | lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} 197 | lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} 198 | ) 199 | endif () 200 | 201 | find_library(LUA_LIBRARY 202 | NAMES ${_lua_library_names} lua 203 | NAMES_PER_DIR 204 | HINTS 205 | ENV LUA_DIR 206 | PATH_SUFFIXES lib 207 | ) 208 | unset(_lua_library_names) 209 | 210 | if (LUA_LIBRARY) 211 | # include the math library for Unix 212 | if (UNIX AND NOT APPLE AND NOT BEOS) 213 | find_library(LUA_MATH_LIBRARY m) 214 | mark_as_advanced(LUA_MATH_LIBRARY) 215 | set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") 216 | 217 | # include dl library for statically-linked Lua library 218 | get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT) 219 | if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX) 220 | list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS}) 221 | endif() 222 | 223 | # For Windows and Mac, don't need to explicitly include the math library 224 | else () 225 | set(LUA_LIBRARIES "${LUA_LIBRARY}") 226 | endif () 227 | endif () 228 | 229 | include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) 230 | # handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if 231 | # all listed variables are TRUE 232 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua 233 | REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR 234 | VERSION_VAR LUA_VERSION_STRING) 235 | 236 | mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY) 237 | 238 | cmake_policy(POP) 239 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Application-specific code is dual licensed, Apache2.0 or MIT, whichever suits your needs best. The 2 | awesome libraries used are each their own respective licenses. 3 | 4 | Apache License 5 | Version 2.0, January 2004 6 | [https://www.apache.org/licenses/](https://www.apache.org/licenses/) 7 | 8 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 9 | 10 | 1. Definitions. 11 | 12 | "License" shall mean the terms and conditions for use, reproduction, 13 | and distribution as defined by Sections 1 through 9 of this document. 14 | 15 | "Licensor" shall mean the copyright owner or entity authorized by 16 | the copyright owner that is granting the License. 17 | 18 | "Legal Entity" shall mean the union of the acting entity and all 19 | other entities that control, are controlled by, or are under common 20 | control with that entity. For the purposes of this definition, 21 | "control" means (i) the power, direct or indirect, to cause the 22 | direction or management of such entity, whether by contract or 23 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 24 | outstanding shares, or (iii) beneficial ownership of such entity. 25 | 26 | "You" (or "Your") shall mean an individual or Legal Entity 27 | exercising permissions granted by this License. 28 | 29 | "Source" form shall mean the preferred form for making modifications, 30 | including but not limited to software source code, documentation 31 | source, and configuration files. 32 | 33 | "Object" form shall mean any form resulting from mechanical 34 | transformation or translation of a Source form, including but 35 | not limited to compiled object code, generated documentation, 36 | and conversions to other media types. 37 | 38 | "Work" shall mean the work of authorship, whether in Source or 39 | Object form, made available under the License, as indicated by a 40 | copyright notice that is included in or attached to the work 41 | (an example is provided in the Appendix below). 42 | 43 | "Derivative Works" shall mean any work, whether in Source or Object 44 | form, that is based on (or derived from) the Work and for which the 45 | editorial revisions, annotations, elaborations, or other modifications 46 | represent, as a whole, an original work of authorship. For the purposes 47 | of this License, Derivative Works shall not include works that remain 48 | separable from, or merely link (or bind by name) to the interfaces of, 49 | the Work and Derivative Works thereof. 50 | 51 | "Contribution" shall mean any work of authorship, including 52 | the original version of the Work and any modifications or additions 53 | to that Work or Derivative Works thereof, that is intentionally 54 | submitted to Licensor for inclusion in the Work by the copyright owner 55 | or by an individual or Legal Entity authorized to submit on behalf of 56 | the copyright owner. For the purposes of this definition, "submitted" 57 | means any form of electronic, verbal, or written communication sent 58 | to the Licensor or its representatives, including but not limited to 59 | communication on electronic mailing lists, source code control systems, 60 | and issue tracking systems that are managed by, or on behalf of, the 61 | Licensor for the purpose of discussing and improving the Work, but 62 | excluding communication that is conspicuously marked or otherwise 63 | designated in writing by the copyright owner as "Not a Contribution." 64 | 65 | "Contributor" shall mean Licensor and any individual or Legal Entity 66 | on behalf of whom a Contribution has been received by Licensor and 67 | subsequently incorporated within the Work. 68 | 69 | 2. Grant of Copyright License. Subject to the terms and conditions of 70 | this License, each Contributor hereby grants to You a perpetual, 71 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 72 | copyright license to reproduce, prepare Derivative Works of, 73 | publicly display, publicly perform, sublicense, and distribute the 74 | Work and such Derivative Works in Source or Object form. 75 | 76 | 3. Grant of Patent License. Subject to the terms and conditions of 77 | this License, each Contributor hereby grants to You a perpetual, 78 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 79 | (except as stated in this section) patent license to make, have made, 80 | use, offer to sell, sell, import, and otherwise transfer the Work, 81 | where such license applies only to those patent claims licensable 82 | by such Contributor that are necessarily infringed by their 83 | Contribution(s) alone or by combination of their Contribution(s) 84 | with the Work to which such Contribution(s) was submitted. If You 85 | institute patent litigation against any entity (including a 86 | cross-claim or counterclaim in a lawsuit) alleging that the Work 87 | or a Contribution incorporated within the Work constitutes direct 88 | or contributory patent infringement, then any patent licenses 89 | granted to You under this License for that Work shall terminate 90 | as of the date such litigation is filed. 91 | 92 | 4. Redistribution. You may reproduce and distribute copies of the 93 | Work or Derivative Works thereof in any medium, with or without 94 | modifications, and in Source or Object form, provided that You 95 | meet the following conditions: 96 | 97 | (a) You must give any other recipients of the Work or 98 | Derivative Works a copy of this License; and 99 | 100 | (b) You must cause any modified files to carry prominent notices 101 | stating that You changed the files; and 102 | 103 | (c) You must retain, in the Source form of any Derivative Works 104 | that You distribute, all copyright, patent, trademark, and 105 | attribution notices from the Source form of the Work, 106 | excluding those notices that do not pertain to any part of 107 | the Derivative Works; and 108 | 109 | (d) If the Work includes a "NOTICE" text file as part of its 110 | distribution, then any Derivative Works that You distribute must 111 | include a readable copy of the attribution notices contained 112 | within such NOTICE file, excluding those notices that do not 113 | pertain to any part of the Derivative Works, in at least one 114 | of the following places: within a NOTICE text file distributed 115 | as part of the Derivative Works; within the Source form or 116 | documentation, if provided along with the Derivative Works; or, 117 | within a display generated by the Derivative Works, if and 118 | wherever such third-party notices normally appear. The contents 119 | of the NOTICE file are for informational purposes only and 120 | do not modify the License. You may add Your own attribution 121 | notices within Derivative Works that You distribute, alongside 122 | or as an addendum to the NOTICE text from the Work, provided 123 | that such additional attribution notices cannot be construed 124 | as modifying the License. 125 | 126 | You may add Your own copyright statement to Your modifications and 127 | may provide additional or different license terms and conditions 128 | for use, reproduction, or distribution of Your modifications, or 129 | for any such Derivative Works as a whole, provided Your use, 130 | reproduction, and distribution of the Work otherwise complies with 131 | the conditions stated in this License. 132 | 133 | 5. Submission of Contributions. Unless You explicitly state otherwise, 134 | any Contribution intentionally submitted for inclusion in the Work 135 | by You to the Licensor shall be under the terms and conditions of 136 | this License, without any additional terms or conditions. 137 | Notwithstanding the above, nothing herein shall supersede or modify 138 | the terms of any separate license agreement you may have executed 139 | with Licensor regarding such Contributions. 140 | 141 | 6. Trademarks. This License does not grant permission to use the trade 142 | names, trademarks, service marks, or product names of the Licensor, 143 | except as required for reasonable and customary use in describing the 144 | origin of the Work and reproducing the content of the NOTICE file. 145 | 146 | 7. Disclaimer of Warranty. Unless required by applicable law or 147 | agreed to in writing, Licensor provides the Work (and each 148 | Contributor provides its Contributions) on an "AS IS" BASIS, 149 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 150 | implied, including, without limitation, any warranties or conditions 151 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 152 | PARTICULAR PURPOSE. You are solely responsible for determining the 153 | appropriateness of using or redistributing the Work and assume any 154 | risks associated with Your exercise of permissions under this License. 155 | 156 | 8. Limitation of Liability. In no event and under no legal theory, 157 | whether in tort (including negligence), contract, or otherwise, 158 | unless required by applicable law (such as deliberate and grossly 159 | negligent acts) or agreed to in writing, shall any Contributor be 160 | liable to You for damages, including any direct, indirect, special, 161 | incidental, or consequential damages of any character arising as a 162 | result of this License or out of the use or inability to use the 163 | Work (including but not limited to damages for loss of goodwill, 164 | work stoppage, computer failure or malfunction, or any and all 165 | other commercial damages or losses), even if such Contributor 166 | has been advised of the possibility of such damages. 167 | 168 | 9. Accepting Warranty or Additional Liability. While redistributing 169 | the Work or Derivative Works thereof, You may choose to offer, 170 | and charge a fee for, acceptance of support, warranty, indemnity, 171 | or other liability obligations and/or rights consistent with this 172 | License. However, in accepting such obligations, You may act only 173 | on Your own behalf and on Your sole responsibility, not on behalf 174 | of any other Contributor, and only if You agree to indemnify, 175 | defend, and hold each Contributor harmless for any liability 176 | incurred by, or claims asserted against, such Contributor by reason 177 | of your accepting any such warranty or additional liability. 178 | 179 | END OF TERMS AND CONDITIONS 180 | 181 | APPENDIX: How to apply the Apache License to your work. 182 | 183 | To apply the Apache License to your work, attach the following 184 | boilerplate notice, with the fields enclosed by brackets "[]" 185 | replaced with your own identifying information. (Don't include 186 | the brackets!) The text should be enclosed in the appropriate 187 | comment syntax for the file format. We also recommend that a 188 | file or class name and description of purpose be included on the 189 | same "printed page" as the copyright notice for easier 190 | identification within third-party archives. 191 | 192 | Copyright 2019-2020 Andrew Prentice 193 | 194 | Licensed under the Apache License, Version 2.0 (the "License"); 195 | you may not use this file except in compliance with the License. 196 | You may obtain a copy of the License at 197 | 198 | [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) 199 | 200 | Unless required by applicable law or agreed to in writing, software 201 | distributed under the License is distributed on an "AS IS" BASIS, 202 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 203 | See the License for the specific language governing permissions and 204 | limitations under the License. 205 | 206 | OR 207 | 208 | MIT License 209 | 210 | Copyright (c) 2019-2020 Andrew Prentice 211 | 212 | Permission is hereby granted, free of charge, to any person obtaining a copy 213 | of this software and associated documentation files (the "Software"), to deal 214 | in the Software without restriction, including without limitation the rights 215 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 216 | copies of the Software, and to permit persons to whom the Software is 217 | furnished to do so, subject to the following conditions: 218 | 219 | The above copyright notice and this permission notice shall be included in all 220 | copies or substantial portions of the Software. 221 | 222 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 223 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 224 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 225 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 226 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 227 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 228 | SOFTWARE. 229 | -------------------------------------------------------------------------------- /cmake/modules/InstallRequiredSystemLibraries.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | InstallRequiredSystemLibraries 6 | ------------------------------ 7 | 8 | Include this module to search for compiler-provided system runtime 9 | libraries and add install rules for them. Some optional variables 10 | may be set prior to including the module to adjust behavior: 11 | 12 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` 13 | Specify additional runtime libraries that may not be detected. 14 | After inclusion any detected libraries will be appended to this. 15 | 16 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP`` 17 | Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to 18 | allow the includer to specify its own install rule, using the value of 19 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries. 20 | 21 | ``CMAKE_INSTALL_DEBUG_LIBRARIES`` 22 | Set to TRUE to install the debug runtime libraries when available 23 | with MSVC tools. 24 | 25 | ``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY`` 26 | Set to TRUE to install only the debug runtime libraries with MSVC 27 | tools even if the release runtime libraries are also available. 28 | 29 | ``CMAKE_INSTALL_UCRT_LIBRARIES`` 30 | Set to TRUE to install the Windows Universal CRT libraries for 31 | app-local deployment (e.g. to Windows XP). This is meaningful 32 | only with MSVC from Visual Studio 2015 or higher. 33 | 34 | One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable* 35 | to an absolute path to tell CMake to look for Windows 10 SDKs in 36 | a custom location. The specified directory is expected to contain 37 | ``Redist/ucrt/DLLs/*`` directories. 38 | 39 | ``CMAKE_INSTALL_MFC_LIBRARIES`` 40 | Set to TRUE to install the MSVC MFC runtime libraries. 41 | 42 | ``CMAKE_INSTALL_OPENMP_LIBRARIES`` 43 | Set to TRUE to install the MSVC OpenMP runtime libraries 44 | 45 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION`` 46 | Specify the :command:`install(PROGRAMS)` command ``DESTINATION`` 47 | option. If not specified, the default is ``bin`` on Windows 48 | and ``lib`` elsewhere. 49 | 50 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS`` 51 | Set to TRUE to disable warnings about required library files that 52 | do not exist. (For example, Visual Studio Express editions may 53 | not provide the redistributable files.) 54 | 55 | ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT`` 56 | Specify the :command:`install(PROGRAMS)` command ``COMPONENT`` 57 | option. If not specified, no such option will be used. 58 | #]=======================================================================] 59 | 60 | cmake_policy(PUSH) 61 | cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced 62 | 63 | set(_IRSL_HAVE_Intel FALSE) 64 | set(_IRSL_HAVE_MSVC FALSE) 65 | foreach(LANG IN ITEMS C CXX Fortran) 66 | if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel") 67 | if(NOT _IRSL_HAVE_Intel) 68 | get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH) 69 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 70 | set(_Intel_archdir intel64) 71 | else() 72 | set(_Intel_archdir x86) 73 | endif() 74 | set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION}) 75 | if(WIN32) 76 | get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE) 77 | elseif(APPLE) 78 | get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE) 79 | else() 80 | if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin") 81 | get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE) 82 | else() 83 | get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE) 84 | endif() 85 | endif() 86 | set(_IRSL_HAVE_Intel TRUE) 87 | endif() 88 | elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC") 89 | set(_IRSL_HAVE_MSVC TRUE) 90 | endif() 91 | endforeach() 92 | 93 | if(MSVC) 94 | file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT) 95 | 96 | if(CMAKE_CL_64) 97 | if(MSVC_VERSION GREATER 1599) 98 | # VS 10 and later: 99 | set(CMAKE_MSVC_ARCH x64) 100 | else() 101 | # VS 9 and earlier: 102 | set(CMAKE_MSVC_ARCH amd64) 103 | endif() 104 | else() 105 | set(CMAKE_MSVC_ARCH x86) 106 | endif() 107 | 108 | get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH) 109 | get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE) 110 | 111 | if(MSVC_VERSION EQUAL 1300) 112 | set(__install__libs 113 | "${SYSTEMROOT}/system32/msvcp70.dll" 114 | "${SYSTEMROOT}/system32/msvcr70.dll" 115 | ) 116 | endif() 117 | 118 | if(MSVC_VERSION EQUAL 1310) 119 | set(__install__libs 120 | "${SYSTEMROOT}/system32/msvcp71.dll" 121 | "${SYSTEMROOT}/system32/msvcr71.dll" 122 | ) 123 | endif() 124 | 125 | if(MSVC_TOOLSET_VERSION EQUAL 80) 126 | # Find the runtime library redistribution directory. 127 | get_filename_component(msvc_install_dir 128 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE) 129 | if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}") 130 | set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry 131 | endif() 132 | find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest 133 | PATHS 134 | "${msvc_install_dir}/../../VC/redist" 135 | "${base_dir}/VC/redist" 136 | ) 137 | mark_as_advanced(MSVC_REDIST_DIR) 138 | set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT") 139 | 140 | # Install the manifest that allows DLLs to be loaded from the 141 | # directory containing the executable. 142 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 143 | set(__install__libs 144 | "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest" 145 | "${MSVC_CRT_DIR}/msvcm80.dll" 146 | "${MSVC_CRT_DIR}/msvcp80.dll" 147 | "${MSVC_CRT_DIR}/msvcr80.dll" 148 | ) 149 | else() 150 | set(__install__libs) 151 | endif() 152 | 153 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 154 | set(MSVC_CRT_DIR 155 | "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT") 156 | set(__install__libs ${__install__libs} 157 | "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest" 158 | "${MSVC_CRT_DIR}/msvcm80d.dll" 159 | "${MSVC_CRT_DIR}/msvcp80d.dll" 160 | "${MSVC_CRT_DIR}/msvcr80d.dll" 161 | ) 162 | endif() 163 | endif() 164 | 165 | if(MSVC_TOOLSET_VERSION EQUAL 90) 166 | # Find the runtime library redistribution directory. 167 | get_filename_component(msvc_install_dir 168 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE) 169 | get_filename_component(msvc_express_install_dir 170 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE) 171 | if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}") 172 | set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry 173 | endif() 174 | find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest 175 | PATHS 176 | "${msvc_install_dir}/../../VC/redist" 177 | "${msvc_express_install_dir}/../../VC/redist" 178 | "${base_dir}/VC/redist" 179 | ) 180 | mark_as_advanced(MSVC_REDIST_DIR) 181 | set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT") 182 | 183 | # Install the manifest that allows DLLs to be loaded from the 184 | # directory containing the executable. 185 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 186 | set(__install__libs 187 | "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest" 188 | "${MSVC_CRT_DIR}/msvcm90.dll" 189 | "${MSVC_CRT_DIR}/msvcp90.dll" 190 | "${MSVC_CRT_DIR}/msvcr90.dll" 191 | ) 192 | else() 193 | set(__install__libs) 194 | endif() 195 | 196 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 197 | set(MSVC_CRT_DIR 198 | "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT") 199 | set(__install__libs ${__install__libs} 200 | "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest" 201 | "${MSVC_CRT_DIR}/msvcm90d.dll" 202 | "${MSVC_CRT_DIR}/msvcp90d.dll" 203 | "${MSVC_CRT_DIR}/msvcr90d.dll" 204 | ) 205 | endif() 206 | endif() 207 | 208 | set(MSVC_REDIST_NAME "") 209 | set(_MSVC_DLL_VERSION "") 210 | set(_MSVC_IDE_VERSION "") 211 | if(MSVC_VERSION GREATER_EQUAL 2000) 212 | message(WARNING "MSVC ${MSVC_VERSION} not yet supported.") 213 | elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 143) 214 | message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.") 215 | elseif(MSVC_TOOLSET_VERSION EQUAL 142) 216 | set(MSVC_REDIST_NAME VC142) 217 | set(_MSVC_DLL_VERSION 140) 218 | set(_MSVC_IDE_VERSION 16) 219 | if(MSVC_VERSION EQUAL 1920) 220 | # VS2019 named this differently prior to update 1. 221 | set(MSVC_REDIST_NAME VC141) 222 | endif() 223 | elseif(MSVC_TOOLSET_VERSION EQUAL 141) 224 | set(MSVC_REDIST_NAME VC141) 225 | set(_MSVC_DLL_VERSION 140) 226 | set(_MSVC_IDE_VERSION 15) 227 | if(MSVC_VERSION EQUAL 1910) 228 | # VS2017 named this differently prior to update 3. 229 | set(MSVC_REDIST_NAME VC150) 230 | endif() 231 | elseif(MSVC_TOOLSET_VERSION) 232 | set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION}) 233 | math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10") 234 | math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10") 235 | endif() 236 | 237 | set(_MSVCRT_DLL_VERSION "") 238 | set(_MSVCRT_IDE_VERSION "") 239 | if(_MSVC_IDE_VERSION GREATER_EQUAL 10) 240 | set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}") 241 | set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}") 242 | endif() 243 | 244 | if(_MSVCRT_DLL_VERSION) 245 | set(v "${_MSVCRT_DLL_VERSION}") 246 | set(vs "${_MSVCRT_IDE_VERSION}") 247 | 248 | # Find the runtime library redistribution directory. 249 | if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}") 250 | set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry 251 | endif() 252 | if(NOT vs VERSION_LESS 15) 253 | set(_vs_redist_paths "") 254 | # The toolset and its redistributables may come with any VS version 15 or newer. 255 | set(_MSVC_IDE_VERSIONS 16 15) 256 | foreach(_vs_ver ${_MSVC_IDE_VERSIONS}) 257 | set(_vs_glob_redist_paths "") 258 | cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query 259 | if(IS_DIRECTORY "${_vs_dir}") 260 | file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*") 261 | list(REVERSE _vs_glob_redist_paths) 262 | list(APPEND _vs_redist_paths ${_vs_glob_redist_paths}) 263 | endif() 264 | unset(_vs_glob_redist_paths) 265 | endforeach() 266 | unset(_MSVC_IDE_VERSIONS) 267 | unset(_vs_dir) 268 | else() 269 | get_filename_component(_vs_dir 270 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE) 271 | set(programfilesx86 "ProgramFiles(x86)") 272 | set(_vs_redist_paths 273 | "${_vs_dir}/../../VC/redist" 274 | "${base_dir}/VC/redist" 275 | "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist" 276 | "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist" 277 | ) 278 | unset(_vs_dir) 279 | unset(programfilesx86) 280 | endif() 281 | find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths}) 282 | unset(_vs_redist_paths) 283 | mark_as_advanced(MSVC_REDIST_DIR) 284 | set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT") 285 | 286 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 287 | set(__install__libs 288 | "${MSVC_CRT_DIR}/msvcp${v}.dll" 289 | ) 290 | if(NOT vs VERSION_LESS 14) 291 | foreach(crt 292 | "${MSVC_CRT_DIR}/msvcp${v}_1.dll" 293 | "${MSVC_CRT_DIR}/msvcp${v}_2.dll" 294 | "${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll" 295 | "${MSVC_CRT_DIR}/vcruntime${v}_1.dll" 296 | ) 297 | if(EXISTS "${crt}") 298 | list(APPEND __install__libs "${crt}") 299 | endif() 300 | endforeach() 301 | list(APPEND __install__libs 302 | "${MSVC_CRT_DIR}/vcruntime${v}.dll" 303 | "${MSVC_CRT_DIR}/concrt${v}.dll" 304 | ) 305 | else() 306 | list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll") 307 | endif() 308 | else() 309 | set(__install__libs) 310 | endif() 311 | 312 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 313 | set(MSVC_CRT_DIR 314 | "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT") 315 | set(__install__libs ${__install__libs} 316 | "${MSVC_CRT_DIR}/msvcp${v}d.dll" 317 | ) 318 | if(NOT vs VERSION_LESS 14) 319 | foreach(crt 320 | "${MSVC_CRT_DIR}/msvcp${v}_1d.dll" 321 | "${MSVC_CRT_DIR}/msvcp${v}_2d.dll" 322 | "${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll" 323 | "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll" 324 | ) 325 | if(EXISTS "${crt}") 326 | list(APPEND __install__libs "${crt}") 327 | endif() 328 | endforeach() 329 | list(APPEND __install__libs 330 | "${MSVC_CRT_DIR}/vcruntime${v}d.dll" 331 | "${MSVC_CRT_DIR}/concrt${v}d.dll" 332 | ) 333 | else() 334 | list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll") 335 | endif() 336 | endif() 337 | 338 | if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14) 339 | # Find the Windows Kits directory. 340 | get_filename_component(windows_kits_dir 341 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE) 342 | set(programfilesx86 "ProgramFiles(x86)") 343 | if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=]) 344 | set(__ucrt_version "${CMAKE_MATCH_1}/") 345 | else() 346 | set(__ucrt_version "") 347 | endif() 348 | find_path(WINDOWS_KITS_DIR 349 | NAMES 350 | Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll 351 | Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll 352 | PATHS 353 | $ENV{CMAKE_WINDOWS_KITS_10_DIR} 354 | "${windows_kits_dir}" 355 | "$ENV{ProgramFiles}/Windows Kits/10" 356 | "$ENV{${programfilesx86}}/Windows Kits/10" 357 | ) 358 | mark_as_advanced(WINDOWS_KITS_DIR) 359 | 360 | # Glob the list of UCRT DLLs. 361 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 362 | if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll") 363 | file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") 364 | else() 365 | file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll") 366 | endif() 367 | list(APPEND __install__libs ${__ucrt_dlls}) 368 | endif() 369 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 370 | if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll") 371 | file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll") 372 | else() 373 | file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll") 374 | endif() 375 | list(APPEND __install__libs ${__ucrt_dlls}) 376 | endif() 377 | endif() 378 | endif() 379 | 380 | if(CMAKE_INSTALL_MFC_LIBRARIES) 381 | if(MSVC_VERSION EQUAL 1300) 382 | set(__install__libs ${__install__libs} 383 | "${SYSTEMROOT}/system32/mfc70.dll" 384 | ) 385 | endif() 386 | 387 | if(MSVC_VERSION EQUAL 1310) 388 | set(__install__libs ${__install__libs} 389 | "${SYSTEMROOT}/system32/mfc71.dll" 390 | ) 391 | endif() 392 | 393 | if(MSVC_VERSION EQUAL 1400) 394 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 395 | set(MSVC_MFC_DIR 396 | "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC") 397 | set(__install__libs ${__install__libs} 398 | "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest" 399 | "${MSVC_MFC_DIR}/mfc80d.dll" 400 | "${MSVC_MFC_DIR}/mfc80ud.dll" 401 | "${MSVC_MFC_DIR}/mfcm80d.dll" 402 | "${MSVC_MFC_DIR}/mfcm80ud.dll" 403 | ) 404 | endif() 405 | 406 | set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC") 407 | # Install the manifest that allows DLLs to be loaded from the 408 | # directory containing the executable. 409 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 410 | set(__install__libs ${__install__libs} 411 | "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest" 412 | "${MSVC_MFC_DIR}/mfc80.dll" 413 | "${MSVC_MFC_DIR}/mfc80u.dll" 414 | "${MSVC_MFC_DIR}/mfcm80.dll" 415 | "${MSVC_MFC_DIR}/mfcm80u.dll" 416 | ) 417 | endif() 418 | 419 | # include the language dll's for vs8 as well as the actual dll's 420 | set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC") 421 | # Install the manifest that allows DLLs to be loaded from the 422 | # directory containing the executable. 423 | set(__install__libs ${__install__libs} 424 | "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest" 425 | "${MSVC_MFCLOC_DIR}/mfc80chs.dll" 426 | "${MSVC_MFCLOC_DIR}/mfc80cht.dll" 427 | "${MSVC_MFCLOC_DIR}/mfc80enu.dll" 428 | "${MSVC_MFCLOC_DIR}/mfc80esp.dll" 429 | "${MSVC_MFCLOC_DIR}/mfc80deu.dll" 430 | "${MSVC_MFCLOC_DIR}/mfc80fra.dll" 431 | "${MSVC_MFCLOC_DIR}/mfc80ita.dll" 432 | "${MSVC_MFCLOC_DIR}/mfc80jpn.dll" 433 | "${MSVC_MFCLOC_DIR}/mfc80kor.dll" 434 | ) 435 | endif() 436 | 437 | if(MSVC_VERSION EQUAL 1500) 438 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 439 | set(MSVC_MFC_DIR 440 | "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC") 441 | set(__install__libs ${__install__libs} 442 | "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest" 443 | "${MSVC_MFC_DIR}/mfc90d.dll" 444 | "${MSVC_MFC_DIR}/mfc90ud.dll" 445 | "${MSVC_MFC_DIR}/mfcm90d.dll" 446 | "${MSVC_MFC_DIR}/mfcm90ud.dll" 447 | ) 448 | endif() 449 | 450 | set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC") 451 | # Install the manifest that allows DLLs to be loaded from the 452 | # directory containing the executable. 453 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 454 | set(__install__libs ${__install__libs} 455 | "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest" 456 | "${MSVC_MFC_DIR}/mfc90.dll" 457 | "${MSVC_MFC_DIR}/mfc90u.dll" 458 | "${MSVC_MFC_DIR}/mfcm90.dll" 459 | "${MSVC_MFC_DIR}/mfcm90u.dll" 460 | ) 461 | endif() 462 | 463 | # include the language dll's for vs9 as well as the actual dll's 464 | set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC") 465 | # Install the manifest that allows DLLs to be loaded from the 466 | # directory containing the executable. 467 | set(__install__libs ${__install__libs} 468 | "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest" 469 | "${MSVC_MFCLOC_DIR}/mfc90chs.dll" 470 | "${MSVC_MFCLOC_DIR}/mfc90cht.dll" 471 | "${MSVC_MFCLOC_DIR}/mfc90enu.dll" 472 | "${MSVC_MFCLOC_DIR}/mfc90esp.dll" 473 | "${MSVC_MFCLOC_DIR}/mfc90deu.dll" 474 | "${MSVC_MFCLOC_DIR}/mfc90fra.dll" 475 | "${MSVC_MFCLOC_DIR}/mfc90ita.dll" 476 | "${MSVC_MFCLOC_DIR}/mfc90jpn.dll" 477 | "${MSVC_MFCLOC_DIR}/mfc90kor.dll" 478 | ) 479 | endif() 480 | 481 | set(_MFC_DLL_VERSION "") 482 | set(_MFC_IDE_VERSION "") 483 | if(_MSVC_IDE_VERSION GREATER_EQUAL 10) 484 | set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION}) 485 | set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION}) 486 | endif() 487 | 488 | if(_MFC_DLL_VERSION) 489 | set(v "${_MFC_DLL_VERSION}") 490 | set(vs "${_MFC_IDE_VERSION}") 491 | 492 | # Starting with VS 15 the MFC DLLs may be in a different directory. 493 | if (NOT vs VERSION_LESS 15) 494 | file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*") 495 | find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC 496 | PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH) 497 | mark_as_advanced(MSVC_REDIST_MFC_DIR) 498 | unset(_MSVC_REDIST_DIRS) 499 | else() 500 | set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}") 501 | endif() 502 | 503 | # Multi-Byte Character Set versions of MFC are available as optional 504 | # addon since Visual Studio 12. So for version 12 or higher, check 505 | # whether they are available and exclude them if they are not. 506 | 507 | if(CMAKE_INSTALL_DEBUG_LIBRARIES) 508 | set(MSVC_MFC_DIR 509 | "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC") 510 | set(__install__libs ${__install__libs} 511 | "${MSVC_MFC_DIR}/mfc${v}ud.dll" 512 | "${MSVC_MFC_DIR}/mfcm${v}ud.dll" 513 | ) 514 | if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll") 515 | set(__install__libs ${__install__libs} 516 | "${MSVC_MFC_DIR}/mfc${v}d.dll" 517 | ) 518 | endif() 519 | if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll") 520 | set(__install__libs ${__install__libs} 521 | "${MSVC_MFC_DIR}/mfcm${v}d.dll" 522 | ) 523 | endif() 524 | endif() 525 | 526 | set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC") 527 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 528 | set(__install__libs ${__install__libs} 529 | "${MSVC_MFC_DIR}/mfc${v}u.dll" 530 | "${MSVC_MFC_DIR}/mfcm${v}u.dll" 531 | ) 532 | if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll") 533 | set(__install__libs ${__install__libs} 534 | "${MSVC_MFC_DIR}/mfc${v}.dll" 535 | ) 536 | endif() 537 | if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll") 538 | set(__install__libs ${__install__libs} 539 | "${MSVC_MFC_DIR}/mfcm${v}.dll" 540 | ) 541 | endif() 542 | endif() 543 | 544 | # include the language dll's as well as the actual dll's 545 | set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC") 546 | set(__install__libs ${__install__libs} 547 | "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll" 548 | "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll" 549 | "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll" 550 | "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll" 551 | "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll" 552 | "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll" 553 | "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll" 554 | "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll" 555 | "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll" 556 | "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll" 557 | ) 558 | endif() 559 | endif() 560 | 561 | # MSVC 8 was the first version with OpenMP 562 | # Furthermore, there is no debug version of this 563 | if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC) 564 | set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION}) 565 | set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION}) 566 | 567 | if(_MSOMP_DLL_VERSION) 568 | set(v "${_MSOMP_DLL_VERSION}") 569 | set(vs "${_MSOMP_IDE_VERSION}") 570 | set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP") 571 | 572 | if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) 573 | set(__install__libs ${__install__libs} 574 | "${MSVC_OPENMP_DIR}/vcomp${v}.dll") 575 | endif() 576 | endif() 577 | endif() 578 | 579 | foreach(lib 580 | ${__install__libs} 581 | ) 582 | if(EXISTS ${lib}) 583 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS 584 | ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) 585 | else() 586 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) 587 | message(WARNING "system runtime library file does not exist: '${lib}'") 588 | # This warning indicates an incomplete Visual Studio installation 589 | # or a bug somewhere above here in this file. 590 | # If you would like to avoid this warning, fix the real problem, or 591 | # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including 592 | # this file. 593 | endif() 594 | endif() 595 | endforeach() 596 | endif() 597 | 598 | if(_IRSL_HAVE_Intel) 599 | unset(__install_libs) 600 | if(CMAKE_INSTALL_OPENMP_LIBRARIES) 601 | if(WIN32) 602 | list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll") 603 | elseif(APPLE) 604 | list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib") 605 | else() 606 | list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so") 607 | if(_Intel_compiler_ver VERSION_LESS 17) 608 | list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so") 609 | endif() 610 | if(_Intel_compiler_ver VERSION_LESS 13) 611 | list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so") 612 | endif() 613 | endif() 614 | endif() 615 | if(WIN32) 616 | set(__install_dirs "${_Intel_redistdir}/1033") 617 | if(EXISTS "${_Intel_redistdir}/1041") 618 | list(APPEND __install_dirs "${_Intel_redistdir}/1041") 619 | endif() 620 | if(_Intel_compiler_ver VERSION_LESS 18) 621 | list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c") 622 | endif() 623 | foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll 624 | libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll) 625 | 626 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 627 | endforeach() 628 | if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) 629 | list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll") 630 | endif() 631 | if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) 632 | foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll) 633 | 634 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 635 | endforeach() 636 | endif() 637 | elseif(APPLE) 638 | foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib) 639 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 640 | endforeach() 641 | if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) 642 | if(_Intel_compiler_ver VERSION_LESS 17) 643 | list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib") 644 | endif() 645 | endif() 646 | if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) 647 | foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib) 648 | 649 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 650 | endforeach() 651 | endif() 652 | else() 653 | foreach(__Intel_lib IN ITEMS libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so) 654 | 655 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 656 | endforeach() 657 | if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13) 658 | foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5) 659 | 660 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 661 | endforeach() 662 | endif() 663 | if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) 664 | set(__install_dirs "${_Intel_redistdir}/irml") 665 | list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so") 666 | if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15) 667 | list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so") 668 | endif() 669 | endif() 670 | if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16) 671 | foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main) 672 | 673 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 674 | endforeach() 675 | endif() 676 | if(_Intel_compiler_ver VERSION_LESS 15) 677 | foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5) 678 | 679 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 680 | endforeach() 681 | endif() 682 | if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) 683 | foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5) 684 | 685 | list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") 686 | endforeach() 687 | endif() 688 | endif() 689 | 690 | foreach(lib IN LISTS __install_libs) 691 | if(EXISTS ${lib}) 692 | list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib}) 693 | else() 694 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) 695 | message(WARNING "system runtime library file does not exist: '${lib}'") 696 | endif() 697 | endif() 698 | endforeach() 699 | 700 | foreach(dir IN LISTS __install_dirs) 701 | if(EXISTS ${dir}) 702 | list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir}) 703 | else() 704 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) 705 | message(WARNING "system runtime library file does not exist: '${dir}'") 706 | endif() 707 | endif() 708 | endforeach() 709 | endif() 710 | 711 | if(WATCOM) 712 | get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH ) 713 | if(CMAKE_C_COMPILER_VERSION) 714 | set(_compiler_version ${CMAKE_C_COMPILER_VERSION}) 715 | else() 716 | set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION}) 717 | endif() 718 | string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}") 719 | list(GET _watcom_version_list 0 _watcom_major) 720 | list(GET _watcom_version_list 1 _watcom_minor) 721 | set( __install__libs 722 | ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll 723 | ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll 724 | ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll ) 725 | foreach(lib 726 | ${__install__libs} 727 | ) 728 | if(EXISTS ${lib}) 729 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS 730 | ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib}) 731 | else() 732 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) 733 | message(WARNING "system runtime library file does not exist: '${lib}'") 734 | # This warning indicates an incomplete Watcom installation 735 | # or a bug somewhere above here in this file. 736 | # If you would like to avoid this warning, fix the real problem, or 737 | # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including 738 | # this file. 739 | endif() 740 | endif() 741 | endforeach() 742 | endif() 743 | 744 | 745 | # Include system runtime libraries in the installation if any are 746 | # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS. 747 | if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) 748 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) 749 | if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) 750 | if(WIN32) 751 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin) 752 | else() 753 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib) 754 | endif() 755 | endif() 756 | if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT) 757 | set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT 758 | COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}) 759 | endif() 760 | install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} 761 | DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION} 762 | ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT} 763 | ) 764 | 765 | install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES} 766 | DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION} 767 | ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT} 768 | ) 769 | endif() 770 | endif() 771 | 772 | cmake_policy(POP) 773 | -------------------------------------------------------------------------------- /cmake/modules/FindPkgConfig.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[========================================[.rst: 5 | FindPkgConfig 6 | ------------- 7 | 8 | A ``pkg-config`` module for CMake. 9 | 10 | Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`, 11 | :command:`pkg_check_modules` and :command:`pkg_search_module` commands. The 12 | following variables will also be set: 13 | 14 | ``PKG_CONFIG_FOUND`` 15 | if pkg-config executable was found 16 | ``PKG_CONFIG_EXECUTABLE`` 17 | pathname of the pkg-config program 18 | ``PKG_CONFIG_VERSION_STRING`` 19 | version of pkg-config (since CMake 2.8.8) 20 | 21 | #]========================================] 22 | 23 | cmake_policy(PUSH) 24 | cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced 25 | cmake_policy(SET CMP0057 NEW) # if IN_LIST 26 | 27 | ### Common stuff #### 28 | set(PKG_CONFIG_VERSION 1) 29 | 30 | # find pkg-config, use PKG_CONFIG if set 31 | if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL "")) 32 | set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable") 33 | endif() 34 | find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") 35 | mark_as_advanced(PKG_CONFIG_EXECUTABLE) 36 | 37 | if (PKG_CONFIG_EXECUTABLE) 38 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version 39 | OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING 40 | ERROR_QUIET 41 | OUTPUT_STRIP_TRAILING_WHITESPACE) 42 | endif () 43 | 44 | include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) 45 | find_package_handle_standard_args(PkgConfig 46 | REQUIRED_VARS PKG_CONFIG_EXECUTABLE 47 | VERSION_VAR PKG_CONFIG_VERSION_STRING) 48 | 49 | # This is needed because the module name is "PkgConfig" but the name of 50 | # this variable has always been PKG_CONFIG_FOUND so this isn't automatically 51 | # handled by FPHSA. 52 | set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}") 53 | 54 | # Unsets the given variables 55 | macro(_pkgconfig_unset var) 56 | set(${var} "" CACHE INTERNAL "") 57 | endmacro() 58 | 59 | macro(_pkgconfig_set var value) 60 | set(${var} ${value} CACHE INTERNAL "") 61 | endmacro() 62 | 63 | # Invokes pkgconfig, cleans up the result and sets variables 64 | macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) 65 | set(_pkgconfig_invoke_result) 66 | 67 | execute_process( 68 | COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist} 69 | OUTPUT_VARIABLE _pkgconfig_invoke_result 70 | RESULT_VARIABLE _pkgconfig_failed 71 | OUTPUT_STRIP_TRAILING_WHITESPACE) 72 | 73 | if (_pkgconfig_failed) 74 | set(_pkgconfig_${_varname} "") 75 | _pkgconfig_unset(${_prefix}_${_varname}) 76 | else() 77 | string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") 78 | 79 | if (NOT ${_regexp} STREQUAL "") 80 | string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") 81 | endif() 82 | 83 | separate_arguments(_pkgconfig_invoke_result) 84 | 85 | #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}") 86 | set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result}) 87 | _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}") 88 | endif() 89 | endmacro() 90 | 91 | # Internal version of pkg_get_variable; expects PKG_CONFIG_PATH to already be set 92 | function (_pkg_get_variable result pkg variable) 93 | _pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}") 94 | set("${result}" 95 | "${prefix_result}" 96 | PARENT_SCOPE) 97 | endfunction () 98 | 99 | # Invokes pkgconfig two times; once without '--static' and once with 100 | # '--static' 101 | macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp) 102 | _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) 103 | _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN}) 104 | endmacro() 105 | 106 | # Splits given arguments into options and a package list 107 | macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global) 108 | set(${_is_req} 0) 109 | set(${_is_silent} 0) 110 | set(${_no_cmake_path} 0) 111 | set(${_no_cmake_environment_path} 0) 112 | set(${_imp_target} 0) 113 | set(${_imp_target_global} 0) 114 | if(DEFINED PKG_CONFIG_USE_CMAKE_PREFIX_PATH) 115 | if(NOT PKG_CONFIG_USE_CMAKE_PREFIX_PATH) 116 | set(${_no_cmake_path} 1) 117 | set(${_no_cmake_environment_path} 1) 118 | endif() 119 | elseif(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1) 120 | set(${_no_cmake_path} 1) 121 | set(${_no_cmake_environment_path} 1) 122 | endif() 123 | 124 | foreach(_pkg ${ARGN}) 125 | if (_pkg STREQUAL "REQUIRED") 126 | set(${_is_req} 1) 127 | endif () 128 | if (_pkg STREQUAL "QUIET") 129 | set(${_is_silent} 1) 130 | endif () 131 | if (_pkg STREQUAL "NO_CMAKE_PATH") 132 | set(${_no_cmake_path} 1) 133 | endif() 134 | if (_pkg STREQUAL "NO_CMAKE_ENVIRONMENT_PATH") 135 | set(${_no_cmake_environment_path} 1) 136 | endif() 137 | if (_pkg STREQUAL "IMPORTED_TARGET") 138 | set(${_imp_target} 1) 139 | endif() 140 | if (_pkg STREQUAL "GLOBAL") 141 | set(${_imp_target_global} 1) 142 | endif() 143 | endforeach() 144 | 145 | if (${_imp_target_global} AND NOT ${_imp_target}) 146 | message(SEND_ERROR "the argument GLOBAL may only be used together with IMPORTED_TARGET") 147 | endif() 148 | 149 | set(${_result} ${ARGN}) 150 | list(REMOVE_ITEM ${_result} "REQUIRED") 151 | list(REMOVE_ITEM ${_result} "QUIET") 152 | list(REMOVE_ITEM ${_result} "NO_CMAKE_PATH") 153 | list(REMOVE_ITEM ${_result} "NO_CMAKE_ENVIRONMENT_PATH") 154 | list(REMOVE_ITEM ${_result} "IMPORTED_TARGET") 155 | list(REMOVE_ITEM ${_result} "GLOBAL") 156 | endmacro() 157 | 158 | # Add the content of a variable or an environment variable to a list of 159 | # paths 160 | # Usage: 161 | # - _pkgconfig_add_extra_path(_extra_paths VAR) 162 | # - _pkgconfig_add_extra_path(_extra_paths ENV VAR) 163 | function(_pkgconfig_add_extra_path _extra_paths_var _var) 164 | set(_is_env 0) 165 | if(ARGC GREATER 2 AND _var STREQUAL "ENV") 166 | set(_var ${ARGV2}) 167 | set(_is_env 1) 168 | endif() 169 | if(NOT _is_env) 170 | if(NOT "${${_var}}" STREQUAL "") 171 | list(APPEND ${_extra_paths_var} ${${_var}}) 172 | endif() 173 | else() 174 | if(NOT "$ENV{${_var}}" STREQUAL "") 175 | file(TO_CMAKE_PATH "$ENV{${_var}}" _path) 176 | list(APPEND ${_extra_paths_var} ${_path}) 177 | unset(_path) 178 | endif() 179 | endif() 180 | set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE) 181 | endfunction() 182 | 183 | # scan the LDFLAGS returned by pkg-config for library directories and 184 | # libraries, figure out the absolute paths of that libraries in the 185 | # given directories 186 | function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path) 187 | unset(_libs) 188 | unset(_find_opts) 189 | 190 | # set the options that are used as long as the .pc file does not provide a library 191 | # path to look into 192 | if(_no_cmake_path) 193 | list(APPEND _find_opts "NO_CMAKE_PATH") 194 | endif() 195 | if(_no_cmake_environment_path) 196 | list(APPEND _find_opts "NO_CMAKE_ENVIRONMENT_PATH") 197 | endif() 198 | 199 | unset(_search_paths) 200 | foreach (flag IN LISTS ${_prefix}_LDFLAGS) 201 | if (flag MATCHES "^-L(.*)") 202 | list(APPEND _search_paths ${CMAKE_MATCH_1}) 203 | continue() 204 | endif() 205 | if (flag MATCHES "^-l(.*)") 206 | set(_pkg_search "${CMAKE_MATCH_1}") 207 | else() 208 | continue() 209 | endif() 210 | 211 | if(_search_paths) 212 | # Firstly search in -L paths 213 | find_library(pkgcfg_lib_${_prefix}_${_pkg_search} 214 | NAMES ${_pkg_search} 215 | HINTS ${_search_paths} NO_DEFAULT_PATH) 216 | endif() 217 | find_library(pkgcfg_lib_${_prefix}_${_pkg_search} 218 | NAMES ${_pkg_search} 219 | ${_find_opts}) 220 | mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search}) 221 | if(pkgcfg_lib_${_prefix}_${_pkg_search}) 222 | list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}") 223 | else() 224 | list(APPEND _libs ${_pkg_search}) 225 | endif() 226 | endforeach() 227 | 228 | set(${_prefix}_LINK_LIBRARIES "${_libs}" PARENT_SCOPE) 229 | endfunction() 230 | 231 | # create an imported target from all the information returned by pkg-config 232 | function(_pkg_create_imp_target _prefix _imp_target_global) 233 | # only create the target if it is linkable, i.e. no executables 234 | if (NOT TARGET PkgConfig::${_prefix} 235 | AND ( ${_prefix}_INCLUDE_DIRS OR ${_prefix}_LINK_LIBRARIES OR ${_prefix}_LDFLAGS_OTHER OR ${_prefix}_CFLAGS_OTHER )) 236 | if(${_imp_target_global}) 237 | set(_global_opt "GLOBAL") 238 | else() 239 | unset(_global_opt) 240 | endif() 241 | add_library(PkgConfig::${_prefix} INTERFACE IMPORTED ${_global_opt}) 242 | 243 | if(${_prefix}_INCLUDE_DIRS) 244 | set_property(TARGET PkgConfig::${_prefix} PROPERTY 245 | INTERFACE_INCLUDE_DIRECTORIES "${${_prefix}_INCLUDE_DIRS}") 246 | endif() 247 | if(${_prefix}_LINK_LIBRARIES) 248 | set_property(TARGET PkgConfig::${_prefix} PROPERTY 249 | INTERFACE_LINK_LIBRARIES "${${_prefix}_LINK_LIBRARIES}") 250 | endif() 251 | if(${_prefix}_LDFLAGS_OTHER) 252 | set_property(TARGET PkgConfig::${_prefix} PROPERTY 253 | INTERFACE_LINK_OPTIONS "${${_prefix}_LDFLAGS_OTHER}") 254 | endif() 255 | if(${_prefix}_CFLAGS_OTHER) 256 | set_property(TARGET PkgConfig::${_prefix} PROPERTY 257 | INTERFACE_COMPILE_OPTIONS "${${_prefix}_CFLAGS_OTHER}") 258 | endif() 259 | endif() 260 | endfunction() 261 | 262 | # recalculate the dynamic output 263 | # this is a macro and not a function so the result of _pkg_find_libs is automatically propagated 264 | macro(_pkg_recalculate _prefix _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global) 265 | _pkg_find_libs(${_prefix} ${_no_cmake_path} ${_no_cmake_environment_path}) 266 | if(${_imp_target}) 267 | _pkg_create_imp_target(${_prefix} ${_imp_target_global}) 268 | endif() 269 | endmacro() 270 | 271 | ### 272 | macro(_pkg_set_path_internal) 273 | set(_extra_paths) 274 | 275 | if(NOT _no_cmake_path) 276 | _pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH) 277 | _pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH) 278 | _pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH) 279 | endif() 280 | 281 | if(NOT _no_cmake_environment_path) 282 | _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH) 283 | _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH) 284 | _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH) 285 | endif() 286 | 287 | if(NOT _extra_paths STREQUAL "") 288 | # Save the PKG_CONFIG_PATH environment variable, and add paths 289 | # from the CMAKE_PREFIX_PATH variables 290 | set(_pkgconfig_path_old "$ENV{PKG_CONFIG_PATH}") 291 | set(_pkgconfig_path "${_pkgconfig_path_old}") 292 | if(NOT _pkgconfig_path STREQUAL "") 293 | file(TO_CMAKE_PATH "${_pkgconfig_path}" _pkgconfig_path) 294 | endif() 295 | 296 | # Create a list of the possible pkgconfig subfolder (depending on 297 | # the system 298 | set(_lib_dirs) 299 | if(NOT DEFINED CMAKE_SYSTEM_NAME 300 | OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" 301 | AND NOT CMAKE_CROSSCOMPILING)) 302 | if(EXISTS "/etc/debian_version") # is this a debian system ? 303 | if(CMAKE_LIBRARY_ARCHITECTURE) 304 | list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig") 305 | endif() 306 | else() 307 | # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties 308 | get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) 309 | if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) 310 | list(APPEND _lib_dirs "lib32/pkgconfig") 311 | endif() 312 | get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) 313 | if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) 314 | list(APPEND _lib_dirs "lib64/pkgconfig") 315 | endif() 316 | get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) 317 | if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") 318 | list(APPEND _lib_dirs "libx32/pkgconfig") 319 | endif() 320 | endif() 321 | endif() 322 | if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING) 323 | list(APPEND _lib_dirs "libdata/pkgconfig") 324 | endif() 325 | list(APPEND _lib_dirs "lib/pkgconfig") 326 | list(APPEND _lib_dirs "share/pkgconfig") 327 | 328 | # Check if directories exist and eventually append them to the 329 | # pkgconfig path list 330 | foreach(_prefix_dir ${_extra_paths}) 331 | foreach(_lib_dir ${_lib_dirs}) 332 | if(EXISTS "${_prefix_dir}/${_lib_dir}") 333 | list(APPEND _pkgconfig_path "${_prefix_dir}/${_lib_dir}") 334 | list(REMOVE_DUPLICATES _pkgconfig_path) 335 | endif() 336 | endforeach() 337 | endforeach() 338 | 339 | # Prepare and set the environment variable 340 | if(NOT _pkgconfig_path STREQUAL "") 341 | # remove empty values from the list 342 | list(REMOVE_ITEM _pkgconfig_path "") 343 | file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path) 344 | if(CMAKE_HOST_UNIX) 345 | string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}") 346 | string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}") 347 | endif() 348 | set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path}") 349 | endif() 350 | 351 | # Unset variables 352 | unset(_lib_dirs) 353 | unset(_pkgconfig_path) 354 | endif() 355 | endmacro() 356 | 357 | macro(_pkg_restore_path_internal) 358 | if(NOT _extra_paths STREQUAL "") 359 | # Restore the environment variable 360 | set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}") 361 | endif() 362 | 363 | unset(_extra_paths) 364 | unset(_pkgconfig_path_old) 365 | endmacro() 366 | 367 | # pkg-config returns -isystem include directories in --cflags-only-other, 368 | # depending on the version and if there is a space between -isystem and 369 | # the actual path 370 | function(_pkgconfig_extract_isystem _prefix) 371 | set(cflags "${${_prefix}_CFLAGS_OTHER}") 372 | set(outflags "") 373 | set(incdirs "${${_prefix}_INCLUDE_DIRS}") 374 | 375 | set(next_is_isystem FALSE) 376 | foreach (THING IN LISTS cflags) 377 | # This may filter "-isystem -isystem". That would not work anyway, 378 | # so let it happen. 379 | if (THING STREQUAL "-isystem") 380 | set(next_is_isystem TRUE) 381 | continue() 382 | endif () 383 | if (next_is_isystem) 384 | set(next_is_isystem FALSE) 385 | list(APPEND incdirs "${THING}") 386 | elseif (THING MATCHES "^-isystem") 387 | string(SUBSTRING "${THING}" 8 -1 THING) 388 | list(APPEND incdirs "${THING}") 389 | else () 390 | list(APPEND outflags "${THING}") 391 | endif () 392 | endforeach () 393 | set(${_prefix}_CFLAGS_OTHER "${outflags}" PARENT_SCOPE) 394 | set(${_prefix}_INCLUDE_DIRS "${incdirs}" PARENT_SCOPE) 395 | endfunction() 396 | 397 | ### 398 | macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global _prefix) 399 | _pkgconfig_unset(${_prefix}_FOUND) 400 | _pkgconfig_unset(${_prefix}_VERSION) 401 | _pkgconfig_unset(${_prefix}_PREFIX) 402 | _pkgconfig_unset(${_prefix}_INCLUDEDIR) 403 | _pkgconfig_unset(${_prefix}_LIBDIR) 404 | _pkgconfig_unset(${_prefix}_MODULE_NAME) 405 | _pkgconfig_unset(${_prefix}_LIBS) 406 | _pkgconfig_unset(${_prefix}_LIBS_L) 407 | _pkgconfig_unset(${_prefix}_LIBS_PATHS) 408 | _pkgconfig_unset(${_prefix}_LIBS_OTHER) 409 | _pkgconfig_unset(${_prefix}_CFLAGS) 410 | _pkgconfig_unset(${_prefix}_CFLAGS_I) 411 | _pkgconfig_unset(${_prefix}_CFLAGS_OTHER) 412 | _pkgconfig_unset(${_prefix}_STATIC_LIBDIR) 413 | _pkgconfig_unset(${_prefix}_STATIC_LIBS) 414 | _pkgconfig_unset(${_prefix}_STATIC_LIBS_L) 415 | _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS) 416 | _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER) 417 | _pkgconfig_unset(${_prefix}_STATIC_CFLAGS) 418 | _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I) 419 | _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER) 420 | 421 | # create a better addressable variable of the modules and calculate its size 422 | set(_pkg_check_modules_list ${ARGN}) 423 | list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt) 424 | 425 | if(PKG_CONFIG_EXECUTABLE) 426 | # give out status message telling checked module 427 | if (NOT ${_is_silent}) 428 | if (_pkg_check_modules_cnt EQUAL 1) 429 | message(STATUS "Checking for module '${_pkg_check_modules_list}'") 430 | else() 431 | message(STATUS "Checking for modules '${_pkg_check_modules_list}'") 432 | endif() 433 | endif() 434 | 435 | set(_pkg_check_modules_packages) 436 | set(_pkg_check_modules_failed) 437 | 438 | _pkg_set_path_internal() 439 | 440 | # iterate through module list and check whether they exist and match the required version 441 | foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list}) 442 | set(_pkg_check_modules_exist_query) 443 | 444 | # check whether version is given 445 | if (_pkg_check_modules_pkg MATCHES "(.*[^><])(=|[><]=?)(.*)") 446 | set(_pkg_check_modules_pkg_name "${CMAKE_MATCH_1}") 447 | set(_pkg_check_modules_pkg_op "${CMAKE_MATCH_2}") 448 | set(_pkg_check_modules_pkg_ver "${CMAKE_MATCH_3}") 449 | else() 450 | set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") 451 | set(_pkg_check_modules_pkg_op) 452 | set(_pkg_check_modules_pkg_ver) 453 | endif() 454 | 455 | _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) 456 | _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX) 457 | _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR) 458 | _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR) 459 | 460 | list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}") 461 | 462 | # create the final query which is of the format: 463 | # * > 464 | # * >= 465 | # * = 466 | # * <= 467 | # * < 468 | # * --exists 469 | list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors) 470 | if (_pkg_check_modules_pkg_op) 471 | list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name} ${_pkg_check_modules_pkg_op} ${_pkg_check_modules_pkg_ver}") 472 | else() 473 | list(APPEND _pkg_check_modules_exist_query --exists) 474 | list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}") 475 | endif() 476 | 477 | # execute the query 478 | execute_process( 479 | COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query} 480 | RESULT_VARIABLE _pkgconfig_retval 481 | ERROR_VARIABLE _pkgconfig_error 482 | ERROR_STRIP_TRAILING_WHITESPACE) 483 | 484 | # evaluate result and tell failures 485 | if (_pkgconfig_retval) 486 | if(NOT ${_is_silent}) 487 | message(STATUS " ${_pkgconfig_error}") 488 | endif() 489 | 490 | set(_pkg_check_modules_failed 1) 491 | endif() 492 | endforeach() 493 | 494 | if(_pkg_check_modules_failed) 495 | # fail when requested 496 | if (${_is_required}) 497 | message(FATAL_ERROR "A required package was not found") 498 | endif () 499 | else() 500 | # when we are here, we checked whether requested modules 501 | # exist. Now, go through them and set variables 502 | 503 | _pkgconfig_set(${_prefix}_FOUND 1) 504 | list(LENGTH _pkg_check_modules_packages pkg_count) 505 | 506 | # iterate through all modules again and set individual variables 507 | foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages}) 508 | # handle case when there is only one package required 509 | if (pkg_count EQUAL 1) 510 | set(_pkg_check_prefix "${_prefix}") 511 | else() 512 | set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}") 513 | endif() 514 | 515 | _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion ) 516 | pkg_get_variable("${_pkg_check_prefix}_PREFIX" ${_pkg_check_modules_pkg} "prefix") 517 | pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir") 518 | pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir") 519 | foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR) 520 | _pkgconfig_set("${_pkg_check_prefix}_${variable}" "${${_pkg_check_prefix}_${variable}}") 521 | endforeach () 522 | _pkgconfig_set("${_pkg_check_prefix}_MODULE_NAME" "${_pkg_check_modules_pkg}") 523 | 524 | if (NOT ${_is_silent}) 525 | message(STATUS " Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") 526 | endif () 527 | endforeach() 528 | 529 | # set variables which are combined for multiple modules 530 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) 531 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L ) 532 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs ) 533 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other ) 534 | 535 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )(-I|-isystem ?)" --cflags-only-I ) 536 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) 537 | _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) 538 | 539 | if (${_prefix}_CFLAGS_OTHER MATCHES "-isystem") 540 | _pkgconfig_extract_isystem("${_prefix}") 541 | endif () 542 | 543 | _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) 544 | endif() 545 | 546 | _pkg_restore_path_internal() 547 | else() 548 | if (${_is_required}) 549 | message(SEND_ERROR "pkg-config tool not found") 550 | endif () 551 | endif() 552 | endmacro() 553 | 554 | 555 | #[========================================[.rst: 556 | .. command:: pkg_check_modules 557 | 558 | Checks for all the given modules, setting a variety of result variables in 559 | the calling scope. 560 | 561 | .. code-block:: cmake 562 | 563 | pkg_check_modules( 564 | [REQUIRED] [QUIET] 565 | [NO_CMAKE_PATH] 566 | [NO_CMAKE_ENVIRONMENT_PATH] 567 | [IMPORTED_TARGET [GLOBAL]] 568 | [...]) 569 | 570 | When the ``REQUIRED`` argument is given, the command will fail with an error 571 | if module(s) could not be found. 572 | 573 | When the ``QUIET`` argument is given, no status messages will be printed. 574 | 575 | By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or 576 | later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set to a 577 | boolean ``True`` value, then the :variable:`CMAKE_PREFIX_PATH`, 578 | :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` cache 579 | and environment variables will be added to the ``pkg-config`` search path. 580 | The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments 581 | disable this behavior for the cache variables and environment variables 582 | respectively. 583 | 584 | The ``IMPORTED_TARGET`` argument will create an imported target named 585 | ``PkgConfig::`` that can be passed directly as an argument to 586 | :command:`target_link_libraries`. The ``GLOBAL`` argument will make the 587 | imported target available in global scope. 588 | 589 | Each ```` can be either a bare module name or it can be a 590 | module name with a version constraint (operators ``=``, ``<``, ``>``, 591 | ``<=`` and ``>=`` are supported). The following are examples for a module 592 | named ``foo`` with various constraints: 593 | 594 | - ``foo`` matches any version. 595 | - ``foo<2`` only matches versions before 2. 596 | - ``foo>=3.1`` matches any version from 3.1 or later. 597 | - ``foo=1.2.3`` requires that foo must be exactly version 1.2.3. 598 | 599 | The following variables may be set upon return. Two sets of values exist: 600 | One for the common case (`` = ``) and another for the 601 | information ``pkg-config`` provides when called with the ``--static`` 602 | option (`` = _STATIC``). 603 | 604 | ``_FOUND`` 605 | set to 1 if module(s) exist 606 | ``_LIBRARIES`` 607 | only the libraries (without the '-l') 608 | ``_LINK_LIBRARIES`` 609 | the libraries and their absolute paths 610 | ``_LIBRARY_DIRS`` 611 | the paths of the libraries (without the '-L') 612 | ``_LDFLAGS`` 613 | all required linker flags 614 | ``_LDFLAGS_OTHER`` 615 | all other linker flags 616 | ``_INCLUDE_DIRS`` 617 | the '-I' preprocessor flags (without the '-I') 618 | ``_CFLAGS`` 619 | all required cflags 620 | ``_CFLAGS_OTHER`` 621 | the other compiler flags 622 | 623 | All but ``_FOUND`` may be a :ref:`;-list ` if the 624 | associated variable returned from ``pkg-config`` has multiple values. 625 | 626 | There are some special variables whose prefix depends on the number of 627 | ```` given. When there is only one ````, 628 | ```` will simply be ````, but if two or more ```` 629 | items are given, ```` will be ``_``. 630 | 631 | ``_VERSION`` 632 | version of the module 633 | ``_PREFIX`` 634 | prefix directory of the module 635 | ``_INCLUDEDIR`` 636 | include directory of the module 637 | ``_LIBDIR`` 638 | lib directory of the module 639 | 640 | Examples: 641 | 642 | .. code-block:: cmake 643 | 644 | pkg_check_modules (GLIB2 glib-2.0) 645 | 646 | Looks for any version of glib2. If found, the output variable 647 | ``GLIB2_VERSION`` will hold the actual version found. 648 | 649 | .. code-block:: cmake 650 | 651 | pkg_check_modules (GLIB2 glib-2.0>=2.10) 652 | 653 | Looks for at least version 2.10 of glib2. If found, the output variable 654 | ``GLIB2_VERSION`` will hold the actual version found. 655 | 656 | .. code-block:: cmake 657 | 658 | pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) 659 | 660 | Looks for both glib2-2.0 (at least version 2.10) and any version of 661 | gtk2+-2.0. Only if both are found will ``FOO`` be considered found. 662 | The ``FOO_glib-2.0_VERSION`` and ``FOO_gtk+-2.0_VERSION`` variables will be 663 | set to their respective found module versions. 664 | 665 | .. code-block:: cmake 666 | 667 | pkg_check_modules (XRENDER REQUIRED xrender) 668 | 669 | Requires any version of ``xrender``. Example output variables set by a 670 | successful call:: 671 | 672 | XRENDER_LIBRARIES=Xrender;X11 673 | XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp 674 | #]========================================] 675 | macro(pkg_check_modules _prefix _module0) 676 | _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global "${_module0}" ${ARGN}) 677 | # check cached value 678 | if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR 679 | (NOT "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}") OR 680 | ( "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0}")) 681 | _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} "${_prefix}" ${_pkg_modules}) 682 | 683 | _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) 684 | if (${_prefix}_FOUND) 685 | _pkgconfig_set(__pkg_config_arguments_${_prefix} "${_module0};${ARGN}") 686 | endif() 687 | else() 688 | if (${_prefix}_FOUND) 689 | _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) 690 | endif() 691 | endif() 692 | endmacro() 693 | 694 | 695 | #[========================================[.rst: 696 | .. command:: pkg_search_module 697 | 698 | The behavior of this command is the same as :command:`pkg_check_modules`, 699 | except that rather than checking for all the specified modules, it searches 700 | for just the first successful match. 701 | 702 | .. code-block:: cmake 703 | 704 | pkg_search_module( 705 | [REQUIRED] [QUIET] 706 | [NO_CMAKE_PATH] 707 | [NO_CMAKE_ENVIRONMENT_PATH] 708 | [IMPORTED_TARGET [GLOBAL]] 709 | [...]) 710 | 711 | If a module is found, the ``_MODULE_NAME`` variable will contain the 712 | name of the matching module. This variable can be used if you need to run 713 | :command:`pkg_get_variable`. 714 | 715 | Example: 716 | 717 | .. code-block:: cmake 718 | 719 | pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) 720 | #]========================================] 721 | macro(pkg_search_module _prefix _module0) 722 | _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global "${_module0}" ${ARGN}) 723 | # check cached value 724 | if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) 725 | set(_pkg_modules_found 0) 726 | 727 | if (NOT ${_pkg_is_silent}) 728 | message(STATUS "Checking for one of the modules '${_pkg_modules_alt}'") 729 | endif () 730 | 731 | # iterate through all modules and stop at the first working one. 732 | foreach(_pkg_alt ${_pkg_modules_alt}) 733 | if(NOT _pkg_modules_found) 734 | _pkg_check_modules_internal(0 1 ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} "${_prefix}" "${_pkg_alt}") 735 | endif() 736 | 737 | if (${_prefix}_FOUND) 738 | set(_pkg_modules_found 1) 739 | break() 740 | endif() 741 | endforeach() 742 | 743 | if (NOT ${_prefix}_FOUND) 744 | if(${_pkg_is_required}) 745 | message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found") 746 | endif() 747 | endif() 748 | 749 | _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) 750 | elseif (${_prefix}_FOUND) 751 | _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) 752 | endif() 753 | endmacro() 754 | 755 | #[========================================[.rst: 756 | .. command:: pkg_get_variable 757 | 758 | Retrieves the value of a pkg-config variable ``varName`` and stores it in the 759 | result variable ``resultVar`` in the calling scope. 760 | 761 | .. code-block:: cmake 762 | 763 | pkg_get_variable( ) 764 | 765 | If ``pkg-config`` returns multiple values for the specified variable, 766 | ``resultVar`` will contain a :ref:`;-list `. 767 | 768 | For example: 769 | 770 | .. code-block:: cmake 771 | 772 | pkg_get_variable(GI_GIRDIR gobject-introspection-1.0 girdir) 773 | #]========================================] 774 | function (pkg_get_variable result pkg variable) 775 | _pkg_set_path_internal() 776 | _pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}") 777 | set("${result}" 778 | "${prefix_result}" 779 | PARENT_SCOPE) 780 | _pkg_restore_path_internal() 781 | endfunction () 782 | 783 | 784 | #[========================================[.rst: 785 | Variables Affecting Behavior 786 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 787 | 788 | .. variable:: PKG_CONFIG_EXECUTABLE 789 | 790 | This can be set to the path of the pkg-config executable. If not provided, 791 | it will be set by the module as a result of calling :command:`find_program` 792 | internally. The ``PKG_CONFIG`` environment variable can be used as a hint. 793 | 794 | .. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH 795 | 796 | Specifies whether :command:`pkg_check_modules` and 797 | :command:`pkg_search_module` should add the paths in the 798 | :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH` and 799 | :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables to the 800 | ``pkg-config`` search path. 801 | 802 | If this variable is not set, this behavior is enabled by default if 803 | :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled 804 | otherwise. 805 | #]========================================] 806 | 807 | 808 | ### Local Variables: 809 | ### mode: cmake 810 | ### End: 811 | 812 | cmake_policy(POP) 813 | -------------------------------------------------------------------------------- /cmake/modules/GetPrerequisites.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #[=======================================================================[.rst: 5 | GetPrerequisites 6 | ---------------- 7 | 8 | .. deprecated:: 3.16 9 | 10 | Use :command:`file(GET_RUNTIME_DEPENDENCIES)` instead. 11 | 12 | Functions to analyze and list executable file prerequisites. 13 | 14 | This module provides functions to list the .dll, .dylib or .so files 15 | that an executable or shared library file depends on. (Its 16 | prerequisites.) 17 | 18 | It uses various tools to obtain the list of required shared library 19 | files: 20 | 21 | :: 22 | 23 | dumpbin (Windows) 24 | objdump (MinGW on Windows) 25 | ldd (Linux/Unix) 26 | otool (Mac OSX) 27 | 28 | The following functions are provided by this module: 29 | 30 | :: 31 | 32 | get_prerequisites 33 | list_prerequisites 34 | list_prerequisites_by_glob 35 | gp_append_unique 36 | is_file_executable 37 | gp_item_default_embedded_path 38 | (projects can override with gp_item_default_embedded_path_override) 39 | gp_resolve_item 40 | (projects can override with gp_resolve_item_override) 41 | gp_resolved_file_type 42 | (projects can override with gp_resolved_file_type_override) 43 | gp_file_type 44 | 45 | Requires CMake 2.6 or greater because it uses function, break, return 46 | and PARENT_SCOPE. 47 | 48 | :: 49 | 50 | GET_PREREQUISITES( 51 | []) 52 | 53 | Get the list of shared library files required by . The list 54 | in the variable named should be empty on first 55 | entry to this function. On exit, will contain the 56 | list of required shared library files. 57 | 58 | is the full path to an executable file. 59 | is the name of a CMake variable to contain the results. 60 | must be 0 or 1 indicating whether to include or 61 | exclude "system" prerequisites. If is set to 1 all 62 | prerequisites will be found recursively, if set to 0 only direct 63 | prerequisites are listed. is the path to the top level 64 | executable used for @executable_path replacment on the Mac. is 65 | a list of paths where libraries might be found: these paths are 66 | searched first when a target without any path info is given. Then 67 | standard system locations are also searched: PATH, Framework 68 | locations, /usr/lib... 69 | 70 | The variable GET_PREREQUISITES_VERBOSE can be set to true to enable verbose 71 | output. 72 | 73 | :: 74 | 75 | LIST_PREREQUISITES( [ [ []]]) 76 | 77 | Print a message listing the prerequisites of . 78 | 79 | is the name of a shared library or executable target or the 80 | full path to a shared library or executable file. If is set 81 | to 1 all prerequisites will be found recursively, if set to 0 only 82 | direct prerequisites are listed. must be 0 or 1 83 | indicating whether to include or exclude "system" prerequisites. With 84 | set to 0 only the full path names of the prerequisites are 85 | printed, set to 1 extra informatin will be displayed. 86 | 87 | :: 88 | 89 | LIST_PREREQUISITES_BY_GLOB( ) 90 | 91 | Print the prerequisites of shared library and executable files 92 | matching a globbing pattern. is GLOB or GLOB_RECURSE and 93 | is a globbing expression used with "file(GLOB" or 94 | "file(GLOB_RECURSE" to retrieve a list of matching files. If a 95 | matching file is executable, its prerequisites are listed. 96 | 97 | Any additional (optional) arguments provided are passed along as the 98 | optional arguments to the list_prerequisites calls. 99 | 100 | :: 101 | 102 | GP_APPEND_UNIQUE( ) 103 | 104 | Append to the list variable only if the value is 105 | not already in the list. 106 | 107 | :: 108 | 109 | IS_FILE_EXECUTABLE( ) 110 | 111 | Return 1 in if is a binary executable, 0 112 | otherwise. 113 | 114 | :: 115 | 116 | GP_ITEM_DEFAULT_EMBEDDED_PATH( ) 117 | 118 | Return the path that others should refer to the item by when the item 119 | is embedded inside a bundle. 120 | 121 | Override on a per-project basis by providing a project-specific 122 | gp_item_default_embedded_path_override function. 123 | 124 | :: 125 | 126 | GP_RESOLVE_ITEM( 127 | []) 128 | 129 | Resolve an item into an existing full path file. 130 | 131 | Override on a per-project basis by providing a project-specific 132 | gp_resolve_item_override function. 133 | 134 | :: 135 | 136 | GP_RESOLVED_FILE_TYPE( 137 | []) 138 | 139 | Return the type of with respect to . String 140 | describing type of prerequisite is returned in variable named 141 | . 142 | 143 | Use and if necessary to resolve non-absolute 144 | values -- but only for non-embedded items. 145 | 146 | Possible types are: 147 | 148 | :: 149 | 150 | system 151 | local 152 | embedded 153 | other 154 | 155 | Override on a per-project basis by providing a project-specific 156 | gp_resolved_file_type_override function. 157 | 158 | :: 159 | 160 | GP_FILE_TYPE( ) 161 | 162 | Return the type of with respect to . String 163 | describing type of prerequisite is returned in variable named 164 | . 165 | 166 | Possible types are: 167 | 168 | :: 169 | 170 | system 171 | local 172 | embedded 173 | other 174 | #]=======================================================================] 175 | 176 | cmake_policy(PUSH) 177 | cmake_policy(SET CMP0057 NEW) # if IN_LIST 178 | 179 | function(gp_append_unique list_var value) 180 | if(NOT value IN_LIST ${list_var}) 181 | set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE) 182 | endif() 183 | endfunction() 184 | 185 | 186 | function(is_file_executable file result_var) 187 | # 188 | # A file is not executable until proven otherwise: 189 | # 190 | set(${result_var} 0 PARENT_SCOPE) 191 | 192 | get_filename_component(file_full "${file}" ABSOLUTE) 193 | string(TOLOWER "${file_full}" file_full_lower) 194 | 195 | # If file name ends in .exe on Windows, *assume* executable: 196 | # 197 | if(WIN32 AND NOT UNIX) 198 | if("${file_full_lower}" MATCHES "\\.exe$") 199 | set(${result_var} 1 PARENT_SCOPE) 200 | return() 201 | endif() 202 | 203 | # A clause could be added here that uses output or return value of dumpbin 204 | # to determine ${result_var}. In 99%+? practical cases, the exe name 205 | # match will be sufficient... 206 | # 207 | endif() 208 | 209 | # Use the information returned from the Unix shell command "file" to 210 | # determine if ${file_full} should be considered an executable file... 211 | # 212 | # If the file command's output contains "executable" and does *not* contain 213 | # "text" then it is likely an executable suitable for prerequisite analysis 214 | # via the get_prerequisites macro. 215 | # 216 | if(UNIX) 217 | if(NOT file_cmd) 218 | find_program(file_cmd "file") 219 | mark_as_advanced(file_cmd) 220 | endif() 221 | 222 | if(file_cmd) 223 | execute_process(COMMAND "${file_cmd}" "${file_full}" 224 | RESULT_VARIABLE file_rv 225 | OUTPUT_VARIABLE file_ov 226 | ERROR_VARIABLE file_ev 227 | OUTPUT_STRIP_TRAILING_WHITESPACE 228 | ) 229 | if(NOT file_rv STREQUAL "0") 230 | message(FATAL_ERROR "${file_cmd} failed: ${file_rv}\n${file_ev}") 231 | endif() 232 | 233 | # Replace the name of the file in the output with a placeholder token 234 | # (the string " _file_full_ ") so that just in case the path name of 235 | # the file contains the word "text" or "executable" we are not fooled 236 | # into thinking "the wrong thing" because the file name matches the 237 | # other 'file' command output we are looking for... 238 | # 239 | string(REPLACE "${file_full}" " _file_full_ " file_ov "${file_ov}") 240 | string(TOLOWER "${file_ov}" file_ov) 241 | 242 | #message(STATUS "file_ov='${file_ov}'") 243 | if("${file_ov}" MATCHES "executable") 244 | #message(STATUS "executable!") 245 | if("${file_ov}" MATCHES "text") 246 | #message(STATUS "but text, so *not* a binary executable!") 247 | else() 248 | set(${result_var} 1 PARENT_SCOPE) 249 | return() 250 | endif() 251 | endif() 252 | 253 | # Also detect position independent executables on Linux, 254 | # where "file" gives "shared object ... (uses shared libraries)" 255 | if("${file_ov}" MATCHES "shared object.*\(uses shared libs\)") 256 | set(${result_var} 1 PARENT_SCOPE) 257 | return() 258 | endif() 259 | 260 | # "file" version 5.22 does not print "(used shared libraries)" 261 | # but uses "interpreter" 262 | if("${file_ov}" MATCHES "shared object.*interpreter") 263 | set(${result_var} 1 PARENT_SCOPE) 264 | return() 265 | endif() 266 | 267 | else() 268 | message(STATUS "warning: No 'file' command, skipping execute_process...") 269 | endif() 270 | endif() 271 | endfunction() 272 | 273 | 274 | function(gp_item_default_embedded_path item default_embedded_path_var) 275 | 276 | # On Windows and Linux, "embed" prerequisites in the same directory 277 | # as the executable by default: 278 | # 279 | set(path "@executable_path") 280 | 281 | # On the Mac, relative to the executable depending on the type 282 | # of the thing we are embedding: 283 | # 284 | if(APPLE) 285 | # 286 | # The assumption here is that all executables in the bundle will be 287 | # in same-level-directories inside the bundle. The parent directory 288 | # of an executable inside the bundle should be MacOS or a sibling of 289 | # MacOS and all embedded paths returned from here will begin with 290 | # "@executable_path/../" and will work from all executables in all 291 | # such same-level-directories inside the bundle. 292 | # 293 | 294 | # By default, embed things right next to the main bundle executable: 295 | # 296 | set(path "@executable_path/../../Contents/MacOS") 297 | 298 | # Embed frameworks and .dylibs in the embedded "Frameworks" directory 299 | # (sibling of MacOS): 300 | # 301 | if(item MATCHES "[^/]+\\.framework/" OR item MATCHES "\\.dylib$") 302 | set(path "@executable_path/../Frameworks") 303 | endif() 304 | endif() 305 | 306 | # Provide a hook so that projects can override the default embedded location 307 | # of any given library by whatever logic they choose: 308 | # 309 | if(COMMAND gp_item_default_embedded_path_override) 310 | gp_item_default_embedded_path_override("${item}" path) 311 | endif() 312 | 313 | set(${default_embedded_path_var} "${path}" PARENT_SCOPE) 314 | endfunction() 315 | 316 | 317 | function(gp_resolve_item context item exepath dirs resolved_item_var) 318 | set(resolved 0) 319 | set(resolved_item "${item}") 320 | if(ARGC GREATER 5) 321 | set(rpaths "${ARGV5}") 322 | else() 323 | set(rpaths "") 324 | endif() 325 | 326 | # Is it already resolved? 327 | # 328 | if(IS_ABSOLUTE "${resolved_item}" AND EXISTS "${resolved_item}") 329 | set(resolved 1) 330 | endif() 331 | 332 | if(NOT resolved) 333 | if(item MATCHES "^@executable_path") 334 | # 335 | # @executable_path references are assumed relative to exepath 336 | # 337 | string(REPLACE "@executable_path" "${exepath}" ri "${item}") 338 | get_filename_component(ri "${ri}" ABSOLUTE) 339 | 340 | if(EXISTS "${ri}") 341 | #message(STATUS "info: embedded item exists (${ri})") 342 | set(resolved 1) 343 | set(resolved_item "${ri}") 344 | else() 345 | message(STATUS "warning: embedded item does not exist '${ri}'") 346 | endif() 347 | endif() 348 | endif() 349 | 350 | if(NOT resolved) 351 | if(item MATCHES "^@loader_path") 352 | # 353 | # @loader_path references are assumed relative to the 354 | # PATH of the given "context" (presumably another library) 355 | # 356 | get_filename_component(contextpath "${context}" PATH) 357 | string(REPLACE "@loader_path" "${contextpath}" ri "${item}") 358 | get_filename_component(ri "${ri}" ABSOLUTE) 359 | 360 | if(EXISTS "${ri}") 361 | #message(STATUS "info: embedded item exists (${ri})") 362 | set(resolved 1) 363 | set(resolved_item "${ri}") 364 | else() 365 | message(STATUS "warning: embedded item does not exist '${ri}'") 366 | endif() 367 | endif() 368 | endif() 369 | 370 | if(NOT resolved) 371 | if(item MATCHES "^@rpath") 372 | # 373 | # @rpath references are relative to the paths built into the binaries with -rpath 374 | # We handle this case like we do for other Unixes 375 | # 376 | string(REPLACE "@rpath/" "" norpath_item "${item}") 377 | 378 | set(ri "ri-NOTFOUND") 379 | find_file(ri "${norpath_item}" ${exepath} ${dirs} ${rpaths} NO_DEFAULT_PATH) 380 | if(ri) 381 | #message(STATUS "info: 'find_file' in exepath/dirs/rpaths (${ri})") 382 | set(resolved 1) 383 | set(resolved_item "${ri}") 384 | set(ri "ri-NOTFOUND") 385 | endif() 386 | 387 | endif() 388 | endif() 389 | 390 | if(NOT resolved) 391 | set(ri "ri-NOTFOUND") 392 | find_file(ri "${item}" ${exepath} ${dirs} NO_DEFAULT_PATH) 393 | find_file(ri "${item}" ${exepath} ${dirs} /usr/lib) 394 | 395 | get_filename_component(basename_item "${item}" NAME) 396 | find_file(ri "${basename_item}" PATHS ${exepath} ${dirs} NO_DEFAULT_PATH) 397 | find_file(ri "${basename_item}" PATHS /usr/lib) 398 | 399 | if(ri) 400 | #message(STATUS "info: 'find_file' in exepath/dirs (${ri})") 401 | set(resolved 1) 402 | set(resolved_item "${ri}") 403 | set(ri "ri-NOTFOUND") 404 | endif() 405 | endif() 406 | 407 | if(NOT resolved) 408 | if(item MATCHES "[^/]+\\.framework/") 409 | set(fw "fw-NOTFOUND") 410 | find_file(fw "${item}" 411 | "~/Library/Frameworks" 412 | "/Library/Frameworks" 413 | "/System/Library/Frameworks" 414 | ) 415 | if(fw) 416 | #message(STATUS "info: 'find_file' found framework (${fw})") 417 | set(resolved 1) 418 | set(resolved_item "${fw}") 419 | set(fw "fw-NOTFOUND") 420 | endif() 421 | endif() 422 | endif() 423 | 424 | # Using find_program on Windows will find dll files that are in the PATH. 425 | # (Converting simple file names into full path names if found.) 426 | # 427 | if(WIN32 AND NOT UNIX) 428 | if(NOT resolved) 429 | set(ri "ri-NOTFOUND") 430 | find_program(ri "${item}" PATHS ${exepath} ${dirs} NO_DEFAULT_PATH) 431 | find_program(ri "${item}" PATHS ${exepath} ${dirs}) 432 | if(ri) 433 | #message(STATUS "info: 'find_program' in exepath/dirs (${ri})") 434 | set(resolved 1) 435 | set(resolved_item "${ri}") 436 | set(ri "ri-NOTFOUND") 437 | endif() 438 | endif() 439 | endif() 440 | 441 | # Provide a hook so that projects can override item resolution 442 | # by whatever logic they choose: 443 | # 444 | if(COMMAND gp_resolve_item_override) 445 | gp_resolve_item_override("${context}" "${item}" "${exepath}" "${dirs}" resolved_item resolved) 446 | endif() 447 | 448 | if(NOT resolved) 449 | message(STATUS " 450 | warning: cannot resolve item '${item}' 451 | 452 | possible problems: 453 | need more directories? 454 | need to use InstallRequiredSystemLibraries? 455 | run in install tree instead of build tree? 456 | ") 457 | # message(STATUS " 458 | #****************************************************************************** 459 | #warning: cannot resolve item '${item}' 460 | # 461 | # possible problems: 462 | # need more directories? 463 | # need to use InstallRequiredSystemLibraries? 464 | # run in install tree instead of build tree? 465 | # 466 | # context='${context}' 467 | # item='${item}' 468 | # exepath='${exepath}' 469 | # dirs='${dirs}' 470 | # resolved_item_var='${resolved_item_var}' 471 | #****************************************************************************** 472 | #") 473 | endif() 474 | 475 | set(${resolved_item_var} "${resolved_item}" PARENT_SCOPE) 476 | endfunction() 477 | 478 | 479 | function(gp_resolved_file_type original_file file exepath dirs type_var) 480 | if(ARGC GREATER 5) 481 | set(rpaths "${ARGV5}") 482 | else() 483 | set(rpaths "") 484 | endif() 485 | #message(STATUS "**") 486 | 487 | if(NOT IS_ABSOLUTE "${original_file}") 488 | message(STATUS "warning: gp_resolved_file_type expects absolute full path for first arg original_file") 489 | endif() 490 | if(IS_ABSOLUTE "${original_file}") 491 | get_filename_component(original_file "${original_file}" ABSOLUTE) # canonicalize path 492 | endif() 493 | 494 | set(is_embedded 0) 495 | set(is_local 0) 496 | set(is_system 0) 497 | 498 | set(resolved_file "${file}") 499 | 500 | if("${file}" MATCHES "^@(executable|loader)_path") 501 | set(is_embedded 1) 502 | endif() 503 | 504 | if(NOT is_embedded) 505 | if(NOT IS_ABSOLUTE "${file}") 506 | gp_resolve_item("${original_file}" "${file}" "${exepath}" "${dirs}" resolved_file "${rpaths}") 507 | endif() 508 | if(IS_ABSOLUTE "${resolved_file}") 509 | get_filename_component(resolved_file "${resolved_file}" ABSOLUTE) # canonicalize path 510 | endif() 511 | 512 | string(TOLOWER "${original_file}" original_lower) 513 | string(TOLOWER "${resolved_file}" lower) 514 | 515 | if(UNIX) 516 | if(resolved_file MATCHES "^(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)") 517 | set(is_system 1) 518 | endif() 519 | endif() 520 | 521 | if(APPLE) 522 | if(resolved_file MATCHES "^(/System/Library/|/usr/lib/)") 523 | set(is_system 1) 524 | endif() 525 | endif() 526 | 527 | if(WIN32) 528 | string(TOLOWER "$ENV{SystemRoot}" sysroot) 529 | file(TO_CMAKE_PATH "${sysroot}" sysroot) 530 | 531 | string(TOLOWER "$ENV{windir}" windir) 532 | file(TO_CMAKE_PATH "${windir}" windir) 533 | 534 | if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-|vcruntime)[^/]+dll)") 535 | set(is_system 1) 536 | endif() 537 | 538 | if(UNIX) 539 | # if cygwin, we can get the properly formed windows paths from cygpath 540 | find_program(CYGPATH_EXECUTABLE cygpath) 541 | 542 | if(CYGPATH_EXECUTABLE) 543 | execute_process(COMMAND ${CYGPATH_EXECUTABLE} -W 544 | RESULT_VARIABLE env_rv 545 | OUTPUT_VARIABLE env_windir 546 | ERROR_VARIABLE env_ev 547 | OUTPUT_STRIP_TRAILING_WHITESPACE) 548 | if(NOT env_rv STREQUAL "0") 549 | message(FATAL_ERROR "${CYGPATH_EXECUTABLE} -W failed: ${env_rv}\n${env_ev}") 550 | endif() 551 | execute_process(COMMAND ${CYGPATH_EXECUTABLE} -S 552 | RESULT_VARIABLE env_rv 553 | OUTPUT_VARIABLE env_sysdir 554 | ERROR_VARIABLE env_ev 555 | OUTPUT_STRIP_TRAILING_WHITESPACE) 556 | if(NOT env_rv STREQUAL "0") 557 | message(FATAL_ERROR "${CYGPATH_EXECUTABLE} -S failed: ${env_rv}\n${env_ev}") 558 | endif() 559 | string(TOLOWER "${env_windir}" windir) 560 | string(TOLOWER "${env_sysdir}" sysroot) 561 | 562 | if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*(msvc|api-ms-win-|vcruntime)[^/]+dll)") 563 | set(is_system 1) 564 | endif() 565 | endif() 566 | endif() 567 | endif() 568 | 569 | if(NOT is_system) 570 | get_filename_component(original_path "${original_lower}" PATH) 571 | get_filename_component(path "${lower}" PATH) 572 | if(original_path STREQUAL path) 573 | set(is_local 1) 574 | else() 575 | string(LENGTH "${original_path}/" original_length) 576 | string(LENGTH "${lower}" path_length) 577 | if(${path_length} GREATER ${original_length}) 578 | string(SUBSTRING "${lower}" 0 ${original_length} path) 579 | if("${original_path}/" STREQUAL path) 580 | set(is_embedded 1) 581 | endif() 582 | endif() 583 | endif() 584 | endif() 585 | endif() 586 | 587 | # Return type string based on computed booleans: 588 | # 589 | set(type "other") 590 | 591 | if(is_system) 592 | set(type "system") 593 | elseif(is_embedded) 594 | set(type "embedded") 595 | elseif(is_local) 596 | set(type "local") 597 | endif() 598 | 599 | #message(STATUS "gp_resolved_file_type: '${file}' '${resolved_file}'") 600 | #message(STATUS " type: '${type}'") 601 | 602 | if(NOT is_embedded) 603 | if(NOT IS_ABSOLUTE "${resolved_file}") 604 | if(lower MATCHES "^(msvc|api-ms-win-|vcruntime)[^/]+dll" AND is_system) 605 | message(STATUS "info: non-absolute msvc file '${file}' returning type '${type}'") 606 | else() 607 | message(STATUS "warning: gp_resolved_file_type non-absolute file '${file}' returning type '${type}' -- possibly incorrect") 608 | endif() 609 | endif() 610 | endif() 611 | 612 | # Provide a hook so that projects can override the decision on whether a 613 | # library belongs to the system or not by whatever logic they choose: 614 | # 615 | if(COMMAND gp_resolved_file_type_override) 616 | gp_resolved_file_type_override("${resolved_file}" type) 617 | endif() 618 | 619 | set(${type_var} "${type}" PARENT_SCOPE) 620 | 621 | #message(STATUS "**") 622 | endfunction() 623 | 624 | 625 | function(gp_file_type original_file file type_var) 626 | if(NOT IS_ABSOLUTE "${original_file}") 627 | message(STATUS "warning: gp_file_type expects absolute full path for first arg original_file") 628 | endif() 629 | 630 | get_filename_component(exepath "${original_file}" PATH) 631 | 632 | set(type "") 633 | gp_resolved_file_type("${original_file}" "${file}" "${exepath}" "" type) 634 | 635 | set(${type_var} "${type}" PARENT_SCOPE) 636 | endfunction() 637 | 638 | 639 | function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs) 640 | set(verbose 0) 641 | set(eol_char "E") 642 | if(ARGC GREATER 6) 643 | set(rpaths "${ARGV6}") 644 | else() 645 | set(rpaths "") 646 | endif() 647 | 648 | if(GET_PREREQUISITES_VERBOSE) 649 | set(verbose 1) 650 | endif() 651 | 652 | if(NOT IS_ABSOLUTE "${target}") 653 | message("warning: target '${target}' is not absolute...") 654 | endif() 655 | 656 | if(NOT EXISTS "${target}") 657 | message("warning: target '${target}' does not exist...") 658 | return() 659 | endif() 660 | 661 | # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang) 662 | file(READ ${target} file_contents LIMIT 5) 663 | if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES "^#!") 664 | message(STATUS "GetPrequisites(${target}) : ignoring script file") 665 | # Clear var 666 | set(${prerequisites_var} "" PARENT_SCOPE) 667 | return() 668 | endif() 669 | 670 | set(gp_cmd_paths ${gp_cmd_paths} 671 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin" 672 | "$ENV{VS140COMNTOOLS}/../../VC/bin" 673 | "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin" 674 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]/../../VC/bin" 675 | "$ENV{VS120COMNTOOLS}/../../VC/bin" 676 | "C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin" 677 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]/../../VC/bin" 678 | "$ENV{VS110COMNTOOLS}/../../VC/bin" 679 | "C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin" 680 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/bin" 681 | "$ENV{VS100COMNTOOLS}/../../VC/bin" 682 | "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin" 683 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/bin" 684 | "$ENV{VS90COMNTOOLS}/../../VC/bin" 685 | "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin" 686 | "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin" 687 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/bin" 688 | "$ENV{VS80COMNTOOLS}/../../VC/bin" 689 | "C:/Program Files/Microsoft Visual Studio 8/VC/BIN" 690 | "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN" 691 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1;InstallDir]/../../VC7/bin" 692 | "$ENV{VS71COMNTOOLS}/../../VC7/bin" 693 | "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN" 694 | "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN" 695 | ) 696 | 697 | # 698 | # 699 | # Try to choose the right tool by default. Caller can set gp_tool prior to 700 | # calling this function to force using a different tool. 701 | # 702 | if(NOT gp_tool) 703 | set(gp_tool "ldd") 704 | 705 | if(APPLE) 706 | set(gp_tool "otool") 707 | endif() 708 | 709 | if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har! 710 | find_program(gp_dumpbin "dumpbin" PATHS ${gp_cmd_paths}) 711 | if(gp_dumpbin) 712 | set(gp_tool "dumpbin") 713 | elseif(CMAKE_OBJDUMP) # Try harder. Maybe we're on MinGW 714 | set(gp_tool "${CMAKE_OBJDUMP}") 715 | else() 716 | set(gp_tool "objdump") 717 | endif() 718 | endif() 719 | endif() 720 | 721 | find_program(gp_cmd ${gp_tool} PATHS ${gp_cmd_paths}) 722 | 723 | if(NOT gp_cmd) 724 | message(STATUS "warning: could not find '${gp_tool}' - cannot analyze prerequisites...") 725 | return() 726 | endif() 727 | 728 | set(gp_cmd_maybe_filter) # optional command to pre-filter gp_tool results 729 | 730 | if(gp_tool MATCHES "ldd$") 731 | set(gp_cmd_args "") 732 | set(gp_regex "^[\t ]*[^\t ]+ =>[\t ]+([^\t\(]+)( \(.+\))?${eol_char}$") 733 | set(gp_regex_error "not found${eol_char}$") 734 | set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") 735 | set(gp_regex_cmp_count 1) 736 | elseif(gp_tool MATCHES "otool$") 737 | set(gp_cmd_args "-L") 738 | set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") 739 | set(gp_regex_error "") 740 | set(gp_regex_fallback "") 741 | set(gp_regex_cmp_count 3) 742 | elseif(gp_tool MATCHES "dumpbin$") 743 | set(gp_cmd_args "/dependents") 744 | set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$") 745 | set(gp_regex_error "") 746 | set(gp_regex_fallback "") 747 | set(gp_regex_cmp_count 1) 748 | elseif(gp_tool MATCHES "objdump$") 749 | set(gp_cmd_args "-p") 750 | set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$") 751 | set(gp_regex_error "") 752 | set(gp_regex_fallback "") 753 | set(gp_regex_cmp_count 1) 754 | # objdump generates copious output so we create a grep filter to pre-filter results 755 | if(WIN32) 756 | find_program(gp_grep_cmd findstr) 757 | else() 758 | find_program(gp_grep_cmd grep) 759 | endif() 760 | if(gp_grep_cmd) 761 | set(gp_cmd_maybe_filter COMMAND ${gp_grep_cmd} "-a" "^[[:blank:]]*DLL Name: ") 762 | endif() 763 | else() 764 | message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...") 765 | message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'") 766 | message(STATUS "Valid gp_tool values are dumpbin, ldd, objdump and otool.") 767 | return() 768 | endif() 769 | 770 | 771 | if(gp_tool MATCHES "dumpbin$") 772 | # When running dumpbin, it also needs the "Common7/IDE" directory in the 773 | # PATH. It will already be in the PATH if being run from a Visual Studio 774 | # command prompt. Add it to the PATH here in case we are running from a 775 | # different command prompt. 776 | # 777 | get_filename_component(gp_cmd_dir "${gp_cmd}" PATH) 778 | get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE) 779 | # Use cmake paths as a user may have a PATH element ending with a backslash. 780 | # This will escape the list delimiter and create havoc! 781 | if(EXISTS "${gp_cmd_dlls_dir}") 782 | # only add to the path if it is not already in the path 783 | set(gp_found_cmd_dlls_dir 0) 784 | file(TO_CMAKE_PATH "$ENV{PATH}" env_path) 785 | foreach(gp_env_path_element ${env_path}) 786 | if(gp_env_path_element STREQUAL gp_cmd_dlls_dir) 787 | set(gp_found_cmd_dlls_dir 1) 788 | endif() 789 | endforeach() 790 | 791 | if(NOT gp_found_cmd_dlls_dir) 792 | file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir) 793 | set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}") 794 | endif() 795 | endif() 796 | endif() 797 | # 798 | # 799 | 800 | if(gp_tool MATCHES "ldd$") 801 | set(old_ld_env "$ENV{LD_LIBRARY_PATH}") 802 | set(new_ld_env "${exepath}") 803 | foreach(dir ${dirs}) 804 | string(APPEND new_ld_env ":${dir}") 805 | endforeach() 806 | set(ENV{LD_LIBRARY_PATH} "${new_ld_env}:$ENV{LD_LIBRARY_PATH}") 807 | endif() 808 | 809 | 810 | # Track new prerequisites at each new level of recursion. Start with an 811 | # empty list at each level: 812 | # 813 | set(unseen_prereqs) 814 | 815 | # Run gp_cmd on the target: 816 | # 817 | execute_process( 818 | COMMAND ${gp_cmd} ${gp_cmd_args} ${target} 819 | ${gp_cmd_maybe_filter} 820 | RESULT_VARIABLE gp_rv 821 | OUTPUT_VARIABLE gp_cmd_ov 822 | ERROR_VARIABLE gp_ev 823 | ) 824 | 825 | if(gp_tool MATCHES "dumpbin$") 826 | # Exclude delay load dependencies under windows (they are listed in dumpbin output after the message below) 827 | string(FIND "${gp_cmd_ov}" "Image has the following delay load dependencies" gp_delayload_pos) 828 | if (${gp_delayload_pos} GREATER -1) 829 | string(SUBSTRING "${gp_cmd_ov}" 0 ${gp_delayload_pos} gp_cmd_ov_no_delayload_deps) 830 | string(SUBSTRING "${gp_cmd_ov}" ${gp_delayload_pos} -1 gp_cmd_ov_delayload_deps) 831 | if (verbose) 832 | message(STATUS "GetPrequisites(${target}) : ignoring the following delay load dependencies :\n ${gp_cmd_ov_delayload_deps}") 833 | endif() 834 | set(gp_cmd_ov ${gp_cmd_ov_no_delayload_deps}) 835 | endif() 836 | endif() 837 | 838 | if(NOT gp_rv STREQUAL "0") 839 | if(gp_tool MATCHES "dumpbin$") 840 | # dumpbin error messages seem to go to stdout 841 | message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}\n${gp_cmd_ov}") 842 | else() 843 | message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}") 844 | endif() 845 | endif() 846 | 847 | if(gp_tool MATCHES "ldd$") 848 | set(ENV{LD_LIBRARY_PATH} "${old_ld_env}") 849 | endif() 850 | 851 | if(verbose) 852 | message(STATUS "") 853 | message(STATUS "gp_cmd_ov='${gp_cmd_ov}'") 854 | message(STATUS "") 855 | endif() 856 | 857 | get_filename_component(target_dir "${target}" PATH) 858 | 859 | # Convert to a list of lines: 860 | # 861 | string(REPLACE ";" "\\;" candidates "${gp_cmd_ov}") 862 | string(REPLACE "\n" "${eol_char};" candidates "${candidates}") 863 | 864 | # check for install id and remove it from list, since otool -L can include a 865 | # reference to itself 866 | set(gp_install_id) 867 | if(gp_tool MATCHES "otool$") 868 | execute_process( 869 | COMMAND ${gp_cmd} -D ${target} 870 | RESULT_VARIABLE otool_rv 871 | OUTPUT_VARIABLE gp_install_id_ov 872 | ERROR_VARIABLE otool_ev 873 | ) 874 | if(NOT otool_rv STREQUAL "0") 875 | message(FATAL_ERROR "otool -D failed: ${otool_rv}\n${otool_ev}") 876 | endif() 877 | # second line is install name 878 | string(REGEX REPLACE ".*:\n" "" gp_install_id "${gp_install_id_ov}") 879 | if(gp_install_id) 880 | # trim 881 | string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}") 882 | #message("INSTALL ID is \"${gp_install_id}\"") 883 | endif() 884 | endif() 885 | 886 | # Analyze each line for file names that match the regular expression: 887 | # 888 | foreach(candidate ${candidates}) 889 | if("${candidate}" MATCHES "${gp_regex}") 890 | 891 | # Extract information from each candidate: 892 | if(gp_regex_error AND "${candidate}" MATCHES "${gp_regex_error}") 893 | string(REGEX REPLACE "${gp_regex_fallback}" "\\1" raw_item "${candidate}") 894 | else() 895 | string(REGEX REPLACE "${gp_regex}" "\\1" raw_item "${candidate}") 896 | endif() 897 | 898 | if(gp_regex_cmp_count GREATER 1) 899 | string(REGEX REPLACE "${gp_regex}" "\\2" raw_compat_version "${candidate}") 900 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}") 901 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}") 902 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}") 903 | endif() 904 | 905 | if(gp_regex_cmp_count GREATER 2) 906 | string(REGEX REPLACE "${gp_regex}" "\\3" raw_current_version "${candidate}") 907 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}") 908 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}") 909 | string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}") 910 | endif() 911 | 912 | # Use the raw_item as the list entries returned by this function. Use the 913 | # gp_resolve_item function to resolve it to an actual full path file if 914 | # necessary. 915 | # 916 | set(item "${raw_item}") 917 | 918 | # Add each item unless it is excluded: 919 | # 920 | set(add_item 1) 921 | 922 | if(item STREQUAL gp_install_id) 923 | set(add_item 0) 924 | endif() 925 | 926 | if(add_item AND ${exclude_system}) 927 | set(type "") 928 | gp_resolved_file_type("${target}" "${item}" "${exepath}" "${dirs}" type "${rpaths}") 929 | 930 | if(type STREQUAL "system") 931 | set(add_item 0) 932 | endif() 933 | endif() 934 | 935 | if(add_item) 936 | list(LENGTH ${prerequisites_var} list_length_before_append) 937 | gp_append_unique(${prerequisites_var} "${item}") 938 | list(LENGTH ${prerequisites_var} list_length_after_append) 939 | 940 | if(${recurse}) 941 | # If item was really added, this is the first time we have seen it. 942 | # Add it to unseen_prereqs so that we can recursively add *its* 943 | # prerequisites... 944 | # 945 | # But first: resolve its name to an absolute full path name such 946 | # that the analysis tools can simply accept it as input. 947 | # 948 | if(NOT list_length_before_append EQUAL list_length_after_append) 949 | gp_resolve_item("${target}" "${item}" "${exepath}" "${dirs}" resolved_item "${rpaths}") 950 | if(EXISTS "${resolved_item}") 951 | # Recurse only if we could resolve the item. 952 | # Otherwise the prerequisites_var list will be cleared 953 | set(unseen_prereqs ${unseen_prereqs} "${resolved_item}") 954 | endif() 955 | endif() 956 | endif() 957 | endif() 958 | else() 959 | if(verbose) 960 | message(STATUS "ignoring non-matching line: '${candidate}'") 961 | endif() 962 | endif() 963 | endforeach() 964 | 965 | list(LENGTH ${prerequisites_var} prerequisites_var_length) 966 | if(prerequisites_var_length GREATER 0) 967 | list(SORT ${prerequisites_var}) 968 | endif() 969 | if(${recurse}) 970 | set(more_inputs ${unseen_prereqs}) 971 | foreach(input ${more_inputs}) 972 | get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} ${recurse} "${exepath}" "${dirs}" "${rpaths}") 973 | endforeach() 974 | endif() 975 | 976 | set(${prerequisites_var} ${${prerequisites_var}} PARENT_SCOPE) 977 | endfunction() 978 | 979 | 980 | function(list_prerequisites target) 981 | if(ARGC GREATER 1 AND NOT "${ARGV1}" STREQUAL "") 982 | set(all "${ARGV1}") 983 | else() 984 | set(all 1) 985 | endif() 986 | 987 | if(ARGC GREATER 2 AND NOT "${ARGV2}" STREQUAL "") 988 | set(exclude_system "${ARGV2}") 989 | else() 990 | set(exclude_system 0) 991 | endif() 992 | 993 | if(ARGC GREATER 3 AND NOT "${ARGV3}" STREQUAL "") 994 | set(verbose "${ARGV3}") 995 | else() 996 | set(verbose 0) 997 | endif() 998 | 999 | set(count 0) 1000 | set(count_str "") 1001 | set(print_count "${verbose}") 1002 | set(print_prerequisite_type "${verbose}") 1003 | set(print_target "${verbose}") 1004 | set(type_str "") 1005 | 1006 | get_filename_component(exepath "${target}" PATH) 1007 | 1008 | set(prereqs "") 1009 | get_prerequisites("${target}" prereqs ${exclude_system} ${all} "${exepath}" "") 1010 | 1011 | if(print_target) 1012 | message(STATUS "File '${target}' depends on:") 1013 | endif() 1014 | 1015 | foreach(d ${prereqs}) 1016 | math(EXPR count "${count} + 1") 1017 | 1018 | if(print_count) 1019 | set(count_str "${count}. ") 1020 | endif() 1021 | 1022 | if(print_prerequisite_type) 1023 | gp_file_type("${target}" "${d}" type) 1024 | set(type_str " (${type})") 1025 | endif() 1026 | 1027 | message(STATUS "${count_str}${d}${type_str}") 1028 | endforeach() 1029 | endfunction() 1030 | 1031 | 1032 | function(list_prerequisites_by_glob glob_arg glob_exp) 1033 | message(STATUS "=============================================================================") 1034 | message(STATUS "List prerequisites of executables matching ${glob_arg} '${glob_exp}'") 1035 | message(STATUS "") 1036 | file(${glob_arg} file_list ${glob_exp}) 1037 | foreach(f ${file_list}) 1038 | is_file_executable("${f}" is_f_executable) 1039 | if(is_f_executable) 1040 | message(STATUS "=============================================================================") 1041 | list_prerequisites("${f}" ${ARGN}) 1042 | message(STATUS "") 1043 | endif() 1044 | endforeach() 1045 | endfunction() 1046 | 1047 | cmake_policy(POP) 1048 | --------------------------------------------------------------------------------