From c3db577e93574ccfbc452b91cc7432fc7f902b2d Mon Sep 17 00:00:00 2001 From: Emily Mabrey Date: Mon, 23 Aug 2021 11:25:34 -0400 Subject: [PATCH] Refactor build and CI configurations Reword vcpkg caching comment Make comment about wxwidgets Linux/macOS workaround more clear Give each step of `cmake_build.yml` workflow a unique ID Change cache lookups to use step's id instead of step's name Add glob protection to runner OS detection in CI Set new default CI build type of MinSizeRel Ensure consistent formatting across `CMakeLists.txt` files Change mimetypes generated on Linux to use tenacity-project mimetype Add more explanatory comments to both `CMakeLists.txt` Replace improper build architecture debug messages Signed-off-by: Emily Mabrey --- .github/workflows/cmake_build.yml | 325 ++-- CMakeLists.txt | 1107 +++++++------ src/CMakeLists.txt | 2555 ++++++++++++++--------------- 3 files changed, 2046 insertions(+), 1941 deletions(-) diff --git a/.github/workflows/cmake_build.yml b/.github/workflows/cmake_build.yml index 0e4a57e6d..9e1d3b61c 100644 --- a/.github/workflows/cmake_build.yml +++ b/.github/workflows/cmake_build.yml @@ -18,70 +18,94 @@ jobs: strategy: fail-fast: false matrix: + # Matrix id format: {os}-{osname}-{osversion}-{arch}-{triplet}-{generator(_platform)} + # Replace - with _ + # Remove . config: - - - name: Ubuntu_20.04 + - name: Linux - Ubuntu 20.04 (x86_64) - Ninja + id: linux-ubuntu-2004-x86_64-x64_linux-ninja os: ubuntu-20.04 - arch: x86_64 # as reported by `arch` or `uname -m` - compiler_cache: ccache - compiler_cache_path: ~/.ccache - vcpkg_binary_cache: ~/.cache/vcpkg + arch: x86_64 vcpkg_triplet: x64-linux - wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git - wxwidgets_git_ref: v3.1.5 - WX_CONFIG: /home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config + CMAKE_GENERATOR: Ninja - - name: macOS_Intel - os: macos-latest - arch: Intel # as reported by Apple menu > About This Mac - compiler_cache: ccache - compiler_cache_path: ~/Library/Caches/ccache - vcpkg_binary_cache: ~/.cache/vcpkg + - name: macOS - Big Sur 11 (Intel) - Ninja + id: macos-bigsur-1100-intel-x64_osx_1012min-ninja + os: macos-11 + arch: Intel vcpkg_triplet: x64-osx-10.12min - wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git - wxwidgets_git_ref: v3.1.5 - WX_CONFIG: /Users/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config + CMAKE_GENERATOR: Ninja - - name: Windows_32bit - os: windows-latest - arch: x86 - # required so CMake uses MSVC rather than MinGW - cc: cl - cxx: cl - compiler_cache: sccache - compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache - vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg - vcpkg_triplet: x86-windows - exe_suffix: .exe + - name: macOS - Catalina 10.15 (Intel) - Ninja + id: macos-catalina-1015-intel-x64_osx_1012min-ninja + os: macos-10.15 + arch: Intel + vcpkg_triplet: x64-osx-10.12min + CMAKE_GENERATOR: Ninja - - name: Windows_64bit - os: windows-latest + - name: Windows - Server 2019 (amd64) - Visual Studio 2019 + id: windows-server-2019-amd64-x64_windows-vs2019_x64 + os: windows-2019 arch: amd64 - # required so CMake uses MSVC rather than MinGW - cc: cl - cxx: cl - compiler_cache: sccache - compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache - vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg vcpkg_triplet: x64-windows - exe_suffix: .exe + CMAKE_GENERATOR: Visual Studio 16 2019 + CMAKE_GENERATOR_PLATFORM: x64 + + - name: Windows - Server 2019 (win32) - Visual Studio 2019 + id: windows-server-2019-x86-x86_windows-vs2019_win32 + os: windows-2019 + arch: x86 + vcpkg_triplet: x86-windows + CMAKE_GENERATOR: Visual Studio 16 2019 + CMAKE_GENERATOR_PLATFORM: win32 + + - name: Windows - Server 2019 (amd64) - Ninja + id: windows-server-2019-amd64-x64_windows-ninja + os: windows-2019 + arch: amd64 + vcpkg_triplet: x64-windows + CMAKE_GENERATOR: Ninja + + - name: Windows - Server 2019 (win32) - Ninja + id: windows-server-2019-x86-x86_windows-ninja + os: windows-2019 + arch: x86 + vcpkg_triplet: x86-windows + CMAKE_GENERATOR: Ninja + env: - CMAKE_BUILD_TYPE: RelWithDebInfo - CMAKE_C_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }} - CMAKE_CXX_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }} + + AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }} MACOSX_DEPLOYMENT_TARGET: 10.12 + # CMake settings + CMAKE_BUILD_TYPE: MinSizeRel + CMAKE_GENERATOR: ${{matrix.config.CMAKE_GENERATOR}} + CMAKE_GENERATOR_PLATFORM: ${{matrix.config.CMAKE_GENERATOR_PLATFORM}} + + # vcpkg settings VCPKG_DISABLE_METRICS: true VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vcpkg_triplet }} VCPKG_BINARY_SOURCES: "clear;default,readwrite;nuget,https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget,readwrite" + # Artifactory cache settings + JFROG_ARTIFACTORY_NUGET_USER: ${{secrets.JFROG_ARTIFACTORY_NUGET_USER}} + JFROG_ARTIFACTORY_NUGET_PASS: ${{secrets.JFROG_ARTIFACTORY_NUGET_PASS}} + JFROG_ARTIFACTORY_NUGET_TOKEN: ${{secrets.JFROG_ARTIFACTORY_NUGET_TOKEN}} + + # Apple codesigning + APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }} + APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }} + APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} + # Windows codesigning - # This variables will be used by all the steps WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }} WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }} - AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }} + # WxWidgets info for Linux and macOS builds + WX_GIT_URL: https://github.com/wxWidgets/wxWidgets.git + WX_GIT_REF: v3.1.5 steps: @@ -90,22 +114,63 @@ jobs: with: submodules: true + - name: Get Git commit of vcpkg submodule + run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV} + + - name: Setup platform specific environmental variables + run: | + if [[ "${{runner.os}}" == "Windows" ]]; then + echo "Using Windows specific env vars" + echo COMPILER_CACHE_PATH=C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache >> ${GITHUB_ENV} + echo COMPILER_CACHE=sccache >> ${GITHUB_ENV} + echo EXE_SUFFIX=.exe >> ${GITHUB_ENV} + echo VCPKG_CACHE_PATH=C:\Users\runneradmin\AppData\Local\vcpkg >> ${GITHUB_ENV} + echo CMAKE_C_COMPILER_LAUNCHER=sccache >> ${GITHUB_ENV} + echo CMAKE_CXX_COMPILER_LAUNCHER=sccache >> ${GITHUB_ENV} + if [[ "${{ env.CMAKE_GENERATOR }}" == "Ninja" ]]; then + echo CC=cl >> ${GITHUB_ENV} + echo CXX=cl >> ${GITHUB_ENV} + fi + else + echo "Using non-Windows env vars" + echo COMPILER_CACHE_PATH= ~/Library/Caches/ccache >> ${GITHUB_ENV} + echo COMPILER_CACHE=ccache >> ${GITHUB_ENV} + echo EXE_SUFFIX= >> ${GITHUB_ENV} + echo VCPKG_CACHE_PATH=~/.cache/vcpkg >> ${GITHUB_ENV} + echo CMAKE_C_COMPILER_LAUNCHER=ccache >> ${GITHUB_ENV} + echo CMAKE_CXX_COMPILER_LAUNCHER=ccache >> ${GITHUB_ENV} + if [[ "${{runner.os}}" == "Linux" ]]; then + echo WX_INSTALL_DIR=/home/runner/work/tenacity/tenacity/wxwidgets-install >> ${GITHUB_ENV} + echo WX_CONFIG=/home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config >> ${GITHUB_ENV} + else + echo WX_INSTALL_DIR=/Users/runner/work/tenacity/tenacity/wxwidgets-install >> ${GITHUB_ENV} + echo WX_CONFIG=/Users/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config >> ${GITHUB_ENV} + fi + fi + + - name: "[macOS] Install Apple codesigning certificates" + uses: apple-actions/import-codesign-certs@v1 + if: startswith( matrix.config.os, 'macos' ) && github.repository_owner == 'tenacityteam' && github.event_name == 'create' && github.event.ref_type == 'tag' + with: + p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }} + p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + + - name: "[Windows] Set up MSVC Developer Command Prompt" + if: runner.os == 'Windows' + uses: seanmiddleditch/gha-setup-vsdevenv@v3 + with: + arch: ${{ matrix.config.arch }} + - name: Install Nuget uses: nuget/setup-nuget@v1 with: - # Nuget versions needs to be the same version that vcpkg expects - # So update them in parallel nuget-version: 5.10.0 - - name: Authenticate CI to Artifactory + - name: "[On Push] Authenticate CI to Artifactory" if: github.event_name == 'push' && github.repository_owner == 'tenacityteam' run: | nuget sources Add -Name Artifactory -Source https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget -username ${JFROG_ARTIFACTORY_NUGET_USER} -password ${JFROG_ARTIFACTORY_NUGET_PASS} -ForceEnglishOutput -NonInteractive nuget setapikey ${JFROG_ARTIFACTORY_NUGET_USER}:${JFROG_ARTIFACTORY_NUGET_TOKEN} -Source Artifactory -ForceEnglishOutput -NonInteractive - env: - JFROG_ARTIFACTORY_NUGET_USER: ${{secrets.JFROG_ARTIFACTORY_NUGET_USER}} - JFROG_ARTIFACTORY_NUGET_PASS: ${{secrets.JFROG_ARTIFACTORY_NUGET_PASS}} - JFROG_ARTIFACTORY_NUGET_TOKEN: ${{secrets.JFROG_ARTIFACTORY_NUGET_TOKEN}} - name: "[Linux] Install dependencies" if: runner.os == 'Linux' @@ -114,9 +179,9 @@ jobs: sudo apt-get install -y --no-install-recommends file g++ - ninja-build - nasm - git + ninja-build + nasm + git wget bash scdoc @@ -127,7 +192,6 @@ jobs: libgtk-3-dev libsuil-dev gettext - - name: "[MacOS] Install dependencies" if: runner.os == 'macOS' run: >- @@ -136,7 +200,6 @@ jobs: ccache ninja nasm - - name: "[Windows] Install dependencies" if: runner.os == 'Windows' shell: pwsh @@ -148,126 +211,90 @@ jobs: iwr -useb get.scoop.sh | iex scoop install sccache - - name: Install Apple codesigning certificates - uses: apple-actions/import-codesign-certs@v1 - if: startswith( matrix.config.os, 'macos' ) && github.repository_owner == 'tenacityteam' && github.event_name == 'create' && github.event.ref_type == 'tag' - with: - p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }} - p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} - - # required for CMake to find Ninja - - name: "[Windows] Set up MSVC Developer Command Prompt" - if: runner.os == 'Windows' - uses: seanmiddleditch/gha-setup-vsdevenv@v3 - with: - arch: ${{ matrix.config.arch }} - - - name: Get Git commit of vcpkg submodule - run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV} - + # Cache the vcpkg cache and the vcpkg executable to avoid bootstrapping each time - name: Setup vcpkg cache uses: actions/cache@v2 with: - # cache the vcpkg executable to avoid having to bootstrap vcpkg every time path: | - ${{ github.workspace }}/vcpkg/vcpkg${{ matrix.config.exe_suffix }} - ${{ matrix.config.vcpkg_binary_cache }} - key: ${{ matrix.config.name }}-${{ hashFiles('**/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-${{ github.run_number }} + ${{ github.workspace }}/vcpkg/vcpkg${{ env.EXE_SUFFIX }} + ${{ env.VCPKG_CACHE_PATH }} + key: ${{ matrix.config.id }}-${{ hashFiles('**/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-${{ github.run_number }} restore-keys: | - ${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}- - ${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}- - ${{ matrix.config.name }}- + ${{ matrix.config.id }}-${{ hashFiles(' **/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}- + ${{ matrix.config.id }}-${{ hashFiles(' **/vcpkg.json') }}- + ${{ matrix.config.id }}- + + - name: "[Linux/macOS] Set up wxWidgets cache" + uses: actions/cache@v2 + id: wxwidgets-cache + if: runner.os != 'Windows' + with: + path: ${{ env.WX_INSTALL_DIR }} + key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ env.WX_GIT_URL }}-${{ env.WX_GIT_REF }} + + # FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS + # https://github.com/microsoft/vcpkg/pull/17111 + - name: "[Linux/macOS] Build and install wxWidgets" + if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' + run: | + # wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules + git clone --recurse-submodules ${{ env.WX_GIT_URL }} + cd wxWidgets + git checkout ${{ env.WX_GIT_REF }} + cmake -S . -B cmake_build -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -D CMAKE_INSTALL_PREFIX=${{ env.WX_INSTALL_DIR }} + cmake --build cmake_build + cmake --install cmake_build + + - name: Set up compiler cache + uses: actions/cache@v2 + with: + path: ${{ env.COMPILER_CACHE_PATH }} + key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }} + restore-keys: | + ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}- + ${{ matrix.config.os }}-${{ matrix.config.arch }}- # FIXME: hack around bad SSL certificate, needed to build ffmpeg # https://github.com/microsoft/vcpkg/issues/19121 - name: "[Windows] Install yasm" if: runner.os == 'Windows' run: | - mkdir -p "vcpkg/downloads/tools/yasm/1.3.0.6" - curl -k -o "vcpkg/downloads/tools/yasm/1.3.0.6/yasm.exe" \ - "http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe" - - - name: "Set up wxwidgets cache" - uses: actions/cache@v2 - id: wxwidgets-cache - if: runner.os != 'Windows' - with: - path: ${{ github.workspace }}/wxwidgets-install - key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.wxwidgets_git_url }}-${{ matrix.config.wxwidgets_git_ref }} - - # FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS - # https://github.com/microsoft/vcpkg/pull/17111 - - name: Build and install wxWidgets - if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows' - run: | - # wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules - git clone --recurse-submodules ${{ matrix.config.wxwidgets_git_url }} - cd wxWidgets - git checkout ${{ matrix.config.wxwidgets_git_ref }} - cmake -G Ninja -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/wxwidgets-install \ - -S . -B cmake_build - cmake --build cmake_build - cmake --install cmake_build - - - name: "Set up compiler cache" - uses: actions/cache@v2 - with: - path: ${{ matrix.config.compiler_cache_path }} - key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }} - restore-keys: | - ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}- - ${{ matrix.config.os }}-${{ matrix.config.arch }}- + mkdir -p "${YASM_OUTPUT_DIR}" + curl -k -o "${YASM_OUTPUT_DIR}/yasm.exe" "http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe" + env: + YASM_OUTPUT_DIR: vcpkg/downloads/tools/yasm/1.3.0.6 - name: Configure - run: >- - cmake - -G Ninja - -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} - -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install - -D VCPKG=ON - -S . - -B build - env: - # Apple code signing - APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }} - APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }} - APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} - CC: ${{ matrix.config.cc }} - CXX: ${{ matrix.config.cxx }} - # hack to get CMake to find wxWidgets until vcpkg wxWidgets port is fixed - # https://github.com/microsoft/vcpkg/pull/17111 - WX_CONFIG: ${{ matrix.config.WX_CONFIG }} + run: cmake -B build -D VCPKG=ON -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install - name: Build run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose - - name: "Print compiler cache stats" - run: ${{ matrix.config.compiler_cache }} -s + - name: Print compiler cache stats + run: ${{ env.COMPILER_CACHE}} -s - name: Install run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose - - name: "[Windows] Package" - if: runner.os == 'Windows' - run: cmake --build build --target innosetup --config ${{ env.CMAKE_BUILD_TYPE }} - - - name: "[Ubuntu/macOS] Package" - if: runner.os != 'Windows' - working-directory: build - run: >- - cpack - -C ${{ env.CMAKE_BUILD_TYPE }} - -D CPACK_COMMAND_HDIUTIL=${{ github.workspace }}/scripts/ci/macos/repeat_hdiutil.sh - --verbose - && rm -r package/_CPack_Packages + - name: Package + run: | + if [[ "${{runner.os}}" == "Windows" ]]; then + cmake --build build --target innosetup --config ${{ env.CMAKE_BUILD_TYPE }} + else + cd build + cpack -C ${{ env.CMAKE_BUILD_TYPE }} -D CPACK_COMMAND_HDIUTIL=${{ env.CPACK_COMMAND_HDIUTIL }} --verbose + rm -r package/_CPack_Packages + fi env: - # Required for linuxdeploy to find wxWidgets libraries installed without a package manager - WXWIDGETS_LD_LIBRARY_PATH: ${{ github.workspace }}/wxwidgets-install/lib + # Workaround for CPack hdiutil/ finder service race condition bug + CPACK_COMMAND_HDIUTIL: ${{ github.workspace }}/scripts/ci/macos/repeat_hdiutil.sh + # Required on Linux to find wxWidgets libraries installed without a package manager + WXWIDGETS_LD_LIBRARY_PATH: ${{ env.WX_INSTALL_DIR }}/lib - name: Upload package artifact uses: actions/upload-artifact@v2 with: - name: Tenacity_${{ matrix.config.name }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }} + name: Tenacity_${{ matrix.config.id }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }} path: build/package/* if-no-files-found: error diff --git a/CMakeLists.txt b/CMakeLists.txt index c03de09c9..7dc4e97cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,214 +1,250 @@ # /\_/\ -# ________(' - ') -# _____( ) -# / (______________) +# ________(' - ' ) +# _____( ) +# / ( ______________ ) # ' | | | | # | | | | hello # '"' '"' - -# If you want built-in precompiled header support -# then make sure you have cmake 3.16 or higher. +# If you want built-in pre-compiled header support then make sure you have cmake 3.16 or higher. # -# Minimum required is 3.15 due to use of multiple values in -# generator expressions. -cmake_minimum_required( VERSION 3.15 ) +# Minimum required is 3.15 due to use of multiple values in generator expressions. +cmake_minimum_required( VERSION 3.15 FATAL_ERROR ) -find_package(Git) +# ~~~~~~~~~~~~~~ +# CMake Policies +# ~~~~~~~~~~~~~~ -if(WIN32 OR APPLE) - option(VCPKG "Use vcpkg for dependencies" ON) -else() - option(VCPKG "Use vcpkg for dependencies" OFF) -endif() - -if(VCPKG) - set(ENV{VCPKG_DISABLE_METRICS} true) - if(NOT DEFINED ENV{VCPKG_BINARY_SOURCES}) - set(ENV{VCPKG_BINARY_SOURCES} "clear;default,readwrite;nuget,https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget,read") - endif() - set(ENV{VCPKG_FEATURE_FLAGS} "-compilertracking,manifests,registries,versions") - - if(VCPKG_ROOT) - message(STATUS "Using dependencies from vcpkg repository at ${VCPKG_ROOT}") - if(NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh") - message(FATAL_ERROR "${VCPKG_ROOT} is not a vcpkg Git repository.") - endif() - else() - message(STATUS "Using dependencies from vcpkg Git submodule") - set(VCPKG_ROOT "${CMAKE_SOURCE_DIR}/vcpkg") - - if(NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh") - message(STATUS "Initializing vcpkg Git submodule") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule init WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") - endif() - endif() - - if(NOT DEFINED VCPKG_OVERLAY_PORTS) - set(VCPKG_OVERLAY_PORTS "${VCPKG_ROOT}/overlay/ports") - endif() - - if(NOT DEFINED VCPKG_OVERLAY_TRIPLETS) - set(VCPKG_OVERLAY_TRIPLETS "${VCPKG_ROOT}/overlay/triplets") - endif() - - if(NOT DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET) - if(APPLE) - set(VCPKG_TARGET_TRIPLET "x64-osx-10.12min") - endif() - elseif(DEFINED ENV{VCPKG_DEFAULT_TRIPLET}) - set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}") - endif() - - set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") -else() - message(STATUS "Searching for dependencies from system, not using vcpkg.") -endif() - -# If building with GNU compiler, then must be 4.9 or later. -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND - CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") - message(FATAL_ERROR "Tenacity requires at least GCC 4.9") -endif () - -# We only do alpha builds, beta builds, and release versions. -# Most of the time we're in development, so AUDACITY_BUILD_LEVEL should be -# defined to 0. -# Its value may be more than 0 for pre-release "Beta" builds that differ only -# in the welcome screen, and hiding of some development menu commands, but -# still link to the alpha manual online. - -# Set this value to 0 for alpha, 1 for beta, 2 for release builds -set( AUDACITY_BUILD_LEVEL 0 ) - -# Don't allow in-source builds...no real reason, just -# keeping those source trees nice and tidy. :-) -# (This can be removed if it becomes an issue.) -if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" ) - message( FATAL_ERROR - "In-source builds not allowed.\n" - "Create a new directory and run cmake from there, i.e.:\n" - " mkdir build\n" - " cd build\n" - " cmake ..\n" - "You will need to delete CMakeCache.txt and CMakeFiles from this directory to clean up." - ) -endif() - -# Default build type is Debug -if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES ) - set( CMAKE_BUILD_TYPE "Debug" ) -endif() - -# List of defines which are intended to silence C++17 warnings -# These will be added to each CMAKE target as PRIVATE compilation definitions -list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1 ) -list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING=1 ) - -# Ignore COMPILE_DEFINITIONS_ properties +# Ignore compile definitions for all build types (compatibility override for CMake <2.8.10) cmake_policy( SET CMP0043 NEW ) -# Link libraries by full path even in implicit directories. +# Link libraries by full path even in implicit directories (compatibility override for CMake <3.3) cmake_policy( SET CMP0060 NEW ) -# ``INTERPROCEDURAL_OPTIMIZATION`` is enforced when enabled. +# If inter-procedural optimization is manually enabled fail if we cannot optimize cmake_policy( SET CMP0069 NEW ) -# ``FindOpenGL`` prefers GLVND by default when available. +# Use libGLVND by default when using openGL (compatibility override for CMake <3.11) cmake_policy( SET CMP0072 NEW ) -# Include file check macros honor ``CMAKE_REQUIRED_LIBRARIES``. +# Prefer required libraries in file check macros (compatibility override for CMake <3.12) cmake_policy( SET CMP0075 NEW ) -# Definitions that must happen before the project() command +# ~~~~~~~~~~~~~~~~~ +# Build Information +# ~~~~~~~~~~~~~~~~~ + +# The type of build this is ( 0 => alpha ; 1 => beta ; 2 => release ) +# If set to non-release build it changes the welcome screen +# If set to non-alpha build it disables the development only menu +set( AUDACITY_BUILD_LEVEL 0 ) + +# Define Tenacity's build output name +if( CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" ) + set( AUDACITY_NAME "Tenacity" ) +else() + set( AUDACITY_NAME "tenacity" ) +endif() + +if(NOT GIT_FOUND) + find_package( Git ) +endif() + +set( AUDACITY_VERSION 0 ) # Major version +set( AUDACITY_RELEASE 0 ) # Minor version +set( AUDACITY_REVISION 0 ) # Revision version +set( AUDACITY_MODLEVEL 0 ) # Additional version detail +set( GIT_DESCRIBE "unknown" ) + +if( GIT_FOUND ) + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --abbrev=7 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_DESCRIBE + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET + ) + + if( GIT_DESCRIBE ) + # Copy to new variable for string manipulation + set( git_output ${GIT_DESCRIBE} ) + + # TODO: Remove this after first Tenacity release + string( REPLACE "Audacity-" "" git_output "${git_output}" ) + + string( REGEX REPLACE "-.*" "" git_output "${git_output}" ) + string( REPLACE "." ";" git_output "${git_output}" ) + + list( GET git_output 0 AUDACITY_VERSION ) + list( GET git_output 1 AUDACITY_RELEASE ) + list( GET git_output 2 AUDACITY_REVISION ) + endif() +endif() + +# ~~~~~~~ +# Vcpkg +# ~~~~~~~ + +if( WIN32 OR APPLE ) + option( VCPKG "Use vcpkg for dependencies" ON ) +else() + option( VCPKG "Use vcpkg for dependencies" OFF ) +endif() + +if( VCPKG ) + set( ENV{VCPKG_DISABLE_METRICS} true ) + + if( NOT DEFINED ENV{VCPKG_BINARY_SOURCES} ) + set( ENV{VCPKG_BINARY_SOURCES} "clear;default,readwrite;nuget,https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget,read" ) + endif() + + set( ENV{VCPKG_FEATURE_FLAGS} "-compilertracking,manifests,registries,versions" ) + + if( VCPKG_ROOT ) + message( STATUS "Using dependencies from vcpkg repository at ${VCPKG_ROOT}" ) + + if( NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh" ) + message( FATAL_ERROR "${VCPKG_ROOT} is not a vcpkg Git repository." ) + endif() + + else() + message( STATUS "Using dependencies from vcpkg Git submodule" ) + set( VCPKG_ROOT "${CMAKE_SOURCE_DIR}/vcpkg" ) + + if( NOT EXISTS "${VCPKG_ROOT}/bootstrap-vcpkg.sh" ) + + # Make sure we have actually attempted to find Git + if( NOT GIT_FOUND ) + find_package( Git ) + endif() + + if( GIT_FOUND ) + message( STATUS "Initializing vcpkg Git submodule" ) + execute_process( + COMMAND ${GIT_EXECUTABLE} submodule init + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + ) + execute_process( + COMMAND ${GIT_EXECUTABLE} submodule update + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + ) + else() + message( FATAL_ERROR "Unable to initialize vcpkg Git submodule because CMake was unable to find a git installation" ) + endif() + endif() + endif() + + if( NOT DEFINED VCPKG_OVERLAY_PORTS ) + set( VCPKG_OVERLAY_PORTS "${VCPKG_ROOT}/overlay/ports" ) + endif() + + if( NOT DEFINED VCPKG_OVERLAY_TRIPLETS ) + set( VCPKG_OVERLAY_TRIPLETS "${VCPKG_ROOT}/overlay/triplets" ) + endif() + + if( NOT DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET ) + if( APPLE ) + set( VCPKG_TARGET_TRIPLET "x64-osx-10.12min" ) + endif() + elseif( DEFINED ENV{VCPKG_DEFAULT_TRIPLET} ) + set( VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" ) + endif() + + set( CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" ) +else() + message( STATUS "Searching for dependencies from system, not using vcpkg." ) +endif() + +# ~~~~~~~~~~~~~~~~~~~~~~ +# CMake input validation +# ~~~~~~~~~~~~~~~~~~~~~~ + +# Don't allow in-source builds +if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" ) + + message( SEND_ERROR "In-source builds not allowed" ) + message( SEND_ERROR "Create a new directory and run cmake from there, i.e.:" ) + message( SEND_ERROR " mkdir build" ) + message( SEND_ERROR " cmake -B build" ) + message( SEND_ERROR "You will need to delete CMakeCache.txt and CMakeFiles from this directory to clean up." ) + message( FATAL_ERROR "Failed because you attempted to build in the source tree" ) + +endif() + +# Determine if this is being generated by a multi-config CMake generator +get_property( IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) + +# If the user has not provided us with the build target then we generate sensible defaults +if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES ) + if( IS_MULTI_CONFIG ) + message( STATUS "Detected that we are using a multi-config generator without build types defined..." ) + message( STATUS "To fix this we are using default values for CMAKE_CONFIGURATION_TYPES" ) + set( CMAKE_CONFIGURATION_TYPES "Debug;MinSizeRel;Release;RelWithDebInfo" ) + else() + message( STATUS "Detected that we are using a single config generator without a build type defined..." ) + message( STATUS "To fix this we are using default value for CMAKE_BUILD_TYPE" ) + set( CMAKE_BUILD_TYPE "Debug" ) + endif() +endif() + +# If the user has provided us with duplicate config definitions use the singular build type +if( CMAKE_BUILD_TYPE AND CMAKE_CONFIGURATION_TYPES ) + message( STATUS "Using CMAKE_BUILD_TYPE and ignoring CMAKE_CONFIGURATION_TYPES" ) + set ( CMAKE_CONFIGURATION_TYPES ) +endif() + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Definitions that must happen before the project() command +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if( APPLE ) - set( MIN_MACOS_VERSION 10.12 ) - set( TARGET_MACOS_VERSION 10.13 ) - # Generate schema files - set( CMAKE_XCODE_GENERATE_SCHEME ON ) + # These values are used within builds on MacOS to link the target + # version of the SDK if the linker supports platform versioning + set( MIN_MACOS_VERSION 10.12 ) - # Define the OSX compatibility parameters - set( CMAKE_OSX_ARCHITECTURES x86_64 CACHE INTERNAL "" ) - set( CMAKE_OSX_DEPLOYMENT_TARGET ${MIN_MACOS_VERSION} CACHE INTERNAL "" ) - set( CMAKE_OSX_SYSROOT macosx CACHE INTERNAL "" ) - set( CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" CACHE INTERNAL "" ) + # Target 10.13 to prevent high CPU usage and slow drawing on Mojave or newer + set( TARGET_MACOS_VERSION 10.13 ) - # This prevents a link error when building with the 10.9 or older SDKs - set( CMAKE_XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF ) - - # Shouldn't cmake do this??? - string( APPEND CMAKE_CXX_FLAGS " -stdlib=libc++" ) + # Define the OSX compatibility parameters + set( CMAKE_OSX_ARCHITECTURES x86_64 CACHE INTERNAL "" ) + set( CMAKE_OSX_DEPLOYMENT_TARGET ${MIN_MACOS_VERSION} CACHE INTERNAL "" ) + set( CMAKE_OSX_SYSROOT macosx CACHE INTERNAL "" ) endif() # Add our module path -# CMAKE_BINARY_DIR is required for Conan to work -set( AUDACITY_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules") -set( CMAKE_MODULE_PATH - ${AUDACITY_MODULE_PATH} - ${CMAKE_BINARY_DIR} - ${CMAKE_MODULE_PATH} - "${CMAKE_SOURCE_DIR}/cmake-modules" -) +set( AUDACITY_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-proxies/cmake-modules" ) +set( CMAKE_MODULE_PATH ${AUDACITY_MODULE_PATH} ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake-modules" ) -set( CMAKE_PREFIX_PATH - ${CMAKE_BINARY_DIR} - ${CMAKE_PREFIX_PATH} -) +set( CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH} ) + +# ~~~~~~~~~~~~~~ +# C++ standard +# ~~~~~~~~~~~~~~ # Set the required C++ standard set( CMAKE_CXX_STANDARD 17 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) -include( CMakeDependentOption ) + +# List of defines which are intended to silence C++17 warnings +# These will be added to each CMAKE target as PRIVATE compilation definitions + +list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING=1 ) +list( APPEND CXX_WARNINGS_SILENCE_DEFINES _SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING=1 ) + +# ~~~~~~~~~~~~~~~~~~ +# Tenacity project +# ~~~~~~~~~~~~~~~~~~ project( Tenacity ) -#This must appear after the project declaration so it can detect ENABLED_LANGUAGES -include(CheckIPOSupported) -check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT IPO_OUTPUT) -mark_as_advanced( FORCE IPO_SUPPORTED ) -if(IPO_SUPPORTED) - set( CMAKE_INTERPROCEDURAL_OPTIMIZATION ON ) - set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON ) - set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF ) - add_definitions( -DHAVE_IPO ) - message(STATUS "Interprocedural optimization is supported") -else() - message(STATUS "Interprocedural optimization is not supported: ${IPO_OUTPUT}") -endif() - -# Use ccache if available -find_program( CCACHE_PROGRAM ccache ) -mark_as_advanced( FORCE CCACHE_PROGRAM ) -if(NOT "${CCACHE_PROGRAM}" STREQUAL "CCACHE_PROGRAM-NOTFOUND") - option(CCACHE "Use ccache for compiler caching to speed up rebuilds." ON) -endif() - -find_program( SCCACHE_PROGRAM sccache ) -mark_as_advanced( FORCE SCCACHE_PROGRAM ) -if(NOT "${SCCACHE_PROGRAM}" STREQUAL "SCCACHE_PROGRAM-NOTFOUND") - option(SCCACHE "Use sccache for compiler caching to speed up rebuilds." ON) -endif() - -# Prefer sccache if both ccache and sccache are found because Windows users may have -# ccache installed with MinGW which would not work with MSVC. -if(SCCACHE) - message( STATUS "Using sccache for compiler caching to speed up rebuilds" ) - set( CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" ) - set( CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" ) -elseif(CCACHE) - message( STATUS "Using ccache for compiler caching to speed up rebuilds" ) - set( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" ) - set( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" ) -else() - message( STATUS "No compiler caching enabled. Install sccache or ccache to enable compiler caching." ) -endif() - # Load our functions/macros include( AudacityFunctions ) -set_from_env(AUDACITY_ARCH_LABEL) # e.g. x86_64 +set_from_env( AUDACITY_ARCH_LABEL ) # e.g. x86_64 + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Configure optional settings +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Pull all the modules we'll need include( CheckCXXCompilerFlag ) @@ -221,146 +257,218 @@ include( CMakeDetermineASM_NASMCompiler ) include( CMakePushCheckState ) include( GNUInstallDirs ) include( TestBigEndian ) -include( ProcessorCount ) -# Determine total number of processors to enable us to only use total_available - 1 processors -# This helps prevent slow down of the other applications during the build process -ProcessorCount( CMAKE_BUILD_CPU_COUNT ) -if( CMAKE_BUILD_CPU_COUNT GREATER 0 ) - math( EXPR CMAKE_BUILD_CPU_COUNT "${CMAKE_BUILD_CPU_COUNT} - 2" OUTPUT_FORMAT DECIMAL ) +# Generator specific configurations +if( CMAKE_GENERATOR MATCHES "Visual Studio*" ) + # Make sure Tenacity is the startup project + set_directory_properties( PROPERTIES VS_STARTUP_PROJECT "${CMAKE_PROJECT_NAME}" ) + + # Define system library information, but we'll do the install + set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP YES ) + set( CMAKE_INSTALL_UCRT_LIBRARIES NO ) + set( CMAKE_INSTALL_MFC_LIBRARIES NO ) + set( CMAKE_INSTALL_OPENMP_LIBRARIES NO ) + include( InstallRequiredSystemLibraries ) +elseif( CMAKE_GENERATOR MATCHES "Xcode" ) + # Generate schema files + set( CMAKE_XCODE_GENERATE_SCHEME ON ) + + # Tell XCode to use a blank code signing identity + set( CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" CACHE INTERNAL "" ) + + # This prevents a link error when building with the 10.9 or older SDKs + set( CMAKE_XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME OFF ) endif() -if( CMAKE_BUILD_CPU_COUNT LESS_EQUAL 0 ) - message( WARNING "Unable to optimize build CPU usage, defaulting to use all processors" ) - set( CMAKE_BUILD_CPU_COUNT 0 ) -elseif(NOT DEFINED CMAKE_BUILD_PARALLEL_LEVEL ) - message( STATUS "Build automatically optimized to use processor count: ${CMAKE_BUILD_CPU_COUNT}" ) - set( CMAKE_BUILD_PARALLEL_LEVEL ${CMAKE_BUILD_CPU_COUNT} ) -#else() -# message( STATUS "Using CMAKE_BUILD_PARALLEL_LEVEL value to configure processor count: ${CMAKE_BUILD_PARALLEL_LEVEL}") -# set ( CMAKE_BUILD_CPU_COUNT ${CMAKE_BUILD_PARALLEL_LEVEL} ) +# Organize subdirectories/targets into folders for the IDE generators +set_property( GLOBAL PROPERTY USE_FOLDERS ON ) + + +# Enable inter-procedural optimization if this compiler supports it +# This must appear after the project declaration so it can detect ENABLED_LANGUAGES + +include( CheckIPOSupported ) +check_ipo_supported( RESULT IPO_SUPPORTED OUTPUT IPO_OUTPUT ) +mark_as_advanced( FORCE IPO_SUPPORTED ) +if( IPO_SUPPORTED ) + set( CMAKE_INTERPROCEDURAL_OPTIMIZATION ON ) + set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON ) + set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF ) + add_definitions( -DHAVE_IPO ) + message( STATUS "Inter-procedural optimization is supported" ) +else() + message( STATUS "Inter-procedural optimization is not supported: ${IPO_OUTPUT}" ) +endif() + +# Attempt to find optional ccache program +find_program( CCACHE_PROGRAM ccache ) +mark_as_advanced( FORCE CCACHE_PROGRAM ) +if( NOT "${CCACHE_PROGRAM}" STREQUAL "CCACHE_PROGRAM-NOTFOUND" ) + option( CCACHE "Use ccache for compiler caching to speed up rebuilds." ON ) +endif() + +# Attempt to find optional sccache program +find_program( SCCACHE_PROGRAM sccache ) +mark_as_advanced( FORCE SCCACHE_PROGRAM ) +if( NOT "${SCCACHE_PROGRAM}" STREQUAL "SCCACHE_PROGRAM-NOTFOUND" ) + option( SCCACHE "Use sccache for compiler caching to speed up rebuilds." ON ) +endif() + +# Prefer sccache if both ccache and sccache are found +if( SCCACHE ) + message( STATUS "Using sccache for compiler caching to speed up rebuilds" ) + set( CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" ) + set( CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" ) + + # Instruct MSVC to generate symbolic debug information within object files for sccache + if( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) + if( IS_MULTI_CONFIG ) + foreach( config ${CMAKE_CONFIGURATION_TYPES} ) + string( TOUPPER "${config}" config ) + string( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_${config} "${CMAKE_CXX_FLAGS_${config}}" ) + string( REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_${config}}" ) + endforeach() + else() + string( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" ) + string( REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}" ) + endif() + endif() +elseif( CCACHE AND NOT WIN32 ) + # Don't use ccache on Windows because it is probably mingw and it will muck things up + message( STATUS "Using ccache for compiler caching to speed up rebuilds" ) + set( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" ) + set( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" ) +else() + if( WIN32 ) + message( STATUS "No compiler caching enabled. Install sccache to enable compiler caching." ) + else() + message( STATUS "No compiler caching enabled. Install sccache or ccache to enable compiler caching." ) + endif() +endif() + +# Determine total number of processors to enable us to only use total_available - 2 processors +# This helps prevent slow down of the other applications during the build process + +if( NOT DISABLE_AUTO_CPU_COUNT_OPT ) + include( ProcessorCount ) + ProcessorCount( CMAKE_BUILD_CPU_COUNT ) + + if( CMAKE_BUILD_CPU_COUNT GREATER 0 ) + math( EXPR CMAKE_BUILD_CPU_COUNT "${CMAKE_BUILD_CPU_COUNT} - 2" OUTPUT_FORMAT DECIMAL ) + endif() + + if( CMAKE_BUILD_CPU_COUNT LESS_EQUAL 0 ) + message( WARNING "Unable to optimize build CPU usage, defaulting to use all processors" ) + set( CMAKE_BUILD_CPU_COUNT 0 ) + elseif( NOT DEFINED CMAKE_BUILD_PARALLEL_LEVEL ) + message( STATUS "Build automatically optimized to use processor count: ${CMAKE_BUILD_CPU_COUNT}" ) + set( CMAKE_BUILD_PARALLEL_LEVEL ${CMAKE_BUILD_CPU_COUNT} ) + endif() + + if( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) + set( MULTI_PROC_COMPILER_FLAG "/MP" ) + elseif( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" ) + set( MULTI_PROC_COMPILER_FLAG "-j" ) + endif() + + if( IS_MULTI_CONFIG AND CMAKE_CONFIGURATION_TYPES ) + foreach( config ${CMAKE_CONFIGURATION_TYPES} ) + string( TOUPPER "${config}" config ) + if( NOT CMAKE_BUILD_CPU_COUNT EQUAL 0 ) + string( APPEND CMAKE_C_FLAGS_${config} " ${MULTI_PROC_COMPILER_FLAG}${CMAKE_BUILD_CPU_COUNT}" ) + string( APPEND CMAKE_CXX_FLAGS_${config} " ${MULTI_PROC_COMPILER_FLAG}${CMAKE_BUILD_CPU_COUNT}" ) + else() + string( APPEND CMAKE_C_FLAGS_${config} " ${MULTI_PROC_COMPILER_FLAG}" ) + string( APPEND CMAKE_CXX_FLAGS_${config} " ${MULTI_PROC_COMPILER_FLAG}" ) + endif() + endforeach() + elseif( CMAKE_BUILD_TYPE ) + if( NOT CMAKE_BUILD_CPU_COUNT EQUAL 0 ) + string( APPEND CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} " ${MULTI_PROC_COMPILER_FLAG}${CMAKE_BUILD_CPU_COUNT}" ) + string( APPEND CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} " ${MULTI_PROC_COMPILER_FLAG}${CMAKE_BUILD_CPU_COUNT}" ) + else() + string( APPEND CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} " ${MULTI_PROC_COMPILER_FLAG}" ) + string( APPEND CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} " ${MULTI_PROC_COMPILER_FLAG}" ) + endif() + endif() endif() # Determine 32-bit or 64-bit target if( CMAKE_C_COMPILER_ID MATCHES "MSVC" AND CMAKE_VS_PLATFORM_NAME MATCHES "Win64|x64" ) - set( IS_64BIT ON ) -elseif( NOT CMAKE_SIZEOF_VOID_P STREQUAL "4" ) - set( IS_64BIT ON ) + set( IS_64BIT ON ) +elseif( CMAKE_SIZEOF_VOID_P STREQUAL "8" ) + set( IS_64BIT ON ) endif() -message( STATUS "Build Info:" ) -message( STATUS " Host System: ${CMAKE_HOST_SYSTEM}" ) -message( STATUS " Host System Name: ${CMAKE_HOST_SYSTEM_NAME}" ) -message( STATUS " Host System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}" ) -message( STATUS " Host System Version: ${CMAKE_HOST_SYSTEM_VERSION}" ) +# Determine 32-bit or 64-bit host +cmake_host_system_information( RESULT IS_64BIT_HOST QUERY "IS_64BIT" ) -if( IS_64BIT ) - message( STATUS " Host System Architecture: 64-bit" ) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Output debugging information +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +message( STATUS "Build Info:" ) +message( STATUS "\tHost System Name: ${CMAKE_HOST_SYSTEM_NAME}" ) +message( STATUS "\tHost System Version: ${CMAKE_HOST_SYSTEM_VERSION}" ) +message( STATUS "\tHost System Processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}" ) + +if( IS_64BIT_HOST ) + message( STATUS "\tHost System Arch: 64-bit" ) else() - message( STATUS " Host System Architecture: 32-bit" ) + message( STATUS "\tHost System Arch: 32-bit" ) endif() message( STATUS ) -message( STATUS " Compiler: ${CMAKE_CXX_COMPILER}" ) -message( STATUS " Compiler Version: ${CMAKE_CXX_COMPILER_VERSION}" ) -message( STATUS " Compiler Standard: ${CMAKE_CXX_STANDARD}" ) -message( STATUS " Compiler Standard Required: ${CMAKE_CXX_STANDARD_REQUIRED}" ) -message( STATUS " Compiler Extensions: ${CMAKE_CXX_EXTENSIONS}" ) +message( STATUS "\tTarget System Name: ${CMAKE_SYSTEM_NAME}" ) +message( STATUS "\tTarget System Version: ${CMAKE_SYSTEM_VERSION}" ) +message( STATUS "\tTarget System Processor: ${CMAKE_SYSTEM_PROCESSOR}" ) + +if( IS_64BIT ) + message( STATUS "\tTarget System Arch: 64-bit" ) +else() + message( STATUS "\tTarget System Arch: 32-bit" ) +endif() + +message( STATUS ) +message( STATUS "\tCompiler: ${CMAKE_CXX_COMPILER}" ) +message( STATUS "\tCompiler Version: ${CMAKE_CXX_COMPILER_VERSION}" ) +message( STATUS "\tCompiler Standard: ${CMAKE_CXX_STANDARD}" ) +message( STATUS "\tCompiler Standard Required: ${CMAKE_CXX_STANDARD_REQUIRED}" ) +message( STATUS "\tCompiler Extensions: ${CMAKE_CXX_EXTENSIONS}" ) message( STATUS ) if( MSVC ) - message( STATUS " MSVC Version: ${MSVC_VERSION}" ) - message( STATUS " MSVC Toolset: ${MSVC_TOOLSET_VERSION}" ) - message( STATUS ) -elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - if( CMAKE_GENERATOR MATCHES "Xcode" ) - message( STATUS " Xcode Version: ${XCODE_VERSION}" ) - endif() - message( STATUS " MacOS SDK: ${CMAKE_OSX_SYSROOT}" ) - message( STATUS ) - + message( STATUS "\tMSVC Version: ${MSVC_VERSION}" ) + message( STATUS "\tMSVC Toolset: ${MSVC_TOOLSET_VERSION}" ) endif() -# Current version and commit info -set( AUDACITY_VERSION 0 ) -set( AUDACITY_RELEASE 0 ) -set( AUDACITY_REVISION 0 ) -set( GIT_DESCRIBE "unknown" ) -if( GIT_FOUND ) - execute_process( - COMMAND - ${GIT_EXECUTABLE} describe --abbrev=7 - WORKING_DIRECTORY - ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE - GIT_DESCRIBE - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - - if( GIT_DESCRIBE ) - # Copy to new variable for string manipulation - set( git_output ${GIT_DESCRIBE} ) - - # TODO: Remove this after first Tenacity release - string(REPLACE "Audacity-" "" git_output "${git_output}") - - string( REGEX REPLACE "-.*" "" git_output "${git_output}" ) - string( REPLACE "." ";" git_output "${git_output}" ) - - list( GET git_output 0 AUDACITY_VERSION ) - list( GET git_output 1 AUDACITY_RELEASE ) - list( GET git_output 2 AUDACITY_REVISION ) - endif() +if( CMAKE_GENERATOR MATCHES "Xcode" ) + message( STATUS "\tXcode Version: ${XCODE_VERSION}" ) endif() -message( STATUS " Current Commit: ${GIT_DESCRIBE}" ) + +if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + message( STATUS "\tMacOS SDK: ${CMAKE_OSX_SYSROOT}" ) +endif() + +message( STATUS ) +message( STATUS "\tCurrent Commit: ${GIT_DESCRIBE}" ) message( STATUS ) -# Not sure what this even does -set( AUDACITY_MODLEVEL 0 ) +# ~~~~~~~~~~~~~~ +# Output paths +# ~~~~~~~~~~~~~~ -# Organize subdirectories/targets into folders for the IDEs -set_property( GLOBAL PROPERTY USE_FOLDERS ON ) - -if( CMAKE_GENERATOR MATCHES "Visual Studio" ) - # Make sure Tenacity is the startup project - set_directory_properties( - PROPERTIES - VS_STARTUP_PROJECT "${CMAKE_PROJECT_NAME}" - ) - - # Build using multiple processors - foreach( config ${CMAKE_CONFIGURATION_TYPES} ) - string( TOUPPER "${config}" config ) - if( NOT CMAKE_BUILD_CPU_COUNT EQUAL 0 ) - string( APPEND CMAKE_C_FLAGS_${config} " /MP${CMAKE_BUILD_CPU_COUNT}" ) - string( APPEND CMAKE_CXX_FLAGS_${config} " /MP${CMAKE_BUILD_CPU_COUNT}" ) - else() - string( APPEND CMAKE_C_FLAGS_${config} " /MP" ) - string( APPEND CMAKE_CXX_FLAGS_${config} " /MP" ) - endif() - endforeach() - - # Define system library information, but we'll do the install - set( CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP YES ) - set( CMAKE_INSTALL_UCRT_LIBRARIES NO ) - set( CMAKE_INSTALL_MFC_LIBRARIES NO ) - set( CMAKE_INSTALL_OPENMP_LIBRARIES NO ) - include( InstallRequiredSystemLibraries ) -endif() - -set ( _SHARED_PROXY_BASE "shared" ) -set ( _SHARED_PROXY_BASE_PATH "${CMAKE_BINARY_DIR}/${_SHARED_PROXY_BASE}") +set( _SHARED_PROXY_BASE "shared" ) +set( _SHARED_PROXY_BASE_PATH "${CMAKE_BINARY_DIR}/${_SHARED_PROXY_BASE}" ) # Define the non-install and executable paths and where the final product is stored -if( CMAKE_CONFIGURATION_TYPES ) - set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) - set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" ) - set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_CFG_INTDIR}") +if( IS_MULTI_CONFIG AND CMAKE_CONFIGURATION_TYPES ) + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) + set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" ) + set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_CFG_INTDIR}" ) else() - set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE} ) - set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_BUILD_TYPE}") + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE} ) + set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) + set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_BUILD_TYPE}" ) endif() set( _DEST "${_DESTDIR}" ) @@ -381,72 +489,70 @@ set( CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE ) # Adjust them for the Mac if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set( _APPDIR "Tenacity.app/Contents" ) - set( _DEST "${_DESTDIR}/${_APPDIR}" ) - set( _EXEDIR "${_DEST}/MacOS" ) - set( _MODDIR "${_DEST}/modules" ) - set( _PKGLIB "${_DEST}/Frameworks" ) + set( _APPDIR "Tenacity.app/Contents" ) + set( _DEST "${_DESTDIR}/${_APPDIR}" ) + set( _EXEDIR "${_DEST}/MacOS" ) + set( _MODDIR "${_DEST}/modules" ) + set( _PKGLIB "${_DEST}/Frameworks" ) - set( CMAKE_MACOSX_RPATH OFF ) + set( CMAKE_MACOSX_RPATH OFF ) endif() -# Add the math library (if found) to the list of required libraries +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Add optional capability expanding libraries if we can find them +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + check_library_exists( m pow "" HAVE_LIBM ) +check_library_exists( atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC ) + +# Add the math library( if found ) to the list of required libraries so that later checks will be able to see it if( HAVE_LIBM ) - list( APPEND CMAKE_REQUIRED_LIBRARIES -lm ) + list( APPEND CMAKE_REQUIRED_LIBRARIES -lm ) endif() -check_library_exists( atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC ) +# Add the atomic library( if found ) to the list of required libraries so that later checks will be able to see it if( HAVE_LIBATOMIC ) list( APPEND CMAKE_REQUIRED_LIBRARIES -latomic ) endif() -# Add the dynamic linker library (if needed) to the list of required libraries +# Add the dynamic linker library( if needed ) to the list of required libraries list( APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS} ) -# Make sure they're used during the link steps +# Make sure we link required libraries set( CMAKE_LINK_INTERFACE_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Check supported compile-time features +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Various common checks whose results are used by the different targets test_big_endian( WORDS_BIGENDIAN ) -# Check for compiler flags +# Check for MMX and SSE support set( MMX_FLAG "" CACHE INTERNAL "" ) set( SSE_FLAG "" CACHE INTERNAL "" ) if( CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU" ) - check_cxx_compiler_flag( "-mmmx" HAVE_MMX ) - if( HAVE_MMX AND NOT IS_64BIT ) - set( MMX_FLAG "-mmmx" CACHE INTERNAL "" ) - endif() + check_cxx_compiler_flag( "-mmmx" HAVE_MMX ) + if( HAVE_MMX AND NOT IS_64BIT ) + set( MMX_FLAG "-mmmx" CACHE INTERNAL "" ) + endif() - check_cxx_compiler_flag( "-msse" HAVE_SSE ) - if( HAVE_SSE AND NOT IS_64BIT ) - set( SSE_FLAG "-msse" CACHE INTERNAL "" ) - endif() + check_cxx_compiler_flag( "-msse" HAVE_SSE ) + if( HAVE_SSE AND NOT IS_64BIT ) + set( SSE_FLAG "-msse" CACHE INTERNAL "" ) + endif() - check_cxx_compiler_flag( "-msse2" HAVE_SSE2 ) - if( HAVE_SSE2 AND NOT IS_64BIT ) - set( SSE_FLAG "-msse2" CACHE INTERNAL "" ) - endif() + check_cxx_compiler_flag( "-msse2" HAVE_SSE2 ) + if( HAVE_SSE2 AND NOT IS_64BIT ) + set( SSE_FLAG "-msse2" CACHE INTERNAL "" ) + endif() elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" ) - set( HAVE_MMX ON ) - set( HAVE_SSE ON ) - set( HAVE_SSE2 ON ) - if( NOT IS_64BIT ) - set( SSE_FLAG "/arch:SSE2" ) - endif() - - # required for sccache - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") - elseif(CMAKE_BUILD_TYPE STREQUAL "Release") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") - elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - endif() + set( HAVE_MMX ON ) + set( HAVE_SSE ON ) + set( HAVE_SSE2 ON ) + if( NOT IS_64BIT ) + set( SSE_FLAG "/arch:SSE2" ) + endif() endif() check_include_files( "float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS ) @@ -526,115 +632,113 @@ check_type_size( "size_t" SIZEOF_SIZE LANGUAGE C ) check_type_size( "wchar_t" SIZEOF_WCHAR LANGUAGE C ) check_type_size( "void*" SIZEOF_POINTER LANGUAGE C ) +# ~~~~~~~~~~~~~~~~~~~~ +# 3rd party Libraries +# ~~~~~~~~~~~~~~~~~~~~ + # We'll be using it if it's available find_package( PkgConfig QUIET ) # Mostly just to make the CMP0072 policy happy find_package( OpenGL QUIET ) -# Precreate the lib and lib64 directories so we can make then the same +# Initialize the lib and lib64 directories if( NOT EXISTS "${CMAKE_BINARY_DIR}/lib" ) - file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) + file( MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) endif() -# Only create on systems that need it, effectively excluding Windows where links -# may not work due to insufficient privileges +# Create symbolic link to use the lib directory contents on 64-bit targets if( NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib" AND NOT EXISTS "${CMAKE_BINARY_DIR}/lib64" ) - file( CREATE_LINK "${CMAKE_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/lib64" SYMBOLIC ) + file( CREATE_LINK "${CMAKE_BINARY_DIR}/lib" "${CMAKE_BINARY_DIR}/lib64" SYMBOLIC ) endif() -# Define Audacity's name -if( CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" ) - set( AUDACITY_NAME "Tenacity" ) -else() - set( AUDACITY_NAME "tenacity" ) -endif() - -# Python is used for the manual and (possibly) message catalogs +# Python is used for the manual and( possibly ) message catalogs find_package( Python3 ) if( Python3_FOUND ) - set( PYTHON "${Python3_EXECUTABLE}" ) + set( PYTHON "${Python3_EXECUTABLE}" ) elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - # This is an odd case now, as Conan requires Python as well - nuget_package( pkgdir "python3" "3.7.7" ) - file( TO_NATIVE_PATH "${pkgdir}/tools/python.exe" PYTHON ) + # This is an odd case now, as Conan requires Python as well + nuget_package( pkgdir "python3" "3.7.7" ) + file( TO_NATIVE_PATH "${pkgdir}/tools/python.exe" PYTHON ) endif() -# define EXPERIMENTAL flags -# Do this before consistency checks for added third-party libraries +# Define the EXPERIMENTAL flags Do this before consistency checks for added third-party libraries include( "src/Experimental.cmake" ) -find_package(Threads REQUIRED) -find_package(ZLIB REQUIRED) -find_package(EXPAT REQUIRED) -find_package(mp3lame REQUIRED) -find_package(SndFile REQUIRED) -find_package(Soxr REQUIRED) -find_package(SQLite3 REQUIRED) -find_package(PortAudio REQUIRED) +include( CMakeDependentOption ) -find_package(PortMidi) -find_package(PortSMF) -cmake_dependent_option(MIDI "MIDI support requires PortMidi and PortSMF." ON "PortMidi_FOUND;PortSMF_FOUND" OFF) -if(MIDI) - set(USE_MIDI ON) - message(STATUS "MIDI support enabled.") +find_package( Threads REQUIRED ) +find_package( ZLIB REQUIRED ) +find_package( EXPAT REQUIRED ) +find_package( mp3lame REQUIRED ) +find_package( SndFile REQUIRED ) +find_package( Soxr REQUIRED ) +find_package( SQLite3 REQUIRED ) +find_package( PortAudio REQUIRED ) + +find_package( PortMidi ) +find_package( PortSMF ) + +cmake_dependent_option( MIDI "MIDI support requires PortMidi and PortSMF." ON "PortMidi_FOUND;PortSMF_FOUND" OFF ) +if( MIDI ) + set( USE_MIDI ON ) + message( STATUS "MIDI support enabled." ) else() - message(STATUS "MIDI support disabled. Requires both PortMidi and PortSMF.") + message( STATUS "MIDI support disabled. Requires both PortMidi and PortSMF." ) endif() -find_package(id3tag) -cmake_dependent_option(ID3TAG "ID3 Tag support for MP3s." ON "id3tag_FOUND" OFF) -if(ID3TAG) - set(USE_LIBID3TAG ON) - message(STATUS "ID3 tag support for MP3s enabled.") +find_package( id3tag ) +cmake_dependent_option( ID3TAG "ID3 Tag support for MP3s." ON "id3tag_FOUND" OFF ) +if( ID3TAG ) + set( USE_LIBID3TAG ON ) + message( STATUS "ID3 tag support for MP3s enabled." ) else() - message(STATUS "ID3 tag support for MP3s disabled. Requires libid3tag.") + message( STATUS "ID3 tag support for MP3s disabled. Requires libid3tag." ) endif() -find_package(MAD) -cmake_dependent_option(MP3_DECODING "MP3 decoding support with libmad" ON "MAD_FOUND" OFF) -if(MP3_DECODING) - set(USE_LIBMAD ON) - message(STATUS "MP3 decoding support enabled.") +find_package( MAD ) +cmake_dependent_option( MP3_DECODING "MP3 decoding support with libmad" ON "MAD_FOUND" OFF ) +if( MP3_DECODING ) + set( USE_LIBMAD ON ) + message( STATUS "MP3 decoding support enabled." ) else() - message(STATUS "MP3 decoding support disabled. Requires libmad.") + message( STATUS "MP3 decoding support disabled. Requires libmad." ) endif() -find_package(libtwolame) -cmake_dependent_option(MP2_ENCODING "MP2 support with Twolame" ON "libtwolame_FOUND" OFF) -if(MP2_ENCODING) - set(USE_LIBTWOLAME ON) - message(STATUS "MP2 encoding support enabled.") +find_package( libtwolame ) +cmake_dependent_option( MP2_ENCODING "MP2 support with Twolame" ON "libtwolame_FOUND" OFF ) +if( MP2_ENCODING ) + set( USE_LIBTWOLAME ON ) + message( STATUS "MP2 encoding support enabled." ) else() - message(STATUS "MP2 encoding support disabled. Requires Twolame library.") + message( STATUS "MP2 encoding support disabled. Requires Twolame library." ) endif() -find_package(Ogg) -cmake_dependent_option(OGG "OGG container format support" ON "Ogg_FOUND" OFF) -if(OGG) - set(USE_LIBOGG ON) - message(STATUS "OGG container format support enabled.") +find_package( Ogg ) +cmake_dependent_option( OGG "OGG container format support" ON "Ogg_FOUND" OFF ) +if( OGG ) + set( USE_LIBOGG ON ) + message( STATUS "OGG container format support enabled." ) else() - message(STATUS "OGG container format support disabled. Requires libogg.") + message( STATUS "OGG container format support disabled. Requires libogg." ) endif() -find_package(Vorbis) -cmake_dependent_option(VORBIS "Vorbis codec support" ON "Vorbis_FOUND" OFF) -if(VORBIS) - set(USE_LIBVORBIS ON) - message(STATUS "Vorbis codec support enabled.") +find_package( Vorbis ) +cmake_dependent_option( VORBIS "Vorbis codec support" ON "Vorbis_FOUND" OFF ) +if( VORBIS ) + set( USE_LIBVORBIS ON ) + message( STATUS "Vorbis codec support enabled." ) else() - message(STATUS "Voribs codec support disabled. Requires libvorbis.") + message( STATUS "Voribs codec support disabled. Requires libvorbis." ) endif() -find_package(FLAC++) -cmake_dependent_option(FLAC "FLAC codec support" ON "FLAC++_FOUND" OFF) -if(FLAC) - set(USE_LIBFLAC ON) - message(STATUS "FLAC codec support enabled.") +find_package( FLAC++ ) +cmake_dependent_option( FLAC "FLAC codec support" ON "FLAC++_FOUND" OFF ) +if( FLAC ) + set( USE_LIBFLAC ON ) + message( STATUS "FLAC codec support enabled." ) else() - message(STATUS "FLAC codec support disabled. Requires libflac and libflac++ C++ bindings.") + message( STATUS "FLAC codec support disabled. Requires libflac and libflac++ C++ bindings." ) endif() find_package(sbsms) @@ -643,88 +747,97 @@ if(SBSMS) set(USE_SBSMS ON) message(STATUS "SBSMS timestretching support enabled.") else() - message(STATUS "SBSMS timestretching support disabled. Requires libsbsms.") + message( STATUS "SBSMS timestretching support disabled. Requires libsbsms." ) endif() -find_package(SoundTouch) -cmake_dependent_option(SOUNDTOUCH "SoundTouch timestretching" ON "SoundTouch_FOUND" OFF) -if(SOUNDTOUCH) - set(USE_SOUNDTOUCH ON) - message(STATUS "SoundTouch timestretching support enabled.") +find_package( SoundTouch ) +cmake_dependent_option( SOUNDTOUCH "SoundTouch timestretching" ON "SoundTouch_FOUND" OFF ) +if( SOUNDTOUCH ) + set( USE_SOUNDTOUCH ON ) + message( STATUS "SoundTouch timestretching support enabled." ) else() - message(STATUS "SoundTouch timestretching support disabled. Requires SoundTouch library.") + message( STATUS "SoundTouch timestretching support disabled. Requires SoundTouch library." ) endif() -find_package(FFMPEG) -cmake_dependent_option(FFMPEG "FFMPEG codecs support." ON "FFMPEG_FOUND" OFF) -if(FFMPEG) - set(USE_FFMPEG ON) - message(STATUS "FFMPEG codecs support enabled.") +find_package( FFMPEG ) +cmake_dependent_option( FFMPEG "FFMPEG codecs support." ON "FFMPEG_FOUND" OFF ) +if( FFMPEG ) + set( USE_FFMPEG ON ) + message( STATUS "FFMPEG codecs support enabled." ) else() - message(STATUS "FFMPEG codecs support disabled. Requires FFMPEG libraries.") + message( STATUS "FFMPEG codecs support disabled. Requires FFMPEG libraries." ) endif() -find_package(VampHostSDK) -cmake_dependent_option(VAMP "VAMP plugin hosting." ON "VampHostSDK_FOUND" OFF) -if(VAMP) - set(USE_VAMP ON) - message(STATUS "VAMP plugin hosting enabled.") +find_package( VampHostSDK ) +cmake_dependent_option( VAMP "VAMP plugin hosting." ON "VampHostSDK_FOUND" OFF ) +if( VAMP ) + set( USE_VAMP ON ) + message( STATUS "VAMP plugin hosting enabled. Requires VAMP host SDK." ) else() - message(STATUS "VAMP plugin hosting disabled. Requires VAMP host SDK.") + message( STATUS "VAMP plugin hosting disabled." ) endif() -find_package(LV2) -find_package(lilv) -find_package(suil) -cmake_dependent_option(LV2 "LV2 plugin host support" ON "LV2_FOUND;lilv_FOUND;suil_FOUND" OFF) -if(LV2) - message(STATUS "LV2 plugin hosting enabled.") - set(USE_LV2 ON) +find_package( LV2 ) +find_package( lilv ) +find_package( suil ) +cmake_dependent_option( LV2 "LV2 plugin host support" ON "LV2_FOUND;lilv_FOUND;suil_FOUND" OFF ) +if( LV2 ) + message( STATUS "LV2 plugin hosting enabled." ) + set( USE_LV2 ON ) else() - message(STATUS "LV2 plugin hosting disabled. Requires LV2, lilv, and suil libraries.") + message( STATUS "LV2 plugin hosting disabled. Requires LV2, lilv, and suil libraries." ) endif() -option(VST2 "VST2 plugin host support" ON) -if(VST2) - message(STATUS "VST2 plugin host support enabled.") +option( VST2 "VST2 plugin host support" ON ) +if( VST2 ) + message( STATUS "VST2 plugin host support enabled." ) else() - message(STATUS "VST2 plugin host support disabled.") + message( STATUS "VST2 plugin host support disabled." ) endif() -if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows") - find_package(GLIB REQUIRED) - find_package(GTK 3.0 REQUIRED) - +if( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows" ) + find_package( GLIB REQUIRED ) + find_package( GTK 3.0 REQUIRED ) endif() -if(NOT WIN32) - set(wxWidgets_CONFIG_OPTIONS --version=3.1) - find_package(wxWidgets 3.1 COMPONENTS adv base core html qa xml net) - include(${wxWidgets_USE_FILE}) - # The FindwxWidgets.cmake module does not create an IMPORT target, so hack one together. - # This makes it easy to add the compile definitions to the lib-strings and lib-strings-utils targets. - if(NOT TARGET wxWidgets::wxWidgets) - add_library(wxWidgets::wxWidgets INTERFACE IMPORTED) - target_link_libraries(wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES}) - target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${CXX_WARNINGS_SILENCE_DEFINES}) - target_compile_definitions(wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS} ${wxWidgets_DEFINITIONS_DEBUG}) +if( NOT WIN32 ) + set( wxWidgets_CONFIG_OPTIONS --version=3.1 ) + find_package( + wxWidgets 3.1 + COMPONENTS adv base core html qa xml net + ) + include( ${wxWidgets_USE_FILE} ) + # The FindwxWidgets.cmake module does not create an IMPORT target, so hack one together. This makes it easy to add the compile definitions + # to the lib-strings and lib-strings-utils targets. + if( NOT TARGET wxWidgets::wxWidgets ) + add_library( wxWidgets::wxWidgets INTERFACE IMPORTED ) + target_link_libraries( wxWidgets::wxWidgets INTERFACE ${wxWidgets_LIBRARIES} ) + target_compile_definitions( wxWidgets::wxWidgets INTERFACE ${CXX_WARNINGS_SILENCE_DEFINES} ) + target_compile_definitions( wxWidgets::wxWidgets INTERFACE ${wxWidgets_DEFINITIONS} ${wxWidgets_DEFINITIONS_DEBUG} ) endif() else() - # On Windows we are using wxWidgets from an unmerged vcpkg branch in our vcpkg overlay - # https://github.com/microsoft/vcpkg/pull/17111 - # This requires using 'unofficial-wxWidgets' rather than simply 'wxWidgets'. - # This is required for CMAKE_BUILD_TYPE=Debug to work. Refer to - # https://github.com/microsoft/vcpkg/issues/18066 - # for background about the bug. - find_package(unofficial-wxWidgets COMPONENTS adv base core html qa xml net) - if(NOT TARGET wxWidgets::wxWidgets) - add_library(wxWidgets::wxWidgets INTERFACE IMPORTED) - target_link_libraries(wxWidgets::wxWidgets INTERFACE wx::wxadv wx::wxbase wx::wxcore wx::wxhtml wx::wxqa wx::wxxml wx::wxnet) + # On Windows we are using wxWidgets from an unmerged vcpkg branch in our vcpkg overlay https://github.com/microsoft/vcpkg/pull/17111 This + # requires using 'unofficial-wxWidgets' rather than simply 'wxWidgets'. This is required for CMAKE_BUILD_TYPE=Debug to work. Refer to + # https://github.com/microsoft/vcpkg/issues/18066 for background about the bug. + find_package( + unofficial-wxWidgets + COMPONENTS adv base core html qa xml net + ) + if( NOT TARGET wxWidgets::wxWidgets ) + add_library( wxWidgets::wxWidgets INTERFACE IMPORTED ) + target_link_libraries( + wxWidgets::wxWidgets + INTERFACE wx::wxadv wx::wxbase wx::wxcore wx::wxhtml wx::wxqa wx::wxxml wx::wxnet + ) endif() endif() -add_subdirectory(lib-src/libnyquist) -set(USE_NYQUIST ON) +add_subdirectory( lib-src/libnyquist ) +set( USE_NYQUIST ON ) + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Tenacity source directories +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ add_subdirectory( "help" ) add_subdirectory( "images" ) @@ -738,73 +851,47 @@ add_subdirectory( "scripts" ) # Generate config file if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - configure_file( src/audacity_config.h.in src/private/configwin.h ) + configure_file( src/audacity_config.h.in src/private/configwin.h ) elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set( HAVE_VISIBILITY 1 ) - configure_file( src/audacity_config.h.in src/private/configmac.h ) + set( HAVE_VISIBILITY 1 ) + configure_file( src/audacity_config.h.in src/private/configmac.h ) else() - set( HAVE_VISIBILITY 1 ) - configure_file( src/audacity_config.h.in src/private/configunix.h ) + set( HAVE_VISIBILITY 1 ) + configure_file( src/audacity_config.h.in src/private/configunix.h ) endif() -# Generate a picture of module dependencies +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Generate module graph information as image +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# TODO: is this even needed? +#[[ string( JOIN "\n" GRAPH_EDGES ${GRAPH_EDGES} ) -# Choose edge attributes making it easy to hover at either end of edge -# and see a tooltip describing the edge, in svg image -file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/modules.dot" "digraph { - graph [rankdir=LR] edge [dir=both,arrowtail=inv] \n" - "${GRAPH_EDGES}" - "\n}\n" -) -execute_process( COMMAND - dot -O -Tsvg "${CMAKE_CURRENT_BINARY_DIR}/modules.dot" ) +# Choose edge attributes making it easy to hover at either end of edge and see a tooltip describing the edge, in svg image +file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/modules.dot" "digraph { graph [rankdir=LR] edge [dir=both,arrowtail=inv] \n" "${GRAPH_EDGES}" "\n}\n") +execute_process( COMMAND dot -O -Tsvg "${CMAKE_CURRENT_BINARY_DIR}/modules.dot" ) +#]] -# +# ~~~~~~~~~~~~ # Code signing -# +# ~~~~~~~~~~~~ -cmd_option( ${_OPT}perform_codesign - "Perform code signing during the install step. This only works on Windows and macOS." - Off -) +cmd_option( perform_codesign "Perform code signing during the install step. This only works on Windows and macOS." OFF ) -cmake_dependent_option( - ${_OPT}perform_notarization - "Perform notarization during the install step. This only works on macOS." - Off - "${_OPT}perform_codesign;APPLE" - Off -) +cmake_dependent_option( perform_notarization "Perform notarization during the install step. This only works on macOS." OFF "perform_codesign;APPLE" OFF ) -if( ${_OPT}perform_codesign ) - include( AudacityCodeSigning ) +if( perform_codesign ) + include( AudacityCodeSigning ) endif() -# +# ~~~~~~~~~~ # Packaging -# +# ~~~~~~~~~~ -cmd_option( ${_OPT}package_manual - "Package the manual along with the DMG and InnoSetup targets" - Off -) - -# Variables, that are common for all package targets +cmd_option( package_manual "Package the manual along with the DMG and InnoSetup targets" OFF ) if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - include( AudacityInnoSetup ) + include( AudacityInnoSetup ) endif() -# Uncomment what follows for symbol values. -#[[ - get_cmake_property( _variableNames VARIABLES ) - foreach( _variableName ${_variableNames} ) - message( STATUS "${_variableName}=${${_variableName}}" ) - endforeach() -#]] -#[[ - include( PrintProperties ) - print_properties( TARGET "wxWidgets" ) -#]] - include( Package ) # do this last diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ccc536e1f..d07bc10c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ - set( TARGET Tenacity ) set( TARGET_ROOT ${CMAKE_SOURCE_DIR}/src ) @@ -14,1087 +13,1081 @@ add_dependencies( ${TARGET} plug-ins ) def_vars() -# Add a target that will provide the git revision info -# whenever it changes. (Must be done at build time, not -# configuration time.) -if( GIT_FOUND ) - add_custom_target( - version - COMMAND - ${CMAKE_COMMAND} -D GIT="${GIT_EXECUTABLE}" - -D GIT_DESCRIBE="${GIT_DESCRIBE}" - -D "_PRVDIR=${_PRVDIR}" - -P "cmake-proxies/cmake-modules/Version.cmake" - WORKING_DIRECTORY - ${CMAKE_SOURCE_DIR} - ) +if( NOT GIT_FOUND ) + find_package( Git ) +endif() - add_dependencies( ${TARGET} version ) +# ~~~ +# Add a target that will provide the git revision info whenever it changes. +# Must be done at build time, not configuration time. +# ~~~ +if( GIT_FOUND ) + add_custom_target( version + COMMAND + ${CMAKE_COMMAND} + -D GIT="${GIT_EXECUTABLE}" + -D GIT_DESCRIBE="${GIT_DESCRIBE}" + -D "_PRVDIR=${_PRVDIR}" + -P "cmake-proxies/cmake-modules/Version.cmake" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + + add_dependencies( ${TARGET} version ) endif() # Handle Audio Units option if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - cmd_option( - ${_OPT}use_audio_units - "Use Audio Units plug-in support [on, off]" - ON - ) - set( USE_AUDIO_UNITS ${${_OPT}use_audio_units} CACHE INTERNAL "" ) + cmd_option( use_audio_units "Use Audio Units plug-in support [ON, OFF]" ON ) + set( USE_AUDIO_UNITS ${use_audio_units} CACHE INTERNAL "" ) endif() -# Detect, which version of FileDialog to use for -# We always assume that GTK is used on platforms other than Windows and macOS, -# as there is no other implementation avalaible now +# ~~~ +# Detect, which version of FileDialog to use +# Assume that GTK is used on platforms other than Windows or macOS +# ~~~ if( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set( wxIS_MAC on ) + set( wxIS_MAC ON ) elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set ( wxIS_WIN on ) + set( wxIS_WIN ON ) else() - set ( wxIS_GTK on) + set( wxIS_GTK ON ) endif() # Handle Ladspa option -cmd_option( - ${_OPT}use_ladspa - "Use LADSPA plug-in support [on, off]" - ON -) -set( USE_LADSPA ${${_OPT}use_ladspa} CACHE INTERNAL "" ) +cmd_option( use_ladspa "Use LADSPA plug-in support [ON, OFF]" ON ) +set( USE_LADSPA ${use_ladspa} CACHE INTERNAL "" ) # Handle VST option -cmd_option( - ${_OPT}use_vst - "Use VST2 plug-in support [on, off]" - ON -) -set( USE_VST ${${_OPT}use_vst} CACHE INTERNAL "" ) +cmd_option( use_vst "Use VST2 plug-in support [ON, OFF]" ON ) +set( USE_VST ${use_vst} CACHE INTERNAL "" ) -# -# -# -list( APPEND SOURCES - PRIVATE - AColor.cpp - AColor.h - AColorResources.h - ActiveProjects.cpp - ActiveProjects.h - AboutDialog.cpp - AboutDialog.h - AdornedRulerPanel.cpp - AdornedRulerPanel.h - AllThemeResources.cpp - AllThemeResources.h - AttachedVirtualFunction.h - AudacityApp.cpp - AudacityApp.h - $<$:AudacityApp.mm> - AudacityException.cpp - AudacityException.h - AudacityFileConfig.cpp - AudacityFileConfig.h - AudacityHeaders.cpp - AudacityHeaders.h - AudacityLogger.cpp - AudacityLogger.h - AudioIO.cpp - AudioIO.h - AudioIOBase.cpp - AudioIOBase.h - AudioIOBufferHelper.h - AudioIOListener.h - AutoRecoveryDialog.cpp - AutoRecoveryDialog.h - BatchCommandDialog.cpp - BatchCommandDialog.h - BatchCommands.cpp - BatchCommands.h - BatchProcessDialog.cpp - BatchProcessDialog.h - Benchmark.cpp - Benchmark.h - BuildInfo.h - CellularPanel.cpp - CellularPanel.h - ClassicThemeAsCeeCode.h - ClientData.h - ClientDataHelpers.h - Clipboard.cpp - Clipboard.h - CommonCommandFlags.cpp - CommonCommandFlags.h - DarkThemeAsCeeCode.h - DBConnection.cpp - DBConnection.h - DeviceChange.cpp - DeviceChange.h - DeviceManager.cpp - DeviceManager.h - Diags.cpp - Diags.h - Dither.cpp - Dither.h - Envelope.cpp - Envelope.h - EnvelopeEditor.cpp - EnvelopeEditor.h - FFT.cpp - FFT.h - FFmpeg.cpp - FFmpeg.h - FileException.cpp - FileException.h - FileFormats.cpp - FileFormats.h - FileIO.cpp - FileIO.h - FileNames.cpp - FileNames.h - FreqWindow.cpp - FreqWindow.h - HelpText.cpp - HelpText.h - HiContrastThemeAsCeeCode.h - HistoryWindow.cpp - HistoryWindow.h - HitTestResult.h - ImageManipulation.cpp - ImageManipulation.h - InconsistencyException.cpp - InconsistencyException.h - InterpolateAudio.cpp - InterpolateAudio.h - KeyboardCapture.cpp - KeyboardCapture.h - LabelDialog.cpp - LabelDialog.h - LabelTrack.cpp - LabelTrack.h - LangChoice.cpp - LangChoice.h - Legacy.cpp - Legacy.h - LightThemeAsCeeCode.h - Lyrics.cpp - Lyrics.h - LyricsWindow.cpp - LyricsWindow.h - MacroMagic.h - Matrix.cpp - Matrix.h - Menus.cpp - Menus.h - Mix.cpp - Mix.h - MixerBoard.cpp - MixerBoard.h - ModuleManager.cpp - ModuleManager.h - ModuleSettings.cpp - ModuleSettings.h - NoteTrack.cpp - NoteTrack.h - NumberScale.h - PitchName.cpp - PitchName.h - PlatformCompatibility.cpp - PlatformCompatibility.h - PlaybackSchedule.cpp - PlaybackSchedule.h - PluginManager.cpp - PluginManager.h - PluginRegistrationDialog.cpp - PluginRegistrationDialog.h - Prefs.cpp - Prefs.h - Printing.cpp - Printing.h - Profiler.cpp - Profiler.h - Project.cpp - Project.h - ProjectAudioIO.cpp - ProjectAudioIO.h - ProjectAudioManager.cpp - ProjectAudioManager.h - ProjectFileIO.cpp - ProjectFileIO.h - ProjectFileIORegistry.cpp - ProjectFileIORegistry.h - ProjectFileManager.cpp - ProjectFileManager.h - ProjectHistory.cpp - ProjectHistory.h - ProjectManager.cpp - ProjectManager.h - ProjectSelectionManager.cpp - ProjectSelectionManager.h - ProjectSerializer.cpp - ProjectSerializer.h - ProjectSettings.cpp - ProjectSettings.h - ProjectStatus.cpp - ProjectStatus.h - ProjectWindow.cpp - ProjectWindow.h - ProjectWindowBase.cpp - ProjectWindowBase.h - RealFFTf.cpp - RealFFTf.h - RealFFTf48x.cpp - RealFFTf48x.h - RefreshCode.h - Registrar.h - Registry.cpp - Registry.h - Resample.cpp - Resample.h - RingBuffer.cpp - RingBuffer.h - SampleBlock.cpp - SampleBlock.h - SampleFormat.cpp - SampleFormat.h - Screenshot.cpp - Screenshot.h - SelectUtilities.cpp - SelectUtilities.h - SelectedRegion.cpp - SelectedRegion.h - SelectionState.cpp - SelectionState.h - Sequence.cpp - Sequence.h - Shuttle.cpp - Shuttle.h - ShuttleGetDefinition.cpp - ShuttleGetDefinition.h - ShuttleGui.cpp - ShuttleGui.h - ShuttlePrefs.cpp - ShuttlePrefs.h - Snap.cpp - Snap.h - SoundActivatedRecord.cpp - SoundActivatedRecord.h - Spectrum.cpp - Spectrum.h - SpectrumAnalyst.cpp - SpectrumAnalyst.h - SplashDialog.cpp - SplashDialog.h - SqliteSampleBlock.cpp - SseMathFuncs.cpp - SseMathFuncs.h - Tags.cpp - Tags.h - TempDirectory.cpp - TempDirectory.h - Theme.cpp - Theme.h - ThemeAsCeeCode.h - TimeDialog.cpp - TimeDialog.h - TimeTrack.cpp - TimeTrack.h - TimerRecordDialog.cpp - TimerRecordDialog.h - Track.cpp - Track.h - TrackArtist.cpp - TrackArtist.h - TrackInfo.cpp - TrackInfo.h - TrackPanel.cpp - TrackPanel.h - TrackPanelAx.cpp - TrackPanelAx.h - TrackPanelCell.cpp - TrackPanelCell.h - TrackPanelDrawable.cpp - TrackPanelDrawable.h - TrackPanelDrawingContext.h - TrackPanelListener.h - TrackPanelMouseEvent.h - TrackPanelResizeHandle.cpp - TrackPanelResizeHandle.h - TrackPanelResizerCell.cpp - TrackPanelResizerCell.h - TrackUtilities.cpp - TrackUtilities.h - UIHandle.cpp - UIHandle.h - UndoManager.cpp - UndoManager.h - UserException.cpp - UserException.h - ViewInfo.cpp - ViewInfo.h - VoiceKey.cpp - VoiceKey.h - WaveClip.cpp - WaveClip.h - WaveTrack.cpp - WaveTrack.h - WaveTrackLocation.h - WrappedType.cpp - WrappedType.h - ZoomInfo.cpp - ZoomInfo.h - float_cast.h - wxFileNameWrapper.h - - # Commands - - commands/AppCommandEvent.cpp - commands/AppCommandEvent.h - commands/AudacityCommand.cpp - commands/AudacityCommand.h - commands/BatchEvalCommand.cpp - commands/BatchEvalCommand.h - commands/Command.cpp - commands/Command.h - commands/CommandBuilder.cpp - commands/CommandBuilder.h - commands/CommandContext.cpp - commands/CommandContext.h - commands/CommandDirectory.cpp - commands/CommandDirectory.h - commands/CommandFlag.h - commands/CommandFunctors.h - commands/CommandHandler.cpp - commands/CommandHandler.h - commands/CommandManager.cpp - commands/CommandManager.h - commands/CommandManagerWindowClasses.h - commands/CommandMisc.h - commands/CommandSignature.cpp - commands/CommandSignature.h - commands/CommandTargets.cpp - commands/CommandTargets.h - commands/CommandType.cpp - commands/CommandType.h - commands/CompareAudioCommand.cpp - commands/CompareAudioCommand.h - commands/Demo.cpp - commands/Demo.h - commands/DragCommand.cpp - commands/DragCommand.h - commands/GetInfoCommand.cpp - commands/GetInfoCommand.h - commands/GetTrackInfoCommand.cpp - commands/GetTrackInfoCommand.h - commands/HelpCommand.cpp - commands/HelpCommand.h - commands/ImportExportCommands.cpp - commands/ImportExportCommands.h - commands/Keyboard.cpp - commands/Keyboard.h - commands/LoadCommands.cpp - commands/LoadCommands.h - commands/MessageCommand.cpp - commands/MessageCommand.h - commands/OpenSaveCommands.cpp - commands/OpenSaveCommands.h - commands/PreferenceCommands.cpp - commands/PreferenceCommands.h - commands/ResponseQueue.cpp - commands/ResponseQueue.h - commands/ScreenshotCommand.cpp - commands/ScreenshotCommand.h - commands/ScriptCommandRelay.cpp - commands/ScriptCommandRelay.h - commands/SelectCommand.cpp - commands/SelectCommand.h - commands/SetClipCommand.cpp - commands/SetClipCommand.h - commands/SetEnvelopeCommand.cpp - commands/SetEnvelopeCommand.h - commands/SetLabelCommand.cpp - commands/SetLabelCommand.h - commands/SetProjectCommand.cpp - commands/SetProjectCommand.h - commands/SetTrackInfoCommand.cpp - commands/SetTrackInfoCommand.h - commands/Validators.h - - # Built-in Effects - - effects/Amplify.cpp - effects/Amplify.h - effects/AutoDuck.cpp - effects/AutoDuck.h - effects/BassTreble.cpp - effects/BassTreble.h - effects/Biquad.cpp - effects/Biquad.h - effects/ChangePitch.cpp - effects/ChangePitch.h - effects/ChangeSpeed.cpp - effects/ChangeSpeed.h - effects/ChangeTempo.cpp - effects/ChangeTempo.h - effects/ClickRemoval.cpp - effects/ClickRemoval.h - effects/Compressor.cpp - effects/Compressor.h - effects/Contrast.cpp - effects/Contrast.h - effects/Distortion.cpp - effects/Distortion.h - effects/DtmfGen.cpp - effects/DtmfGen.h - effects/EBUR128.cpp - effects/EBUR128.h - effects/Echo.cpp - effects/Echo.h - effects/Effect.cpp - effects/Effect.h - effects/EffectManager.cpp - effects/EffectManager.h - effects/EffectUI.cpp - effects/EffectUI.h - effects/Equalization.cpp - effects/Equalization.h - effects/Equalization48x.cpp - effects/Equalization48x.h - effects/Fade.cpp - effects/Fade.h - effects/FindClipping.cpp - effects/FindClipping.h - effects/Generator.cpp - effects/Generator.h - effects/Invert.cpp - effects/Invert.h - effects/LoadEffects.cpp - effects/LoadEffects.h - effects/Loudness.cpp - effects/Loudness.h - effects/Noise.cpp - effects/Noise.h - effects/NoiseReduction.cpp - effects/NoiseReduction.h - effects/NoiseRemoval.cpp - effects/NoiseRemoval.h - effects/Normalize.cpp - effects/Normalize.h - effects/Paulstretch.cpp - effects/Paulstretch.h - effects/Phaser.cpp - effects/Phaser.h - effects/RealtimeEffectManager.cpp - effects/RealtimeEffectManager.h - effects/Repair.cpp - effects/Repair.h - effects/Repeat.cpp - effects/Repeat.h - effects/Reverb.cpp - effects/Reverb.h - effects/Reverb_libSoX.h - effects/Reverse.cpp - effects/Reverse.h - effects/SBSMSEffect.cpp - effects/SBSMSEffect.h - effects/ScienFilter.cpp - effects/ScienFilter.h - effects/ScoreAlignDialog.cpp - effects/ScoreAlignDialog.h - effects/Silence.cpp - effects/Silence.h - effects/SimpleMono.cpp - effects/SimpleMono.h - effects/SoundTouchEffect.cpp - effects/SoundTouchEffect.h - effects/StereoToMono.cpp - effects/StereoToMono.h - effects/TimeScale.cpp - effects/TimeScale.h - effects/TimeWarper.cpp - effects/TimeWarper.h - effects/ToneGen.cpp - effects/ToneGen.h - effects/TruncSilence.cpp - effects/TruncSilence.h - effects/TwoPassSimpleMono.cpp - effects/TwoPassSimpleMono.h - effects/Wahwah.cpp - effects/Wahwah.h - - # VST Effects - - $<$: - effects/VST/VSTControl.h - effects/VST/VSTEffect.cpp - effects/VST/VSTEffect.h - effects/VST/aeffectx.h - > - - $<$,$>: - effects/VST/VSTControlGTK.cpp - effects/VST/VSTControlGTK.h - > - - $<$,$>: - effects/VST/VSTControlMSW.cpp - effects/VST/VSTControlMSW.h - > - - $<$,$>: - effects/VST/VSTControlOSX.h - effects/VST/VSTControlOSX.mm - > - - # Audio Unit Effects - - $<$,$>: - effects/audiounits/AUControl.h - effects/audiounits/AUControl.mm - effects/audiounits/AudioUnitEffect.cpp - effects/audiounits/AudioUnitEffect.h - > - - # Ladspa Effects - - $<$: - effects/ladspa/LadspaEffect.cpp - effects/ladspa/LadspaEffect.h - effects/ladspa/ladspa.h - > - - # LV2 Effects - - $<$: - effects/lv2/LV2Effect.cpp - effects/lv2/LV2Effect.h - effects/lv2/LoadLV2.cpp - effects/lv2/LoadLV2.h - effects/lv2/NativeWindow.h - effects/lv2/lv2_external_ui.h - effects/lv2/zix/common.h - effects/lv2/zix/ring.cpp - effects/lv2/zix/ring.h - > - - # Nyquist Effects - - $<$: - effects/nyquist/LoadNyquist.cpp - effects/nyquist/LoadNyquist.h - effects/nyquist/Nyquist.cpp - effects/nyquist/Nyquist.h - > - - # VAMP Effects - - $<$: - effects/vamp/LoadVamp.cpp - effects/vamp/LoadVamp.h - effects/vamp/VampEffect.cpp - effects/vamp/VampEffect.h - > - - # Export - - export/Export.cpp - export/Export.h - - # Standard exporters - export/ExportCL.cpp - export/ExportMP3.cpp - export/ExportMP3.h - export/ExportMultiple.cpp - export/ExportMultiple.h - export/ExportPCM.cpp - - # Optional exporters - $<$: - export/ExportFFmpeg.cpp - export/ExportFFmpegDialogs.cpp - export/ExportFFmpegDialogs.h - > - - $<$: - export/ExportFLAC.cpp - > - - $<$: - export/ExportMP2.cpp - > - - $<$,$>: - export/ExportOGG.cpp - > - - # Import - - import/FormatClassifier.cpp - import/FormatClassifier.h - import/Import.cpp - import/Import.h - import/ImportForwards.h - import/MultiFormatReader.cpp - import/MultiFormatReader.h - import/RawAudioGuess.cpp - import/RawAudioGuess.h - import/SpecPowerMeter.cpp - import/SpecPowerMeter.h - - # Standard importers - - import/ImportAUP.cpp - import/ImportLOF.cpp - import/ImportPCM.cpp - import/ImportPlugin.h - import/ImportPlugin.cpp - import/ImportRaw.cpp - import/ImportRaw.h - - # Optional importers - - $<$: - import/ImportFFmpeg.cpp - > - - $<$: - import/ImportFLAC.cpp - > - - $<$: - import/ImportMIDI.cpp - import/ImportMIDI.h - > - - $<$: - import/ImportMP3.cpp - > - - $<$,$>: - import/ImportOGG.cpp - > - - # Menus - - menus/ClipMenus.cpp - menus/EditMenus.cpp - menus/ExtraMenus.cpp - menus/FileMenus.cpp - menus/HelpMenus.cpp - menus/LabelMenus.cpp - menus/NavigationMenus.cpp - menus/PluginMenus.cpp - menus/SelectMenus.cpp - menus/ToolbarMenus.cpp - menus/TrackMenus.cpp - menus/TransportMenus.cpp - menus/ViewMenus.cpp - menus/WindowMenus.cpp - - # Preferences - - prefs/BatchPrefs.cpp - prefs/BatchPrefs.h - prefs/DevicePrefs.cpp - prefs/DevicePrefs.h - prefs/DirectoriesPrefs.cpp - prefs/DirectoriesPrefs.h - prefs/EffectsPrefs.cpp - prefs/EffectsPrefs.h - prefs/ExtImportPrefs.cpp - prefs/ExtImportPrefs.h - prefs/GUIPrefs.cpp - prefs/GUIPrefs.h - prefs/GUISettings.h - prefs/ImportExportPrefs.cpp - prefs/ImportExportPrefs.h - prefs/KeyConfigPrefs.cpp - prefs/KeyConfigPrefs.h - prefs/LibraryPrefs.cpp - prefs/LibraryPrefs.h - prefs/MidiIOPrefs.cpp - prefs/MidiIOPrefs.h - prefs/ModulePrefs.cpp - prefs/ModulePrefs.h - prefs/MousePrefs.cpp - prefs/MousePrefs.h - prefs/PlaybackPrefs.cpp - prefs/PlaybackPrefs.h - prefs/PrefsDialog.cpp - prefs/PrefsDialog.h - prefs/PrefsPanel.cpp - prefs/PrefsPanel.h - prefs/QualityPrefs.cpp - prefs/QualityPrefs.h - prefs/QualitySettings.cpp - prefs/QualitySettings.h - prefs/RecordingPrefs.cpp - prefs/RecordingPrefs.h - prefs/SpectrogramSettings.cpp - prefs/SpectrogramSettings.h - prefs/SpectrumPrefs.cpp - prefs/SpectrumPrefs.h - prefs/ThemePrefs.cpp - prefs/ThemePrefs.h - prefs/TracksBehaviorsPrefs.cpp - prefs/TracksBehaviorsPrefs.h - prefs/TracksPrefs.cpp - prefs/TracksPrefs.h - prefs/WarningsPrefs.cpp - prefs/WarningsPrefs.h - prefs/WaveformPrefs.cpp - prefs/WaveformPrefs.h - prefs/WaveformSettings.cpp - prefs/WaveformSettings.h - - # Toolbars - - toolbars/ControlToolBar.cpp - toolbars/ControlToolBar.h - toolbars/DeviceToolBar.cpp - toolbars/DeviceToolBar.h - toolbars/EditToolBar.cpp - toolbars/EditToolBar.h - toolbars/MeterToolBar.cpp - toolbars/MeterToolBar.h - toolbars/ScrubbingToolBar.cpp - toolbars/ScrubbingToolBar.h - toolbars/SelectionBar.cpp - toolbars/SelectionBar.h - toolbars/SelectionBarListener.h - toolbars/SpectralSelectionBar.cpp - toolbars/SpectralSelectionBar.h - toolbars/SpectralSelectionBarListener.h - toolbars/TimeToolBar.cpp - toolbars/TimeToolBar.h - toolbars/ToolBar.cpp - toolbars/ToolBar.h - toolbars/ToolDock.cpp - toolbars/ToolDock.h - toolbars/ToolManager.cpp - toolbars/ToolManager.h - toolbars/ToolsToolBar.cpp - toolbars/ToolsToolBar.h - toolbars/TranscriptionToolBar.cpp - toolbars/TranscriptionToolBar.h - - # Tracks - - tracks/labeltrack/ui/LabelDefaultClickHandle.cpp - tracks/labeltrack/ui/LabelDefaultClickHandle.h - tracks/labeltrack/ui/LabelGlyphHandle.cpp - tracks/labeltrack/ui/LabelGlyphHandle.h - tracks/labeltrack/ui/LabelTextHandle.cpp - tracks/labeltrack/ui/LabelTextHandle.h - tracks/labeltrack/ui/LabelTrackControls.cpp - tracks/labeltrack/ui/LabelTrackControls.h - tracks/labeltrack/ui/LabelTrackShifter.cpp - tracks/labeltrack/ui/LabelTrackVRulerControls.cpp - tracks/labeltrack/ui/LabelTrackVRulerControls.h - tracks/labeltrack/ui/LabelTrackView.cpp - tracks/labeltrack/ui/LabelTrackView.h - tracks/playabletrack/notetrack/ui/NoteTrackAffordanceControls.h - tracks/playabletrack/notetrack/ui/NoteTrackAffordanceControls.cpp - tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.cpp - tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.h - tracks/playabletrack/notetrack/ui/NoteTrackControls.cpp - tracks/playabletrack/notetrack/ui/NoteTrackControls.h - tracks/playabletrack/notetrack/ui/NoteTrackShifter.cpp - tracks/playabletrack/notetrack/ui/NoteTrackSliderHandles.cpp - tracks/playabletrack/notetrack/ui/NoteTrackSliderHandles.h - tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.cpp - tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.h - tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp - tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.h - tracks/playabletrack/notetrack/ui/NoteTrackView.cpp - tracks/playabletrack/notetrack/ui/NoteTrackView.h - tracks/playabletrack/notetrack/ui/StretchHandle.cpp - tracks/playabletrack/notetrack/ui/StretchHandle.h - tracks/playabletrack/ui/PlayableTrackButtonHandles.cpp - tracks/playabletrack/ui/PlayableTrackButtonHandles.h - tracks/playabletrack/ui/PlayableTrackControls.cpp - tracks/playabletrack/ui/PlayableTrackControls.h - tracks/playabletrack/wavetrack/ui/CutlineHandle.cpp - tracks/playabletrack/wavetrack/ui/CutlineHandle.h - tracks/playabletrack/wavetrack/ui/SampleHandle.cpp - tracks/playabletrack/wavetrack/ui/SampleHandle.h - tracks/playabletrack/wavetrack/ui/SpectrumVRulerControls.cpp - tracks/playabletrack/wavetrack/ui/SpectrumVRulerControls.h - tracks/playabletrack/wavetrack/ui/SpectrumVZoomHandle.cpp - tracks/playabletrack/wavetrack/ui/SpectrumVZoomHandle.h - tracks/playabletrack/wavetrack/ui/SpectrumView.cpp - tracks/playabletrack/wavetrack/ui/SpectrumView.h - tracks/playabletrack/wavetrack/ui/WaveTrackAffordanceControls.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackAffordanceControls.h - tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackControls.h - tracks/playabletrack/wavetrack/ui/WaveTrackShifter.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.h - tracks/playabletrack/wavetrack/ui/WaveTrackVRulerControls.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackVRulerControls.h - tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.h - tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackView.h - tracks/playabletrack/wavetrack/ui/WaveTrackViewConstants.cpp - tracks/playabletrack/wavetrack/ui/WaveTrackViewConstants.h - tracks/playabletrack/wavetrack/ui/WaveformVRulerControls.cpp - tracks/playabletrack/wavetrack/ui/WaveformVRulerControls.h - tracks/playabletrack/wavetrack/ui/WaveformVZoomHandle.cpp - tracks/playabletrack/wavetrack/ui/WaveformVZoomHandle.h - tracks/playabletrack/wavetrack/ui/WaveformView.cpp - tracks/playabletrack/wavetrack/ui/WaveformView.h - tracks/timetrack/ui/TimeTrackControls.cpp - tracks/timetrack/ui/TimeTrackControls.h - tracks/timetrack/ui/TimeTrackVRulerControls.cpp - tracks/timetrack/ui/TimeTrackVRulerControls.h - tracks/timetrack/ui/TimeTrackVZoomHandle.cpp - tracks/timetrack/ui/TimeTrackVZoomHandle.h - tracks/timetrack/ui/TimeTrackView.cpp - tracks/timetrack/ui/TimeTrackView.h - - # Tracks UI - - tracks/ui/AffordanceHandle.cpp - tracks/ui/AffordanceHandle.h - tracks/ui/BackgroundCell.cpp - tracks/ui/BackgroundCell.h - tracks/ui/ButtonHandle.cpp - tracks/ui/ButtonHandle.h - tracks/ui/CommonTrackControls.cpp - tracks/ui/CommonTrackControls.h - tracks/ui/CommonTrackPanelCell.cpp - tracks/ui/CommonTrackPanelCell.h - tracks/ui/CommonTrackView.cpp - tracks/ui/CommonTrackView.h - tracks/ui/EditCursorOverlay.cpp - tracks/ui/EditCursorOverlay.h - tracks/ui/EnvelopeHandle.cpp - tracks/ui/EnvelopeHandle.h - tracks/ui/PlayIndicatorOverlay.cpp - tracks/ui/PlayIndicatorOverlay.h - tracks/ui/ScrubUI.cpp - tracks/ui/ScrubUI.h - tracks/ui/Scrubbing.cpp - tracks/ui/Scrubbing.h - tracks/ui/SelectHandle.cpp - tracks/ui/SelectHandle.h - tracks/ui/SliderHandle.cpp - tracks/ui/SliderHandle.h - tracks/ui/TimeShiftHandle.cpp - tracks/ui/TimeShiftHandle.h - tracks/ui/TrackButtonHandles.cpp - tracks/ui/TrackButtonHandles.h - tracks/ui/TrackControls.cpp - tracks/ui/TrackControls.h - tracks/ui/TrackSelectHandle.cpp - tracks/ui/TrackSelectHandle.h - tracks/ui/TrackVRulerControls.cpp - tracks/ui/TrackVRulerControls.h - tracks/ui/TrackView.cpp - tracks/ui/TrackView.h - tracks/ui/ZoomHandle.cpp - tracks/ui/ZoomHandle.h - - # ui helpers - ui/AccessibleLinksFormatter.h - ui/AccessibleLinksFormatter.cpp - - # Widgets - - widgets/AButton.cpp - widgets/AButton.h - widgets/ASlider.cpp - widgets/ASlider.h - widgets/AttachableScrollBar.cpp - widgets/AttachableScrollBar.h - widgets/AudacityMessageBox.cpp - widgets/AudacityMessageBox.h - widgets/BackedPanel.cpp - widgets/BackedPanel.h - widgets/ErrorDialog.cpp - widgets/ErrorDialog.h - widgets/ExpandingToolBar.cpp - widgets/ExpandingToolBar.h - widgets/FileConfig.cpp - widgets/FileConfig.h - widgets/FileDialog/FileDialog.cpp - widgets/FileDialog/FileDialog.h - $<$: - widgets/FileDialog/win/FileDialogPrivate.cpp - widgets/FileDialog/win/FileDialogPrivate.h - > - $<$: - widgets/FileDialog/mac/FileDialogPrivate.mm - widgets/FileDialog/mac/FileDialogPrivate.h - > - $<$: - widgets/FileDialog/gtk/FileDialogPrivate.cpp - widgets/FileDialog/gtk/FileDialogPrivate.h - > - widgets/FileHistory.cpp - widgets/FileHistory.h - widgets/Grabber.cpp - widgets/Grabber.h - widgets/Grid.cpp - widgets/Grid.h - widgets/HelpSystem.cpp - widgets/HelpSystem.h - widgets/HtmlWindow.cpp - widgets/HtmlWindow.h - widgets/ImageRoll.cpp - widgets/ImageRoll.h - widgets/KeyView.cpp - widgets/KeyView.h - widgets/Meter.cpp - widgets/Meter.h - widgets/MeterPanelBase.cpp - widgets/MeterPanelBase.h - widgets/MultiDialog.cpp - widgets/MultiDialog.h - widgets/NumericTextCtrl.cpp - widgets/NumericTextCtrl.h - widgets/Overlay.cpp - widgets/Overlay.h - widgets/OverlayPanel.cpp - widgets/OverlayPanel.h - widgets/PopupMenuTable.cpp - widgets/PopupMenuTable.h - widgets/ProgressDialog.cpp - widgets/ProgressDialog.h - widgets/ReadOnlyText.h - widgets/Ruler.cpp - widgets/Ruler.h - widgets/UnwritableLocationErrorDialog.cpp - widgets/UnwritableLocationErrorDialog.h - widgets/Warning.cpp - widgets/Warning.h - widgets/WindowAccessible.cpp - widgets/WindowAccessible.h - widgets/numformatter.cpp - widgets/numformatter.h - widgets/valnum.cpp - widgets/valnum.h - widgets/wxPanelWrapper.cpp - widgets/wxPanelWrapper.h - widgets/wxTextCtrlWrapper.h - - # XML handling - xml/XMLFileReader.cpp - xml/XMLFileReader.h - xml/XMLTagHandler.cpp - xml/XMLTagHandler.h - xml/XMLWriter.cpp - xml/XMLWriter.h - xml/audacityproject.dtd - - Experimental.cmake +# ~~~ +# General source files +# ~~~ +list( APPEND SOURCES PRIVATE + AColor.cpp + AColor.h + AColorResources.h + ActiveProjects.cpp + ActiveProjects.h + AboutDialog.cpp + AboutDialog.h + AdornedRulerPanel.cpp + AdornedRulerPanel.h + AllThemeResources.cpp + AllThemeResources.h + AttachedVirtualFunction.h + AudacityApp.cpp + AudacityApp.h + $<$:AudacityApp.mm> + AudacityException.cpp + AudacityException.h + AudacityFileConfig.cpp + AudacityFileConfig.h + AudacityHeaders.cpp + AudacityHeaders.h + AudacityLogger.cpp + AudacityLogger.h + AudioIO.cpp + AudioIO.h + AudioIOBase.cpp + AudioIOBase.h + AudioIOBufferHelper.h + AudioIOListener.h + AutoRecoveryDialog.cpp + AutoRecoveryDialog.h + BatchCommandDialog.cpp + BatchCommandDialog.h + BatchCommands.cpp + BatchCommands.h + BatchProcessDialog.cpp + BatchProcessDialog.h + Benchmark.cpp + Benchmark.h + BuildInfo.h + CellularPanel.cpp + CellularPanel.h + ClassicThemeAsCeeCode.h + ClientData.h + ClientDataHelpers.h + Clipboard.cpp + Clipboard.h + CommonCommandFlags.cpp + CommonCommandFlags.h + DarkThemeAsCeeCode.h + DBConnection.cpp + DBConnection.h + DeviceChange.cpp + DeviceChange.h + DeviceManager.cpp + DeviceManager.h + Diags.cpp + Diags.h + Dither.cpp + Dither.h + Envelope.cpp + Envelope.h + EnvelopeEditor.cpp + EnvelopeEditor.h + FFT.cpp + FFT.h + FFmpeg.cpp + FFmpeg.h + FileException.cpp + FileException.h + FileFormats.cpp + FileFormats.h + FileIO.cpp + FileIO.h + FileNames.cpp + FileNames.h + FreqWindow.cpp + FreqWindow.h + HelpText.cpp + HelpText.h + HiContrastThemeAsCeeCode.h + HistoryWindow.cpp + HistoryWindow.h + HitTestResult.h + ImageManipulation.cpp + ImageManipulation.h + InconsistencyException.cpp + InconsistencyException.h + InterpolateAudio.cpp + InterpolateAudio.h + KeyboardCapture.cpp + KeyboardCapture.h + LabelDialog.cpp + LabelDialog.h + LabelTrack.cpp + LabelTrack.h + LangChoice.cpp + LangChoice.h + Legacy.cpp + Legacy.h + LightThemeAsCeeCode.h + Lyrics.cpp + Lyrics.h + LyricsWindow.cpp + LyricsWindow.h + MacroMagic.h + Matrix.cpp + Matrix.h + Menus.cpp + Menus.h + Mix.cpp + Mix.h + MixerBoard.cpp + MixerBoard.h + ModuleManager.cpp + ModuleManager.h + ModuleSettings.cpp + ModuleSettings.h + NoteTrack.cpp + NoteTrack.h + NumberScale.h + PitchName.cpp + PitchName.h + PlatformCompatibility.cpp + PlatformCompatibility.h + PlaybackSchedule.cpp + PlaybackSchedule.h + PluginManager.cpp + PluginManager.h + PluginRegistrationDialog.cpp + PluginRegistrationDialog.h + Prefs.cpp + Prefs.h + Printing.cpp + Printing.h + Profiler.cpp + Profiler.h + Project.cpp + Project.h + ProjectAudioIO.cpp + ProjectAudioIO.h + ProjectAudioManager.cpp + ProjectAudioManager.h + ProjectFileIO.cpp + ProjectFileIO.h + ProjectFileIORegistry.cpp + ProjectFileIORegistry.h + ProjectFileManager.cpp + ProjectFileManager.h + ProjectHistory.cpp + ProjectHistory.h + ProjectManager.cpp + ProjectManager.h + ProjectSelectionManager.cpp + ProjectSelectionManager.h + ProjectSerializer.cpp + ProjectSerializer.h + ProjectSettings.cpp + ProjectSettings.h + ProjectStatus.cpp + ProjectStatus.h + ProjectWindow.cpp + ProjectWindow.h + ProjectWindowBase.cpp + ProjectWindowBase.h + RealFFTf.cpp + RealFFTf.h + RealFFTf48x.cpp + RealFFTf48x.h + RefreshCode.h + Registrar.h + Registry.cpp + Registry.h + Resample.cpp + Resample.h + RingBuffer.cpp + RingBuffer.h + SampleBlock.cpp + SampleBlock.h + SampleFormat.cpp + SampleFormat.h + Screenshot.cpp + Screenshot.h + SelectUtilities.cpp + SelectUtilities.h + SelectedRegion.cpp + SelectedRegion.h + SelectionState.cpp + SelectionState.h + Sequence.cpp + Sequence.h + Shuttle.cpp + Shuttle.h + ShuttleGetDefinition.cpp + ShuttleGetDefinition.h + ShuttleGui.cpp + ShuttleGui.h + ShuttlePrefs.cpp + ShuttlePrefs.h + Snap.cpp + Snap.h + SoundActivatedRecord.cpp + SoundActivatedRecord.h + Spectrum.cpp + Spectrum.h + SpectrumAnalyst.cpp + SpectrumAnalyst.h + SplashDialog.cpp + SplashDialog.h + SqliteSampleBlock.cpp + SseMathFuncs.cpp + SseMathFuncs.h + Tags.cpp + Tags.h + TempDirectory.cpp + TempDirectory.h + Theme.cpp + Theme.h + ThemeAsCeeCode.h + TimeDialog.cpp + TimeDialog.h + TimeTrack.cpp + TimeTrack.h + TimerRecordDialog.cpp + TimerRecordDialog.h + Track.cpp + Track.h + TrackArtist.cpp + TrackArtist.h + TrackInfo.cpp + TrackInfo.h + TrackPanel.cpp + TrackPanel.h + TrackPanelAx.cpp + TrackPanelAx.h + TrackPanelCell.cpp + TrackPanelCell.h + TrackPanelDrawable.cpp + TrackPanelDrawable.h + TrackPanelDrawingContext.h + TrackPanelListener.h + TrackPanelMouseEvent.h + TrackPanelResizeHandle.cpp + TrackPanelResizeHandle.h + TrackPanelResizerCell.cpp + TrackPanelResizerCell.h + TrackUtilities.cpp + TrackUtilities.h + UIHandle.cpp + UIHandle.h + UndoManager.cpp + UndoManager.h + UserException.cpp + UserException.h + ViewInfo.cpp + ViewInfo.h + VoiceKey.cpp + VoiceKey.h + WaveClip.cpp + WaveClip.h + WaveTrack.cpp + WaveTrack.h + WaveTrackLocation.h + WrappedType.cpp + WrappedType.h + ZoomInfo.cpp + ZoomInfo.h + float_cast.h + wxFileNameWrapper.h ) -# -# -# +# ~~~ +# Commands source files +# ~~~ +list( APPEND SOURCES PRIVATE + commands/AppCommandEvent.cpp + commands/AppCommandEvent.h + commands/AudacityCommand.cpp + commands/AudacityCommand.h + commands/BatchEvalCommand.cpp + commands/BatchEvalCommand.h + commands/Command.cpp + commands/Command.h + commands/CommandBuilder.cpp + commands/CommandBuilder.h + commands/CommandContext.cpp + commands/CommandContext.h + commands/CommandDirectory.cpp + commands/CommandDirectory.h + commands/CommandFlag.h + commands/CommandFunctors.h + commands/CommandHandler.cpp + commands/CommandHandler.h + commands/CommandManager.cpp + commands/CommandManager.h + commands/CommandManagerWindowClasses.h + commands/CommandMisc.h + commands/CommandSignature.cpp + commands/CommandSignature.h + commands/CommandTargets.cpp + commands/CommandTargets.h + commands/CommandType.cpp + commands/CommandType.h + commands/CompareAudioCommand.cpp + commands/CompareAudioCommand.h + commands/Demo.cpp + commands/Demo.h + commands/DragCommand.cpp + commands/DragCommand.h + commands/GetInfoCommand.cpp + commands/GetInfoCommand.h + commands/GetTrackInfoCommand.cpp + commands/GetTrackInfoCommand.h + commands/HelpCommand.cpp + commands/HelpCommand.h + commands/ImportExportCommands.cpp + commands/ImportExportCommands.h + commands/Keyboard.cpp + commands/Keyboard.h + commands/LoadCommands.cpp + commands/LoadCommands.h + commands/MessageCommand.cpp + commands/MessageCommand.h + commands/OpenSaveCommands.cpp + commands/OpenSaveCommands.h + commands/PreferenceCommands.cpp + commands/PreferenceCommands.h + commands/ResponseQueue.cpp + commands/ResponseQueue.h + commands/ScreenshotCommand.cpp + commands/ScreenshotCommand.h + commands/ScriptCommandRelay.cpp + commands/ScriptCommandRelay.h + commands/SelectCommand.cpp + commands/SelectCommand.h + commands/SetClipCommand.cpp + commands/SetClipCommand.h + commands/SetEnvelopeCommand.cpp + commands/SetEnvelopeCommand.h + commands/SetLabelCommand.cpp + commands/SetLabelCommand.h + commands/SetProjectCommand.cpp + commands/SetProjectCommand.h + commands/SetTrackInfoCommand.cpp + commands/SetTrackInfoCommand.h + commands/Validators.h +) + +# ~~~ +# Effects source files +# ~~~ +list( APPEND SOURCES PRIVATE + # Built-in effects + effects/Amplify.cpp + effects/Amplify.h + effects/AutoDuck.cpp + effects/AutoDuck.h + effects/BassTreble.cpp + effects/BassTreble.h + effects/Biquad.cpp + effects/Biquad.h + effects/ChangePitch.cpp + effects/ChangePitch.h + effects/ChangeSpeed.cpp + effects/ChangeSpeed.h + effects/ChangeTempo.cpp + effects/ChangeTempo.h + effects/ClickRemoval.cpp + effects/ClickRemoval.h + effects/Compressor.cpp + effects/Compressor.h + effects/Contrast.cpp + effects/Contrast.h + effects/Distortion.cpp + effects/Distortion.h + effects/DtmfGen.cpp + effects/DtmfGen.h + effects/EBUR128.cpp + effects/EBUR128.h + effects/Echo.cpp + effects/Echo.h + effects/Effect.cpp + effects/Effect.h + effects/EffectManager.cpp + effects/EffectManager.h + effects/EffectUI.cpp + effects/EffectUI.h + effects/Equalization.cpp + effects/Equalization.h + effects/Equalization48x.cpp + effects/Equalization48x.h + effects/Fade.cpp + effects/Fade.h + effects/FindClipping.cpp + effects/FindClipping.h + effects/Generator.cpp + effects/Generator.h + effects/Invert.cpp + effects/Invert.h + effects/LoadEffects.cpp + effects/LoadEffects.h + effects/Loudness.cpp + effects/Loudness.h + effects/Noise.cpp + effects/Noise.h + effects/NoiseReduction.cpp + effects/NoiseReduction.h + effects/NoiseRemoval.cpp + effects/NoiseRemoval.h + effects/Normalize.cpp + effects/Normalize.h + effects/Paulstretch.cpp + effects/Paulstretch.h + effects/Phaser.cpp + effects/Phaser.h + effects/RealtimeEffectManager.cpp + effects/RealtimeEffectManager.h + effects/Repair.cpp + effects/Repair.h + effects/Repeat.cpp + effects/Repeat.h + effects/Reverb.cpp + effects/Reverb.h + effects/Reverb_libSoX.h + effects/Reverse.cpp + effects/Reverse.h + effects/SBSMSEffect.cpp + effects/SBSMSEffect.h + effects/ScienFilter.cpp + effects/ScienFilter.h + effects/ScoreAlignDialog.cpp + effects/ScoreAlignDialog.h + effects/Silence.cpp + effects/Silence.h + effects/SimpleMono.cpp + effects/SimpleMono.h + effects/SoundTouchEffect.cpp + effects/SoundTouchEffect.h + effects/StereoToMono.cpp + effects/StereoToMono.h + effects/TimeScale.cpp + effects/TimeScale.h + effects/TimeWarper.cpp + effects/TimeWarper.h + effects/ToneGen.cpp + effects/ToneGen.h + effects/TruncSilence.cpp + effects/TruncSilence.h + effects/TwoPassSimpleMono.cpp + effects/TwoPassSimpleMono.h + effects/Wahwah.cpp + effects/Wahwah.h + # VST effects + $<$: + effects/VST/VSTControl.h + effects/VST/VSTEffect.cpp + effects/VST/VSTEffect.h + effects/VST/aeffectx.h + > + $<$,$>: + effects/VST/VSTControlGTK.cpp + effects/VST/VSTControlGTK.h + > + $<$,$>: + effects/VST/VSTControlMSW.cpp + effects/VST/VSTControlMSW.h + > + $<$,$>: + effects/VST/VSTControlOSX.h + effects/VST/VSTControlOSX.mm + > + # Audio Unit effects + $<$,$>: + effects/audiounits/AUControl.h + effects/audiounits/AUControl.mm + effects/audiounits/AudioUnitEffect.cpp + effects/audiounits/AudioUnitEffect.h + > + # Ladspa effects + $<$: + effects/ladspa/LadspaEffect.cpp + effects/ladspa/LadspaEffect.h + effects/ladspa/ladspa.h + > + # LV2 effects + $<$: + effects/lv2/LV2Effect.cpp + effects/lv2/LV2Effect.h + effects/lv2/LoadLV2.cpp + effects/lv2/LoadLV2.h + effects/lv2/NativeWindow.h + effects/lv2/lv2_external_ui.h + effects/lv2/zix/common.h + effects/lv2/zix/ring.cpp + effects/lv2/zix/ring.h + > + # Nyquist effects + $<$: + effects/nyquist/LoadNyquist.cpp + effects/nyquist/LoadNyquist.h + effects/nyquist/Nyquist.cpp + effects/nyquist/Nyquist.h + > + # VAMP effects + $<$: + effects/vamp/LoadVamp.cpp + effects/vamp/LoadVamp.h + effects/vamp/VampEffect.cpp + effects/vamp/VampEffect.h + > +) + +# ~~~ +# Exports source files +# ~~~ +list( APPEND SOURCES PRIVATE + export/Export.cpp + export/Export.h + # Standard exporters + export/ExportCL.cpp + export/ExportMP3.cpp + export/ExportMP3.h + export/ExportMultiple.cpp + export/ExportMultiple.h + export/ExportPCM.cpp + # Optional exporters + $<$: + export/ExportFFmpeg.cpp + export/ExportFFmpegDialogs.cpp + export/ExportFFmpegDialogs.h + > + $<$: + export/ExportFLAC.cpp + > + $<$: + export/ExportMP2.cpp + > + $<$,$>: + export/ExportOGG.cpp + > +) + +# ~~~ +# Imports source files +# ~~~ +list( APPEND SOURCES PRIVATE + import/FormatClassifier.cpp + import/FormatClassifier.h + import/Import.cpp + import/Import.h + import/ImportForwards.h + import/MultiFormatReader.cpp + import/MultiFormatReader.h + import/RawAudioGuess.cpp + import/RawAudioGuess.h + import/SpecPowerMeter.cpp + import/SpecPowerMeter.h + # Standard importers + import/ImportAUP.cpp + import/ImportLOF.cpp + import/ImportPCM.cpp + import/ImportPlugin.h + import/ImportPlugin.cpp + import/ImportRaw.cpp + import/ImportRaw.h + # Optional importers + $<$: + import/ImportFFmpeg.cpp + > + $<$: + import/ImportFLAC.cpp + > + $<$: + import/ImportMIDI.cpp + import/ImportMIDI.h + > + $<$: + import/ImportMP3.cpp + > + $<$,$>: + import/ImportOGG.cpp + > +) + +# ~~~ +# Menus source files +# ~~~ +list( APPEND SOURCES PRIVATE + menus/ClipMenus.cpp + menus/EditMenus.cpp + menus/ExtraMenus.cpp + menus/FileMenus.cpp + menus/HelpMenus.cpp + menus/LabelMenus.cpp + menus/NavigationMenus.cpp + menus/PluginMenus.cpp + menus/SelectMenus.cpp + menus/ToolbarMenus.cpp + menus/TrackMenus.cpp + menus/TransportMenus.cpp + menus/ViewMenus.cpp + menus/WindowMenus.cpp +) + +# ~~~ +# Preferences source files +# ~~~ +list( APPEND SOURCES PRIVATE + prefs/BatchPrefs.cpp + prefs/BatchPrefs.h + prefs/DevicePrefs.cpp + prefs/DevicePrefs.h + prefs/DirectoriesPrefs.cpp + prefs/DirectoriesPrefs.h + prefs/EffectsPrefs.cpp + prefs/EffectsPrefs.h + prefs/ExtImportPrefs.cpp + prefs/ExtImportPrefs.h + prefs/GUIPrefs.cpp + prefs/GUIPrefs.h + prefs/GUISettings.h + prefs/ImportExportPrefs.cpp + prefs/ImportExportPrefs.h + prefs/KeyConfigPrefs.cpp + prefs/KeyConfigPrefs.h + prefs/LibraryPrefs.cpp + prefs/LibraryPrefs.h + prefs/MidiIOPrefs.cpp + prefs/MidiIOPrefs.h + prefs/ModulePrefs.cpp + prefs/ModulePrefs.h + prefs/MousePrefs.cpp + prefs/MousePrefs.h + prefs/PlaybackPrefs.cpp + prefs/PlaybackPrefs.h + prefs/PrefsDialog.cpp + prefs/PrefsDialog.h + prefs/PrefsPanel.cpp + prefs/PrefsPanel.h + prefs/QualityPrefs.cpp + prefs/QualityPrefs.h + prefs/QualitySettings.cpp + prefs/QualitySettings.h + prefs/RecordingPrefs.cpp + prefs/RecordingPrefs.h + prefs/SpectrogramSettings.cpp + prefs/SpectrogramSettings.h + prefs/SpectrumPrefs.cpp + prefs/SpectrumPrefs.h + prefs/ThemePrefs.cpp + prefs/ThemePrefs.h + prefs/TracksBehaviorsPrefs.cpp + prefs/TracksBehaviorsPrefs.h + prefs/TracksPrefs.cpp + prefs/TracksPrefs.h + prefs/WarningsPrefs.cpp + prefs/WarningsPrefs.h + prefs/WaveformPrefs.cpp + prefs/WaveformPrefs.h + prefs/WaveformSettings.cpp + prefs/WaveformSettings.h +) + +# ~~~ +# Toolbars source files +# ~~~ +list( APPEND SOURCES PRIVATE + toolbars/ControlToolBar.cpp + toolbars/ControlToolBar.h + toolbars/DeviceToolBar.cpp + toolbars/DeviceToolBar.h + toolbars/EditToolBar.cpp + toolbars/EditToolBar.h + toolbars/MeterToolBar.cpp + toolbars/MeterToolBar.h + toolbars/ScrubbingToolBar.cpp + toolbars/ScrubbingToolBar.h + toolbars/SelectionBar.cpp + toolbars/SelectionBar.h + toolbars/SelectionBarListener.h + toolbars/SpectralSelectionBar.cpp + toolbars/SpectralSelectionBar.h + toolbars/SpectralSelectionBarListener.h + toolbars/TimeToolBar.cpp + toolbars/TimeToolBar.h + toolbars/ToolBar.cpp + toolbars/ToolBar.h + toolbars/ToolDock.cpp + toolbars/ToolDock.h + toolbars/ToolManager.cpp + toolbars/ToolManager.h + toolbars/ToolsToolBar.cpp + toolbars/ToolsToolBar.h + toolbars/TranscriptionToolBar.cpp + toolbars/TranscriptionToolBar.h +) + +# ~~~ +# Tracks UI source files +# ~~~ +list( APPEND SOURCES PRIVATE + # Variant UIs + tracks/labeltrack/ui/LabelDefaultClickHandle.cpp + tracks/labeltrack/ui/LabelDefaultClickHandle.h + tracks/labeltrack/ui/LabelGlyphHandle.cpp + tracks/labeltrack/ui/LabelGlyphHandle.h + tracks/labeltrack/ui/LabelTextHandle.cpp + tracks/labeltrack/ui/LabelTextHandle.h + tracks/labeltrack/ui/LabelTrackControls.cpp + tracks/labeltrack/ui/LabelTrackControls.h + tracks/labeltrack/ui/LabelTrackShifter.cpp + tracks/labeltrack/ui/LabelTrackVRulerControls.cpp + tracks/labeltrack/ui/LabelTrackVRulerControls.h + tracks/labeltrack/ui/LabelTrackView.cpp + tracks/labeltrack/ui/LabelTrackView.h + tracks/playabletrack/notetrack/ui/NoteTrackAffordanceControls.h + tracks/playabletrack/notetrack/ui/NoteTrackAffordanceControls.cpp + tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.cpp + tracks/playabletrack/notetrack/ui/NoteTrackButtonHandle.h + tracks/playabletrack/notetrack/ui/NoteTrackControls.cpp + tracks/playabletrack/notetrack/ui/NoteTrackControls.h + tracks/playabletrack/notetrack/ui/NoteTrackShifter.cpp + tracks/playabletrack/notetrack/ui/NoteTrackSliderHandles.cpp + tracks/playabletrack/notetrack/ui/NoteTrackSliderHandles.h + tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.cpp + tracks/playabletrack/notetrack/ui/NoteTrackVRulerControls.h + tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.cpp + tracks/playabletrack/notetrack/ui/NoteTrackVZoomHandle.h + tracks/playabletrack/notetrack/ui/NoteTrackView.cpp + tracks/playabletrack/notetrack/ui/NoteTrackView.h + tracks/playabletrack/notetrack/ui/StretchHandle.cpp + tracks/playabletrack/notetrack/ui/StretchHandle.h + tracks/playabletrack/ui/PlayableTrackButtonHandles.cpp + tracks/playabletrack/ui/PlayableTrackButtonHandles.h + tracks/playabletrack/ui/PlayableTrackControls.cpp + tracks/playabletrack/ui/PlayableTrackControls.h + tracks/playabletrack/wavetrack/ui/CutlineHandle.cpp + tracks/playabletrack/wavetrack/ui/CutlineHandle.h + tracks/playabletrack/wavetrack/ui/SampleHandle.cpp + tracks/playabletrack/wavetrack/ui/SampleHandle.h + tracks/playabletrack/wavetrack/ui/SpectrumVRulerControls.cpp + tracks/playabletrack/wavetrack/ui/SpectrumVRulerControls.h + tracks/playabletrack/wavetrack/ui/SpectrumVZoomHandle.cpp + tracks/playabletrack/wavetrack/ui/SpectrumVZoomHandle.h + tracks/playabletrack/wavetrack/ui/SpectrumView.cpp + tracks/playabletrack/wavetrack/ui/SpectrumView.h + tracks/playabletrack/wavetrack/ui/WaveTrackAffordanceControls.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackAffordanceControls.h + tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackControls.h + tracks/playabletrack/wavetrack/ui/WaveTrackShifter.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackSliderHandles.h + tracks/playabletrack/wavetrack/ui/WaveTrackVRulerControls.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackVRulerControls.h + tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.h + tracks/playabletrack/wavetrack/ui/WaveTrackView.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackView.h + tracks/playabletrack/wavetrack/ui/WaveTrackViewConstants.cpp + tracks/playabletrack/wavetrack/ui/WaveTrackViewConstants.h + tracks/playabletrack/wavetrack/ui/WaveformVRulerControls.cpp + tracks/playabletrack/wavetrack/ui/WaveformVRulerControls.h + tracks/playabletrack/wavetrack/ui/WaveformVZoomHandle.cpp + tracks/playabletrack/wavetrack/ui/WaveformVZoomHandle.h + tracks/playabletrack/wavetrack/ui/WaveformView.cpp + tracks/playabletrack/wavetrack/ui/WaveformView.h + tracks/timetrack/ui/TimeTrackControls.cpp + tracks/timetrack/ui/TimeTrackControls.h + tracks/timetrack/ui/TimeTrackVRulerControls.cpp + tracks/timetrack/ui/TimeTrackVRulerControls.h + tracks/timetrack/ui/TimeTrackVZoomHandle.cpp + tracks/timetrack/ui/TimeTrackVZoomHandle.h + tracks/timetrack/ui/TimeTrackView.cpp + tracks/timetrack/ui/TimeTrackView.h + # Main UI + tracks/ui/AffordanceHandle.cpp + tracks/ui/AffordanceHandle.h + tracks/ui/BackgroundCell.cpp + tracks/ui/BackgroundCell.h + tracks/ui/ButtonHandle.cpp + tracks/ui/ButtonHandle.h + tracks/ui/CommonTrackControls.cpp + tracks/ui/CommonTrackControls.h + tracks/ui/CommonTrackPanelCell.cpp + tracks/ui/CommonTrackPanelCell.h + tracks/ui/CommonTrackView.cpp + tracks/ui/CommonTrackView.h + tracks/ui/EditCursorOverlay.cpp + tracks/ui/EditCursorOverlay.h + tracks/ui/EnvelopeHandle.cpp + tracks/ui/EnvelopeHandle.h + tracks/ui/PlayIndicatorOverlay.cpp + tracks/ui/PlayIndicatorOverlay.h + tracks/ui/ScrubUI.cpp + tracks/ui/ScrubUI.h + tracks/ui/Scrubbing.cpp + tracks/ui/Scrubbing.h + tracks/ui/SelectHandle.cpp + tracks/ui/SelectHandle.h + tracks/ui/SliderHandle.cpp + tracks/ui/SliderHandle.h + tracks/ui/TimeShiftHandle.cpp + tracks/ui/TimeShiftHandle.h + tracks/ui/TrackButtonHandles.cpp + tracks/ui/TrackButtonHandles.h + tracks/ui/TrackControls.cpp + tracks/ui/TrackControls.h + tracks/ui/TrackSelectHandle.cpp + tracks/ui/TrackSelectHandle.h + tracks/ui/TrackVRulerControls.cpp + tracks/ui/TrackVRulerControls.h + tracks/ui/TrackView.cpp + tracks/ui/TrackView.h + tracks/ui/ZoomHandle.cpp + tracks/ui/ZoomHandle.h +) + +# ~~~ +# UI helpers source files +# ~~~ +list( APPEND SOURCES PRIVATE + ui/AccessibleLinksFormatter.h + ui/AccessibleLinksFormatter.cpp +) + +# ~~~ +# Widgets source files +# ~~~ +list( APPEND SOURCES PRIVATE + widgets/AButton.cpp + widgets/AButton.h + widgets/ASlider.cpp + widgets/ASlider.h + widgets/AttachableScrollBar.cpp + widgets/AttachableScrollBar.h + widgets/AudacityMessageBox.cpp + widgets/AudacityMessageBox.h + widgets/BackedPanel.cpp + widgets/BackedPanel.h + widgets/ErrorDialog.cpp + widgets/ErrorDialog.h + widgets/ExpandingToolBar.cpp + widgets/ExpandingToolBar.h + widgets/FileConfig.cpp + widgets/FileConfig.h + widgets/FileDialog/FileDialog.cpp + widgets/FileDialog/FileDialog.h + $<$: + widgets/FileDialog/win/FileDialogPrivate.cpp + widgets/FileDialog/win/FileDialogPrivate.h + > + $<$: + widgets/FileDialog/mac/FileDialogPrivate.mm + widgets/FileDialog/mac/FileDialogPrivate.h + > + $<$: + widgets/FileDialog/gtk/FileDialogPrivate.cpp + widgets/FileDialog/gtk/FileDialogPrivate.h + > + widgets/FileHistory.cpp + widgets/FileHistory.h + widgets/Grabber.cpp + widgets/Grabber.h + widgets/Grid.cpp + widgets/Grid.h + widgets/HelpSystem.cpp + widgets/HelpSystem.h + widgets/HtmlWindow.cpp + widgets/HtmlWindow.h + widgets/ImageRoll.cpp + widgets/ImageRoll.h + widgets/KeyView.cpp + widgets/KeyView.h + widgets/Meter.cpp + widgets/Meter.h + widgets/MeterPanelBase.cpp + widgets/MeterPanelBase.h + widgets/MultiDialog.cpp + widgets/MultiDialog.h + widgets/NumericTextCtrl.cpp + widgets/NumericTextCtrl.h + widgets/Overlay.cpp + widgets/Overlay.h + widgets/OverlayPanel.cpp + widgets/OverlayPanel.h + widgets/PopupMenuTable.cpp + widgets/PopupMenuTable.h + widgets/ProgressDialog.cpp + widgets/ProgressDialog.h + widgets/ReadOnlyText.h + widgets/Ruler.cpp + widgets/Ruler.h + widgets/UnwritableLocationErrorDialog.cpp + widgets/UnwritableLocationErrorDialog.h + widgets/Warning.cpp + widgets/Warning.h + widgets/WindowAccessible.cpp + widgets/WindowAccessible.h + widgets/numformatter.cpp + widgets/numformatter.h + widgets/valnum.cpp + widgets/valnum.h + widgets/wxPanelWrapper.cpp + widgets/wxPanelWrapper.h + widgets/wxTextCtrlWrapper.h +) + +# ~~~ +# XML source files +# ~~~ +list( APPEND SOURCES PRIVATE + xml/XMLFileReader.cpp + xml/XMLFileReader.h + xml/XMLTagHandler.cpp + xml/XMLTagHandler.h + xml/XMLWriter.cpp + xml/XMLWriter.h + xml/audacityproject.dtd +) + +# ~~~ +# Experimental module +# ~~~ +list( APPEND SOURCES PRIVATE Experimental.cmake ) + +# ~~~ +# General headers +# ~~~ list( APPEND HEADERS - ../include/tenacity/EffectInterface.h - ../include/tenacity/Types.h - ../include/tenacity/ConfigInterface.h - ../include/tenacity/ModuleInterface.h - ../include/tenacity/PluginInterface.h - ../include/tenacity/ComponentInterface.h - ../include/tenacity/EffectAutomationParameters.h + ../include/tenacity/EffectInterface.h + ../include/tenacity/Types.h + ../include/tenacity/ConfigInterface.h + ../include/tenacity/ModuleInterface.h + ../include/tenacity/PluginInterface.h + ../include/tenacity/ComponentInterface.h + ../include/tenacity/EffectAutomationParameters.h ) -# -# -# -list( APPEND INCLUDES - PUBLIC - ${_PRVDIR} - ${CMAKE_SOURCE_DIR}/include - ${TARGET_ROOT} +# ~~~ +# General includes +# ~~~ +list( APPEND INCLUDES PUBLIC + "${_PRVDIR}" + "${CMAKE_SOURCE_DIR}/include" + "${TARGET_ROOT}" ) -# -# Define resources -# -list( APPEND RESOURCES - ../presets/EQDefaultCurves.xml +# ~~~ +# General resources +# ~~~ +list( APPEND RESOURCES ../presets/EQDefaultCurves.xml ) + +# ~~~ +# General definitions +# ~~~ +list( APPEND DEFINES PRIVATE + CMAKE + $<$: + HAVE_LRINT + > + $<$: + HAVE_LRINTF + > + $<$: + HAVE_MLOCK + > + $<$: + _CRT_SECURE_NO_WARNINGS + __STDC_CONSTANT_MACROS + STRICT + > ) -# -# -# -list( APPEND DEFINES - PRIVATE - CMAKE - $<$: - HAVE_LRINT - > - $<$: - HAVE_LRINTF - > - $<$: - HAVE_MLOCK - > - $<$: - _CRT_SECURE_NO_WARNINGS - __STDC_CONSTANT_MACROS - STRICT - > -) - -# If we have cmake 3.16 or higher, we can use precompiled headers, but -# only use them if ccache is not available and the user hasn't disabled -# it. +# Default to enabling PCH on supported CMake versions if compiler caching is unavailable if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" AND NOT CCACHE_PROGRAM AND NOT SCCACHE_PROGRAM ) - cmd_option( - ${_OPT}use_pch - "Use precompiled headers [yes, no]" - YES - ) + cmd_option( use_pch "Use precompiled headers [yes, no]" YES ) + set(USE_PCH ${use_pch} CACHE INTERNAL "") endif() -audacity_append_common_compiler_options( OPTIONS "${${_OPT}use_pch}" ) +audacity_append_common_compiler_options( OPTIONS "${USE_PCH}" ) -list( APPEND LDFLAGS - PRIVATE - $<$:/MANIFEST:NO> - $<$:-Wl,--disable-new-dtags> +# ~~~ +# Linker flags +# ~~~ +list( APPEND LDFLAGS PRIVATE + $<$:/MANIFEST:NO> + $<$:-Wl,--disable-new-dtags> ) -# -# -# -list( APPEND LIBRARIES - PUBLIC - ${CMAKE_REQUIRED_LIBRARIES} - ZLIB::ZLIB - wxWidgets::wxWidgets - EXPAT::EXPAT - mp3lame::mp3lame - SndFile::sndfile - Soxr::soxr - PortAudio::PortAudio - ${SQLite3_LIBRARIES} - $<$:FFMPEG::FFMPEG> - $<$:id3tag::id3tag> - $<$:FLAC++::FLAC++> - $<$:MAD::MAD> - $<$:Ogg::ogg> - $<$:Vorbis::vorbis> - $<$:Vorbis::vorbisenc> - $<$:Vorbis::vorbisfile> - $<$:libtwolame::libtwolame> - $<$:lilv::lilv> - $<$:suil::suil> - $<$:PortMidi::PortMidi> - $<$:PortSMF::PortSMF> - libnyquist - $<$:sbsms::sbsms> - $<$:SoundTouch::SoundTouch> - $<$:VampHostSDK::VampHostSDK> - $<$:${GLIB_LIBRARIES}> - $<$:GTK::GTK> - $<$:Threads::Threads> +# ~~~ +# Publicly linked libraries +# ~~~ +list( APPEND LIBRARIES PUBLIC + ${CMAKE_REQUIRED_LIBRARIES} + ZLIB::ZLIB + wxWidgets::wxWidgets + EXPAT::EXPAT + mp3lame::mp3lame + SndFile::sndfile + Soxr::soxr + PortAudio::PortAudio + ${SQLite3_LIBRARIES} + $<$:FFMPEG::FFMPEG> + $<$:id3tag::id3tag> + $<$:FLAC++::FLAC++> + $<$:MAD::MAD> + $<$:Ogg::ogg> + $<$:Vorbis::vorbis> + $<$:Vorbis::vorbisenc> + $<$:Vorbis::vorbisfile> + $<$:libtwolame::libtwolame> + $<$:lilv::lilv> + $<$:suil::suil> + $<$:PortMidi::PortMidi> + $<$:PortSMF::PortSMF> + libnyquist + $<$:sbsms::sbsms> + $<$:SoundTouch::SoundTouch> + $<$:VampHostSDK::VampHostSDK> + $<$:${GLIB_LIBRARIES}> + $<$:GTK::GTK> + $<$:Threads::Threads> ) set( INSTALL_PREFIX "${_PREFIX}" ) @@ -1102,76 +1095,47 @@ set( PKGLIBDIR "${_PKGLIBDIR}" ) set( LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}" ) set( HAVE_GTK ${GTK_FOUND} ) -# Do not define these for Windows or Mac until further testing -# can be done against ExportMP3.cpp. If either are defined, the -# build will fail. -if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin" ) - if( LAME_FOUND ) - set( DISABLE_DYNAMIC_LOADING_LAME YES ) - endif() - - if( FFMPEG_FOUND ) - set( DISABLE_DYNAMIC_LOADING_FFMPEG YES ) - endif() -endif() +# ~~~ +# Platform specific configurations +# ~~~ if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) - set_target_properties( - ${TARGET} - PROPERTIES - # Make sure we're a GUI application and not a console tool - WIN32_EXECUTABLE ON - ) + set_target_properties( + ${TARGET} + PROPERTIES + WIN32_EXECUTABLE ON # Make sure we're a GUI application + ) - # Define the Windows specific resources - list( APPEND WIN_RESOURCES - ../win/tenacity.rc - ) + # Define the Windows specific resources + list( APPEND WIN_RESOURCES ../win/tenacity.rc ) - # Copy over the wxWidgets DLLs - - # Copy the required wxWidgets libs into the bundle - add_custom_command( - TARGET - ${TARGET} - COMMAND - ${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Tenacity.exe" - -D DST="${_EXEDIR}" - -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$/" - -P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake - -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} + # Copy the required wxWidgets libs into the bundle + add_custom_command( + TARGET ${TARGET} + COMMAND ${CMAKE_COMMAND} + -D SRC="${_EXEDIR}/Tenacity.exe" + -D DST="${_EXEDIR}" + -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$/" + -P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake" + -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} + POST_BUILD + ) + # Copy the MSVC runtime libraries as well + if( NOT "_X${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}" STREQUAL "_X" ) + add_custom_command( + TARGET ${TARGET} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} POST_BUILD - ) - - # Copy the VC runtime libraries as well - if(NOT "_X${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}" STREQUAL "_X") - add_custom_command( - TARGET - ${TARGET} - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} - POST_BUILD - ) - endif() - + ) + endif() elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - # Bug 2400 workaround - # - # Replaces the SDK version in the built executable with 10.13 to - # prevent high CPU usage and slow drawing on Mojave or newer - check_for_platform_version() - if( PLATFORM_VERSION_SUPPORTED ) - list( APPEND LDFLAGS - PRIVATE - -Wl,-platform_version,macos,${MIN_MACOS_VERSION},${TARGET_MACOS_VERSION} - ) - else() - list( APPEND LDFLAGS - PRIVATE - -Wl,-sdk_version,10.13 - ) - endif() + check_for_platform_version() + if( PLATFORM_VERSION_SUPPORTED ) + list( APPEND LDFLAGS PRIVATE -Wl,-platform_version,macos,${MIN_MACOS_VERSION},${TARGET_MACOS_VERSION} ) + else() + list( APPEND LDFLAGS PRIVATE -Wl,-sdk_version, ${TARGET_MACOS_VERSION} ) + endif() # Define Mac specific resources #TODO Remove Audacity from Mac resources @@ -1185,129 +1149,137 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) ../mac/Resources/TenacityWAV.icns ) - set_target_properties( - ${TARGET} - PROPERTIES - # Build a bundle - MACOSX_BUNDLE ON - # Add the resources - RESOURCE "${MAC_RESOURCES};${RESOURCES}" - ) - set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DESTDIR}" ) + set_target_properties( + ${TARGET} + PROPERTIES # Build a bundle + MACOSX_BUNDLE ON # Add the resources + RESOURCE "${MAC_RESOURCES};${RESOURCES}" + ) + set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DESTDIR}" ) - # These sources must be compiled as Objective C++ and excluded - # from precompiled header usage - set_source_files_properties( - AudacityApp.mm - KeyboardCapture.cpp - effects/EffectUI.cpp - effects/VST/VSTControlOSX.mm - effects/audiounits/AUControl.mm - menus/WindowMenus.cpp - widgets/FileDialog/mac/FileDialogPrivate.mm - PROPERTIES - COMPILE_FLAGS "-ObjC++" - SKIP_PRECOMPILE_HEADERS YES - ) + # These sources must be compiled as Objective C++ and excluded from precompiled header usage + set_source_files_properties( + AudacityApp.mm + KeyboardCapture.cpp + effects/EffectUI.cpp + effects/VST/VSTControlOSX.mm + effects/audiounits/AUControl.mm + menus/WindowMenus.cpp + widgets/FileDialog/mac/FileDialogPrivate.mm + PROPERTIES + COMPILE_FLAGS "-ObjC++" + SKIP_PRECOMPILE_HEADERS YES + ) - list( APPEND LIBRARIES - PRIVATE - "-framework Foundation" - "-framework Cocoa" - "-framework Carbon" - ) - if(USE_AUDIO_UNITS) - list(APPEND LIBRARIES - PRIVATE - "-framework AudioUnit" - "-framework CoreAudioKit") - endif() + list( APPEND LIBRARIES PRIVATE + "-framework Foundation" + "-framework Cocoa" + "-framework Carbon" + ) - # Use the Aqua theme - set( USE_AQUA_THEME 1 ) + if(USE_AUDIO_UNITS) + list( APPEND LIBRARIES PRIVATE + "-framework AudioUnit" + "-framework CoreAudioKit" + ) + endif() - # Copy the required wxWidgets libs into the bundle - add_custom_command( - TARGET - ${TARGET} - COMMAND - ${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Tenacity" - -D DST="${_PKGLIB}" - -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$" - -P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake - -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} - POST_BUILD - ) + # Use the Aqua theme + set( USE_AQUA_THEME 1 ) - # Define the Wrapper target - set( WRAPPER_ROOT "${TARGET_ROOT}/../mac" ) - set( WRAPPER_SOURCES "${WRAPPER_ROOT}/Wrapper.c" ) + # Copy the required wxWidgets libs into the bundle + add_custom_command( + TARGET ${TARGET} + COMMAND ${CMAKE_COMMAND} + -D SRC="${_EXEDIR}/Tenacity" + -D DST="${_PKGLIB}" + -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$" + -P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake" + -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} + POST_BUILD + ) - add_executable( Wrapper "${WRAPPER_SOURCES}" ) - add_dependencies( "${TARGET}" Wrapper ) + # Define the Wrapper target + set( WRAPPER_ROOT "${TARGET_ROOT}/../mac" ) + set( WRAPPER_SOURCES "${WRAPPER_ROOT}/Wrapper.c" ) - set_target_property_all( "Wrapper" RUNTIME_OUTPUT_DIRECTORY "${_EXEDIR}" ) - organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" ) + add_executable( Wrapper "${WRAPPER_SOURCES}" ) + add_dependencies( "${TARGET}" Wrapper ) + set_target_property_all( "Wrapper" RUNTIME_OUTPUT_DIRECTORY "${_EXEDIR}" ) + organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" ) else() - set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" ) + # TODO: Test ExportMP3.cpp more to allow us to do this on more OSes + if( LAME_FOUND ) + set( DISABLE_DYNAMIC_LOADING_LAME YES ) + endif() - # Build the list of mimetypes - # - # (Don't use generator expressions since it will leave null/empty - # entries in the list.) - set( MIMETYPES - application/x-audacity-project - ) - if( USE_FFMPEG ) - list( APPEND MIMETYPES - audio/aac - audio/ac3 - audio/mp4 - audio/x-ms-wma - video/mpeg - ) - endif() - if( USE_LIBFLAC ) - list( APPEND MIMETYPES - audio/flac - audio/x-flac - ) - endif() - if( USE_LIBMAD ) - list( APPEND MIMETYPES - audio/mpeg - ) - endif() - if( USE_SNDFILE ) - list( APPEND MIMETYPES - audio/basic - audio/x-aiff - audio/x-wav - ) - endif() - if( USE_LIBOGG AND USE_LIBVORBIS ) - list( APPEND MIMETYPES - application/ogg - audio/x-vorbis+ogg - ) - endif() + if( FFMPEG_FOUND ) + set( DISABLE_DYNAMIC_LOADING_FFMPEG YES ) + endif() - # Create the desktop file - configure_file( tenacity.desktop.in ${_INTDIR}/tenacity.desktop ) + set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" ) - # Copy the required wxWidgets libs into the bundle - add_custom_command( - TARGET - ${TARGET} - COMMAND - ${CMAKE_COMMAND} -D SRC="${_EXEDIR}/tenacity" - -D DST="${_DEST}/${_PKGLIB}" - -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$" - -P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake - -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} - POST_BUILD - ) + # Build the list of mimetypes (we can't use generator expressions) + set( MIMETYPES "" ) + + list( APPEND MIMETYPES + application/x-tenacity-project + ) + + if(USE_FFMPEG) + list( APPEND MIMETYPES + audio/aac + audio/ac3 + audio/mp4 + audio/x-ms-wma + video/mpeg + ) + endif() + + + if(USE_LIBFLAC) + list( APPEND MIMETYPES + audio/flac + audio/x-flac + ) + endif() + + if(USE_LIBMAD) + list( APPEND MIMETYPES + audio/mpeg + ) + endif() + + if(USE_SNDFILE) + list( APPEND MIMETYPES + audio/basic + audio/x-aiff + audio/x-wav + ) + endif() + + if(USE_LIBOGG AND USE_LIBVORBIS) + list( APPEND MIMETYPES + application/ogg + audio/x-vorbis+ogg + ) + endif() + + # Create the desktop file + configure_file( tenacity.desktop.in ${_INTDIR}/tenacity.desktop ) + + # Copy the required wxWidgets libs into the bundle + add_custom_command( + TARGET ${TARGET} + COMMAND ${CMAKE_COMMAND} + -D SRC="${_EXEDIR}/tenacity" + -D DST="${_DEST}/${_PKGLIB}" + -D WXWIN="${_SHARED_PROXY_BASE_PATH}/$" + -P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake" + -parallel ${CMAKE_BUILD_PARALLEL_LEVEL} + POST_BUILD + ) endif() set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${AUDACITY_NAME} ) @@ -1322,92 +1294,111 @@ organize_source( "${TARGET_ROOT}/../win" "win" "${WIN_RESOURCES}" ) # Get those pesky CMake files out of the way (on Windows) # source_group( - TREE - "${_INTDIR}" - PREFIX - "CMake" - FILES - ${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.cxx - ${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.hxx + TREE "${_INTDIR}" + PREFIX "CMake" + FILES + ${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.cxx + ${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.hxx ) # Define TENACITY_DLL_API import_symbol_define( import_symbol TENACITY_DLL ) export_symbol_define( export_symbol TENACITY_DLL ) -list( APPEND DEFINES PRIVATE "${export_symbol}" INTERFACE "${import_symbol}" ) +list( APPEND DEFINES + PRIVATE + "${export_symbol}" + INTERFACE + "${import_symbol}" +) target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ${MAC_RESOURCES} ${WIN_RESOURCES} ) target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} ) -target_compile_definitions( ${TARGET} PRIVATE ${CXX_WARNINGS_SILENCE_DEFINES}) +target_compile_definitions( ${TARGET} PRIVATE ${CXX_WARNINGS_SILENCE_DEFINES} ) target_compile_options( ${TARGET} PRIVATE ${OPTIONS} ) target_include_directories( ${TARGET} PRIVATE ${INCLUDES} ) target_link_options( ${TARGET} PRIVATE ${LDFLAGS} ) # Somehow the "version" target gets added to the LIBRARIES list? But only on Windows?? -list(REMOVE_ITEM LIBRARIES version) +list( REMOVE_ITEM LIBRARIES version ) target_link_libraries( ${TARGET} ${LIBRARIES} ) target_link_libraries( ${TARGET} PUBLIC ${AUDACITY_LIBRARIES} ) -if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" ) - if( ${_OPT}use_pch ) - message( STATUS "Using precompiled headers" ) - target_precompile_headers( ${TARGET} PRIVATE - $<$:${CMAKE_BINARY_DIR}/src/private/configwin.h> - $<$:${CMAKE_BINARY_DIR}/src/private/configmac.h> - $<$>:${CMAKE_BINARY_DIR}/src/private/configunix.h> - AudacityHeaders.h - ) - else() - message( STATUS "Not using precompiled headers" ) - endif() +if( USE_PCH ) + message( STATUS "Using precompiled headers" ) + target_precompile_headers( + ${TARGET} PRIVATE $<$:${CMAKE_BINARY_DIR}/src/private/configwin.h> + $<$:${CMAKE_BINARY_DIR}/src/private/configmac.h> + $<$>:${CMAKE_BINARY_DIR}/src/private/configunix.h> + AudacityHeaders.h + ) +else() + message( STATUS "Not using precompiled headers" ) endif() -if( "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" ) - install( - DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" +if( CMAKE_GENERATOR MATCHES "Xcode|Visual Studio*" ) + install( + DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/" + DESTINATION "." + USE_SOURCE_PERMISSIONS + PATTERN "*.pdb" EXCLUDE + PATTERN "*.ilk" EXCLUDE + ) +else() + if( APPLE ) + install( + TARGETS ${TARGET} + DESTINATION "." + RESOURCE DESTINATION "${_APPDIR}/Resources" + ) + elseif( WIN32 ) + install( + DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" DESTINATION "." USE_SOURCE_PERMISSIONS PATTERN "*.pdb" EXCLUDE PATTERN "*.ilk" EXCLUDE - ) -else() - if( APPLE ) - install( TARGETS ${TARGET} - DESTINATION "." - RESOURCE DESTINATION "${_APPDIR}/Resources" ) - elseif( WIN32 ) - install( DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - DESTINATION "." - USE_SOURCE_PERMISSIONS - PATTERN "*.pdb" EXCLUDE - PATTERN "*.ilk" EXCLUDE ) - else() - install( TARGETS ${TARGET} RUNTIME ) - install( DIRECTORY "${_DEST}/${_LIBDIR}/" - DESTINATION "${_LIBDIR}" - USE_SOURCE_PERMISSIONS - FILES_MATCHING PATTERN "*.so*" ) - install( FILES "${_INTDIR}/tenacity.desktop" - DESTINATION "${_DATADIR}/applications" ) - install( FILES "${CMAKE_SOURCE_DIR}/LICENSE.txt" "${CMAKE_SOURCE_DIR}/README.md" - DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}" ) - install( FILES "${_SRCDIR}/tenacity.xml" - DESTINATION "${_DATADIR}/mime/packages" ) - install( FILES "${CMAKE_SOURCE_DIR}/presets/EQDefaultCurves.xml" - DESTINATION "${_PKGDATA}" ) - install( PROGRAMS "${PROJECT_SOURCE_DIR}/linux/tenacity.sh" - DESTINATION "." - RENAME "tenacity" ) - endif() + ) + else() + install( TARGETS ${TARGET} RUNTIME ) + install( + DIRECTORY "${_DEST}/${_LIBDIR}/" + DESTINATION "${_LIBDIR}" + USE_SOURCE_PERMISSIONS FILES_MATCHING + PATTERN "*.so*" + ) + install( + FILES "${_INTDIR}/tenacity.desktop" + DESTINATION "${_DATADIR}/applications" + ) + install( + FILES "${CMAKE_SOURCE_DIR}/LICENSE.txt" "${CMAKE_SOURCE_DIR}/README.md" + DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}" + ) + install( + FILES "${_SRCDIR}/tenacity.xml" + DESTINATION "${_DATADIR}/mime/packages" + ) + install( + FILES "${CMAKE_SOURCE_DIR}/presets/EQDefaultCurves.xml" + DESTINATION "${_PKGDATA}" + ) + install( + PROGRAMS "${PROJECT_SOURCE_DIR}/linux/tenacity.sh" + DESTINATION "." + RENAME "tenacity" + ) + endif() endif() +#[[ # collect dependency information for third party libraries list( APPEND GRAPH_EDGES "Tenacity [shape=house]" ) foreach( LIBRARY ${LIBRARIES} ) - if (NOT LIBRARY MATCHES "PUBLIC|PRIVATE|INTERFACE") - canonicalize_node_name(LIBRARY "${LIBRARY}") + if( NOT LIBRARY MATCHES "PUBLIC|PRIVATE|INTERFACE" ) + canonicalize_node_name(LIBRARY "${LIBRARY}" ) list( APPEND GRAPH_EDGES "\"${TARGET}\" -> \"${LIBRARY}\"" ) endif() endforeach() #propagate collected edgets to root CMakeLists.txt set( GRAPH_EDGES "${GRAPH_EDGES}" PARENT_SCOPE ) +#]]