MuseScore/build.cmake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

306 lines
12 KiB
CMake
Raw Permalink Normal View History

ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
#!/usr/bin/env -S cmake -P
# This cross-platform script automates the process of creating a build directory and
# compiling MuseScore. Despite being written in the CMake language, you should think
# of this file as like a shell script or batch file rather than as part of the CMake
# project tree. As always, the project tree starts in the top-level CMakeLists.txt.
string(TIMESTAMP SCRIPT_START_TIMESTAMP "%s" UTC)
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
if(NOT DEFINED CMAKE_SCRIPT_MODE_FILE)
file(RELATIVE_PATH SCRIPT_PATH "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_LIST_FILE}")
message(FATAL_ERROR
"This file is a script. You should run it with:\n"
" \$ cmake -P ${SCRIPT_PATH} [args...]\n"
"Don't try to use it in other CMake files with include().\n"
"See https://cmake.org/cmake/help/latest/manual/cmake.1.html#run-a-script"
)
endif()
cmake_minimum_required(VERSION 3.16) # should match version in CMakeLists.txt
# CMake arguments up to '-P' (ignore these)
set(i "1")
while(i LESS "${CMAKE_ARGC}")
if("${CMAKE_ARGV${i}}" STREQUAL "-P")
math(EXPR i "${i} + 1") # ignore '-P' option
break() # done with CMake arguments
endif()
math(EXPR i "${i} + 1") # next argument
endwhile()
# Script arguments (store these for later processing)
# By convention, SCRIPT_ARG[0] is the name of the script
set(SCRIPT_ARGS "") # empty argument list
while(i LESS "${CMAKE_ARGC}")
list(APPEND SCRIPT_ARGS "${CMAKE_ARGV${i}}")
math(EXPR i "${i} + 1") # next argument
endwhile()
# load custom CMake functions and macros
include("${CMAKE_CURRENT_LIST_DIR}/build/cmake/GetUtilsFunctions.cmake") # "fn__" namespace
# Set the name of the build folder (just the folder name, not the full path)
function(build_folder
VAR_NAME # Name of variable to store build folder name
)
# Windows has a 260 character limit on file paths, so the build folder
# name must be abbreviated to prevent build files exceeding this limit.
# The limit applies to the *entire* path, not just individual components.
# Abbreviation is not essential on other platforms but is still welcome.
if(WIN32)
set(PLATFORM "Win")
elseif(APPLE)
set(PLATFORM "Mac")
else()
set(PLATFORM "${CMAKE_HOST_SYSTEM_NAME}")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
endif()
set(GEN_SHORT "${GENERATOR}")
string(REGEX REPLACE ".*Visual Studio ([0-9]+).*" "VS\\1" GEN_SHORT "${GEN_SHORT}")
string(REGEX REPLACE ".*MinGW.*" "MinGW" GEN_SHORT "${GEN_SHORT}")
string(REGEX REPLACE ".*Makefile.*" "Make" GEN_SHORT "${GEN_SHORT}")
set(BUILD_FOLDER "${PLATFORM}-Qt${QT_VERSION}-${QT_COMPILER}-${GEN_SHORT}-${BUILD_TYPE}")
string(REGEX REPLACE "[ /\\]" "" BUILD_FOLDER "${BUILD_FOLDER}") # remove spaces and slashes
set("${VAR_NAME}" "${BUILD_FOLDER}" PARENT_SCOPE)
endfunction()
# Default values for independent build variables
set(SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}") # MuseScore repo (directory of this script)
set(ALL_BUILDS_PATH "${SOURCE_PATH}/builds") # Where all build folders will be created
# CPUS
cmake_host_system_information(RESULT CPUS QUERY NUMBER_OF_LOGICAL_CORES)
if(NOT "${CPUS}" GREATER "0")
include(ProcessorCount)
ProcessorCount(CPUS)
endif()
# Overrides
# Use this file to replace build variable defaults with your own values.
# E.g. set your own GENERATOR, BUILD_TYPE, BUILD_FOLDER, or CPUS.
if(EXISTS "${SOURCE_PATH}/build_overrides.cmake")
message(STATUS "Including personal build overrides")
include("${SOURCE_PATH}/build_overrides.cmake")
endif()
# QTDIR environment variable is set automatically by Qt Creator. It can also
# be set manually in build_overrides.cmake for use with other IDEs.
# Typical value for ENV{QTDIR}: /path/to/Qt/<version>/<compiler>
if(DEFINED ENV{QTDIR})
# Add selected build kit to PATH.
if(WIN32)
set(ENV{PATH} "$ENV{QTDIR}/bin;$ENV{PATH}") # semicolon
else()
set(ENV{PATH} "$ENV{QTDIR}/bin:$ENV{PATH}") # colon
endif()
endif()
fn__require_program(QMAKE Qt --version "https://musescore.org/en/handbook/developers-handbook/compilation" qmake)
fn__set_qt_variables("${QMAKE}")
message(STATUS "QT_LOCATION: ${QT_LOCATION}")
message(STATUS "QT_VERSION: ${QT_VERSION}")
message(STATUS "QT_COMPILER: ${QT_COMPILER}")
# Process script arguments
set(i "1")
list(LENGTH SCRIPT_ARGS nargs)
while(i LESS "${nargs}")
list(GET SCRIPT_ARGS "${i}" ARG)
if("${ARG}" STREQUAL "clean")
set(ARG_CLEAN "TRUE")
elseif("${ARG}" STREQUAL "configure")
set(ARG_CONFIGURE "TRUE")
elseif("${ARG}" STREQUAL "build")
set(ARG_CONFIGURE "TRUE")
set(ARG_BUILD "TRUE")
elseif("${ARG}" STREQUAL "install")
set(ARG_CONFIGURE "TRUE")
set(ARG_BUILD "TRUE")
set(ARG_INSTALL "TRUE")
elseif("${ARG}" STREQUAL "run")
set(ARG_RUN "TRUE")
else()
# Other arguments are used by certain subprocesses in build steps
if(ARG_RUN)
list(APPEND RUN_ARGS "${ARG}") # args after "run" belong to Run step
else()
list(APPEND CONFIGURE_ARGS "${ARG}") # all other args belong to Configure step
endif()
endif()
math(EXPR i "${i} + 1") # next argument
endwhile()
# Default if no build steps given as arguments
if(NOT (ARG_CLEAN OR ARG_CONFIGURE OR ARG_BUILD OR ARG_INSTALL OR ARG_RUN))
set(ARG_CONFIGURE "TRUE")
set(ARG_BUILD "TRUE")
set(ARG_INSTALL "TRUE")
endif()
# Default values for build variables that depend on other build variables.
# These will only be set here if they were not already defined elsewhere,
# e.g. by script arguments or in build_overrides.cmake.
fn__get_option(GENERATOR -G ${CONFIGURE_ARGS})
if(WIN32)
2022-06-18 14:57:06 +02:00
fn__set_default(GENERATOR "Visual Studio 17 2022")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
else()
fn__set_default(GENERATOR "Unix Makefiles")
endif()
fn__get_option(BUILD_TYPE -DCMAKE_BUILD_TYPE ${CONFIGURE_ARGS})
fn__set_default(BUILD_TYPE "RelWithDebInfo")
if(NOT DEFINED BUILD_FOLDER)
build_folder(BUILD_FOLDER)
endif()
set(BUILD_PATH "${ALL_BUILDS_PATH}/${BUILD_FOLDER}")
fn__get_option(INSTALL_PATH -DCMAKE_INSTALL_PREFIX ${CONFIGURE_ARGS})
fn__set_default(INSTALL_PATH "install") # relative to BUILD_PATH
# MSCORE_EXECUTABLE (path relative to INSTALL_PATH)
if(WIN32)
fn__set_default(MSCORE_EXECUTABLE "bin/MuseScore4.exe")
elseif(APPLE)
fn__set_default(MSCORE_EXECUTABLE "mscore.app/Contents/MacOS/mscore")
else()
fn__set_default(MSCORE_EXECUTABLE "bin/mscore")
endif()
# make paths absolute if they are not already
get_filename_component(BUILD_PATH "${BUILD_PATH}" ABSOLUTE BASE_DIR "${SOURCE_PATH}")
get_filename_component(INSTALL_PATH "${INSTALL_PATH}" ABSOLUTE BASE_DIR "${BUILD_PATH}")
get_filename_component(MSCORE_EXECUTABLE "${MSCORE_EXECUTABLE}" ABSOLUTE BASE_DIR "${INSTALL_PATH}")
message(STATUS "SOURCE_PATH: ${SOURCE_PATH}")
message(STATUS "BUILD_PATH: ${BUILD_PATH}")
message(STATUS "INSTALL_PATH: ${INSTALL_PATH}")
message(STATUS "MSCORE_EXECUTABLE: ${MSCORE_EXECUTABLE}")
message(STATUS "CPUS: ${CPUS}")
message(STATUS "GENERATOR: ${GENERATOR}")
message(STATUS "BUILD_TYPE: ${BUILD_TYPE}")
list(APPEND CONFIGURE_ARGS "-G" "${GENERATOR}")
list(APPEND CONFIGURE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}")
list(APPEND CONFIGURE_ARGS "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}")
if(QT_COMPILER MATCHES "_64$" OR QT_COMPILER MATCHES "mingw64")
2023-02-13 13:37:26 +01:00
list(APPEND CONFIGURE_ARGS "-DMUE_COMPILE_BUILD_64=ON")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
else()
2023-02-13 13:37:26 +01:00
list(APPEND CONFIGURE_ARGS "-DMUE_COMPILE_BUILD_64=OFF")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
endif()
#### ACTUAL BUILD STEPS START HERE ####
# Clean - delete an existing build directory.
#
# We usually avoid this because performing a clean build takes much longer
Spelling (#11566) * spelling: above Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: accessibility Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: accessible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: account Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: action Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: activated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: active Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: again Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: allegro Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: alternative Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: amplitude Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: and Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: annotation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appended Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appending Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appropriate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arbitrarily Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: architecture Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arpeggio Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arranger Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: assumed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: asynchronous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: automatically Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: availability Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: backslashes Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: before Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: beginning Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: between Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bounding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bracket Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: builtin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: calculated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: categories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: check Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: class Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: clearance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: column Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: combinations Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: completed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: composer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: compression Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: consideration Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constraints Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: container Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: continuous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: contrabass Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: control Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convergence Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: conversion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convert Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: coordinates Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: correctly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: corresponds Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: counting Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: crescendo Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: customizable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: cutout Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: deep Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: denom Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: denominator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diagram Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diminished Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: direction Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: directories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: disconnected Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: doesn't Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: dotted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: easeinout Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: eighth Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: element Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: elements Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: enabled Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: engraving Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: evenly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exactly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exceed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: excerpts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: excessively Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exclusive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: extension Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: extrapolated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: farthest Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: fits Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: friends Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: function Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: glissando Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: global Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: grid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: halved Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: happen * spelling: harmonies Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: have Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: header Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: height Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: iabbrev Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ideally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: implementation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: in Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: incoming Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: incomplete Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: increase Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: indentation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: individual Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: infer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initial Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initially Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inputted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: instrument Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: instruments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: invalid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: invocation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: iplugin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: javascript Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: label Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: laid out Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: languages Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: length Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: linked Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: lyrchord Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: lyricist Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: managed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: manually Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mapping Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mappings Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: margins Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: measure Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: metric Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: metronome Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: military Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: milliseconds Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: minimum Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: modifiers Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: moving Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: multi Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: namespace Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: navigate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: necessary Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: needs Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: newly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: notation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: numerator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occasionally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurred Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurrence Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: omitted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: or Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: oriented Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: originally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ornament Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ornaments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: output Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: outputted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: outside Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overlapping Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overridden Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: package Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: padding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: parameter Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: percussion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: placement Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: playthrough Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: positive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: preceded Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: precision Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: previous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: process Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: property Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: proximity Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: publish Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rasgueado Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: read Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: receive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: received Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rectangle Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: regarding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: register Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: registry Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rehearsal Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: related Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: repeat Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: repeatp Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: replacements Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: represent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: representation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: responses Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rhythm Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: section Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: selected Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: selection Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: shortcuts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: signatures Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: simile Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: slurred Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: sound Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: staccato Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: staff Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: stuff Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: style Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: suffix Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: supported Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: symbol Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: symbols Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: system Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tablature Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tcp_invalid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: that Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: thickness Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tibetan Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: of Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: to Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transparent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transpose Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tremolo Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ultimately Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unassigned Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: underscore Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unhandled Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: uninstall Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unknown Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unnamed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: useful Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: usually Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: vertical Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: violin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: visible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: when Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: whether Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: with Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: within Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: without Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: would Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: writing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: written Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: xmlns Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Remove unused avaiableArticulationTypesChanged Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: firstSystemIndentation [API] Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Enable testIncompleteTuplet Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Drop stray comment Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Update license header in module.cmake per https://github.com/musescore/MuseScore/pull/11566#discussion_r870550003 Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-15 16:35:32 +02:00
# than an incremental build, but it is occasionally necessary. If you
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
# encounter errors during a build then you should try doing a clean build.
if(ARG_CLEAN)
message("\n~~~~ Actualizing Clean step ~~~~\n")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
message("Deleting ${BUILD_PATH}")
file(REMOVE_RECURSE "${BUILD_PATH}")
endif()
# Configure - generate build system for the native build tool.
#
# We only do this explicitly on the very first build. On subsequent builds
# the native build tool will redo the configuration if any CMake files were
# edited. You can force this to happen by deleting CMakeCache.txt.
if(ARG_CONFIGURE AND NOT EXISTS "${BUILD_PATH}/CMakeCache.txt")
message("\n~~~~ Actualizing Configure step ~~~~\n")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
file(MAKE_DIRECTORY "${BUILD_PATH}")
if(QT_COMPILER MATCHES "msvc")
set(CMAKE_WRAPPER "${SOURCE_PATH}/build/cmake_wrapper.bat")
else()
set(CMAKE_WRAPPER "cmake")
endif()
fn__command_string(ARGS_STR ${CONFIGURE_ARGS})
message("CONFIGURE_ARGS: ${ARGS_STR}")
execute_process(
# List of CMake arguments in CONFIGURE_ARGS variable. It must be unquoted here.
COMMAND "${CMAKE_WRAPPER}" -S "${SOURCE_PATH}" -B . ${CONFIGURE_ARGS}
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
WORKING_DIRECTORY "${BUILD_PATH}"
RESULT_VARIABLE EXIT_STATUS
)
if(NOT "${EXIT_STATUS}" EQUAL "0")
file(REMOVE "${BUILD_PATH}/CMakeCache.txt") # need to configure again next time
message(FATAL_ERROR "Configure step failed with status ${EXIT_STATUS}. See output above for details.")
endif()
endif()
# Build - compile code with the native build tool.
#
# We always do this. We can rely on the native build tool to be efficient and
# only (re)compile source files that have been edited since the last build.
if(ARG_BUILD)
message("\n~~~~ Actualizing Build step ~~~~\n")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
execute_process(
COMMAND cmake --build . --config "${BUILD_TYPE}" --parallel "${CPUS}"
WORKING_DIRECTORY "${BUILD_PATH}"
RESULT_VARIABLE EXIT_STATUS
)
if(NOT "${EXIT_STATUS}" EQUAL "0")
message(FATAL_ERROR "Build step failed with status ${EXIT_STATUS}. See output above for details.")
endif()
endif()
# Install - move compiled files to destination folders.
#
# Again, we always do this and rely on the tool itself to be efficient and
# only install files that have changed since last time.
if(ARG_INSTALL)
message("\n~~~~ Actualizing Install step ~~~~\n")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
execute_process(
COMMAND cmake --install . --config "${BUILD_TYPE}"
WORKING_DIRECTORY "${BUILD_PATH}"
RESULT_VARIABLE EXIT_STATUS
)
if(NOT "${EXIT_STATUS}" EQUAL "0")
message(FATAL_ERROR "Install step failed with status ${EXIT_STATUS}. See output above for details.")
endif()
endif()
# Run - attempt to run the compiled program within the installation folder.
#
# The working directory is unchanged. Use build_override.cmake to set the
# CMake variable RUN_ARGS to contain a list of arguments to pass to MuseScore
# on the command line. In addition, script arguments after "run" will be
Spelling (#11566) * spelling: above Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: accessibility Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: accessible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: account Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: action Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: activated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: active Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: again Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: allegro Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: alternative Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: amplitude Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: and Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: annotation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appended Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appending Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: appropriate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arbitrarily Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: architecture Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arpeggio Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: arranger Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: assumed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: asynchronous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: automatically Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: availability Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: backslashes Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: before Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: beginning Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: between Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bounding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bracket Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: builtin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: calculated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: categories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: check Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: class Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: clearance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: column Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: combinations Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: completed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: composer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: compression Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: consideration Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constraints Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: container Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: continuous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: contrabass Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: control Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convergence Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: conversion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convert Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: coordinates Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: correctly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: corresponds Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: counting Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: crescendo Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: customizable Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: cutout Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: deep Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: denom Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: denominator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diagram Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diminished Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: direction Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: directories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: disconnected Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: doesn't Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: dotted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: easeinout Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: eighth Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: element Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: elements Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: enabled Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: engraving Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: evenly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exactly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exceed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: excerpts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: excessively Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exclusive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: extension Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: extrapolated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: farthest Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: fits Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: friends Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: function Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: glissando Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: global Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: grid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: halved Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: happen * spelling: harmonies Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: have Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: header Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: height Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: iabbrev Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ideally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: implementation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: in Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: incoming Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: incomplete Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: increase Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: indentation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: individual Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: infer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initial Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initially Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inputted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: instrument Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: instruments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: invalid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: invocation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: iplugin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: javascript Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: label Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: laid out Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: languages Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: length Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: linked Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: lyrchord Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: lyricist Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: managed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: manually Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mapping Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mappings Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: margins Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: measure Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: metric Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: metronome Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: military Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: milliseconds Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: minimum Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: modifiers Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: moving Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: multi Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: namespace Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: navigate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: necessary Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: needs Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: newly Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: notation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: numerator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occasionally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurred Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: occurrence Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: omitted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: or Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: oriented Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: originally Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ornament Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ornaments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: output Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: outputted Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: outside Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overlapping Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overridden Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: package Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: padding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: parameter Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: percussion Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: placement Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: playthrough Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: positive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: preceded Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: precision Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: previous Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: process Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: property Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: proximity Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: publish Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rasgueado Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: read Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: receive Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: received Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rectangle Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: regarding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: register Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: registry Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rehearsal Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: related Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: repeat Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: repeatp Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: replacements Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: represent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: representation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: responses Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: rhythm Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: section Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: selected Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: selection Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separation Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: shortcuts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: signatures Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: simile Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: slurred Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: sound Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: staccato Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: staff Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: stuff Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: style Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: suffix Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: supported Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: symbol Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: symbols Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: system Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tablature Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tcp_invalid Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: that Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: thickness Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tibetan Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: of Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: to Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transparent Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: transpose Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: tremolo Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: ultimately Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unassigned Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: underscore Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unhandled Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: uninstall Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unknown Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unnamed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: useful Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: usually Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: vertical Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: violin Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: visible Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: when Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: whether Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: with Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: within Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: without Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: would Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: writing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: written Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: xmlns Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Remove unused avaiableArticulationTypesChanged Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: firstSystemIndentation [API] Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Enable testIncompleteTuplet Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Drop stray comment Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Update license header in module.cmake per https://github.com/musescore/MuseScore/pull/11566#discussion_r870550003 Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-05-15 16:35:32 +02:00
# appended to this list, but note that certain arguments cannot be passed this
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
# way (e.g. --help, --version) because they cancel CMake script processing.
if(ARG_RUN)
message("\n~~~~ Actualizing Run step ~~~~\n")
ONE BUILD SCRIPT TO RULE THEM ALL! Adds a cross-platform script that automates the process of creating a build directory and compiling MuseScore. Run the script like this: $ cmake -P build.cmake [args...] This works in all shells on all platforms. Developers with a Unix-like environment (including Git Bash on Windows) can also use: $ ./build.cmake [args...] Build step arguments: clean Delete the build directory. configure Create a build directory and run CMake inside it. build Compile code using the native build tool. install Copy compiled files to final destinations. run Run the installed program. Each step implies all previous steps except 'clean' and 'run', which are only performed when explictly requested. If no steps are given then the configure, build, and install steps are performed by default. All other arguments are passed to CMake during configuration. Example command: $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug $ cmake -P build.cmake -GNinja -DCMAKE_BUILD_TYPE=Debug run -F This creates and installs a Debug build using the Ninja generator, and then runs the compiled program with the -F option to perform a factory reset, thereby ensuring it is in the initial state. Overrides: If you frequently need to build with non-default settings then you can create a file build_overrides.cmake with all your personal settings to avoid having to pass them in on the command line each time. # build_overrides.cmake example file set(ENV{QTDIR} "$ENV{HOME}/Qt/5.15.2/gcc_64") list(APPEND CONFIGURE_ARGS -GNinja -DCMAKE_BUILD_TYPE=Debug) This file is ignored by Git to prevent it being shared with other developers, but you could always copy another file into its place (e.g. during a CI build on GitHub Actions).
2021-02-28 23:23:39 +01:00
if(WIN32)
set(CMD "cmd.exe" "/c") # allow CMake to launch a GUI application
else()
set(CMD "") # not an issue on other platforms
endif()
fn__command_string(ARGS_STR ${RUN_ARGS})
message("RUN_ARGS: ${ARGS_STR}")
execute_process(
# List of MuseScore arguments in RUN_ARGS variable. It must be unquoted here.
COMMAND ${CMD} "${MSCORE_EXECUTABLE}" ${RUN_ARGS}
RESULT_VARIABLE EXIT_STATUS
)
if(NOT "${EXIT_STATUS}" EQUAL "0")
message(FATAL_ERROR "Run step failed with status ${EXIT_STATUS}. See output above for details.")
endif()
endif()
# Package - create installer archive for distribution to end users.
# TODO
string(TIMESTAMP SCRIPT_END_TIMESTAMP "%s" UTC)
math(EXPR SCRIPT_ELAPSED_TIME "${SCRIPT_END_TIMESTAMP} - ${SCRIPT_START_TIMESTAMP}")
math(EXPR SCRIPT_ELAPSED_MINS "${SCRIPT_ELAPSED_TIME} / 60")
math(EXPR SCRIPT_ELAPSED_SECS "${SCRIPT_ELAPSED_TIME} % 60")
list(GET SCRIPT_ARGS "0" SCRIPT_NAME)
message("\n${SCRIPT_NAME}: Complete after ${SCRIPT_ELAPSED_MINS} minutes and ${SCRIPT_ELAPSED_SECS} seconds")