diff --git a/.github/workflows/ci_linux_mu4.yml b/.github/workflows/ci_linux_mu4.yml index 73d631de27..82637e31e7 100644 --- a/.github/workflows/ci_linux_mu4.yml +++ b/.github/workflows/ci_linux_mu4.yml @@ -138,6 +138,7 @@ jobs: - name: Setup environment if: env.DO_BUILD == 'true' run: | + echo "============================= gggg =======================" sudo bash ./build/ci/linux/setup.sh - name: Generate _en.ts files if: env.DO_BUILD == 'true' diff --git a/.github/workflows/ci_vtests.yml b/.github/workflows/ci_vtests.yml index 23ef75b440..0e828c7862 100644 --- a/.github/workflows/ci_vtests.yml +++ b/.github/workflows/ci_vtests.yml @@ -34,7 +34,7 @@ jobs: - name: Setup environment run: | - bash ./build/ci/linux/setup.sh + sudo bash ./build/ci/linux/setup.sh - name: Build run: | source $HOME/build_tools/environment.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 177d79a718..8790af973a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,12 +39,12 @@ set(CMAKE_MODULE_PATH ########################################### # Setup option and build settings ########################################### -set(MUSESCORE_BUILD_CONFIGURE "app" CACHE STRING "Build configure") -# Possible MUSESCORE_BUILD_CONFIGURE values: +set(MUSESCORE_BUILD_CONFIGURATION "app" CACHE STRING "Build configuration") +# Possible MUSESCORE_BUILD_CONFIGURATION values: # - app - for desktop app # - app-portable - for desktop portable app (Windows build for PortableApps.com) # - vtest - for visual tests -# - utest - for unit tests +# - utest - for unit tests (for CI) set(MUSESCORE_BUILD_MODE "dev" CACHE STRING "Build mode") # Possible MUSESCORE_BUILD_MODE values: @@ -89,7 +89,7 @@ option(MUE_DOWNLOAD_SOUNDFONT "Download the latest soundfont version as part of # === Pack === option(MUE_RUN_LRELEASE "Generate .qm files" ON) -option(MUE_PACKAGE_FILE_ASSOCIATION "File types association" OFF) +option(MUE_ENABLE_FILE_ASSOCIATION "File types association (using for package)" OFF) # === Tests === option(MUE_BUILD_UNIT_TESTS "Build unit tests" ON) @@ -123,6 +123,8 @@ option(MUE_ENABLE_ENGRAVING_PAINT_DEBUGGER "Enable diagnostic engraving paint de ########################################### include(SetupConfigure) +set(THIRDPARTY_DIR ${PROJECT_SOURCE_DIR}/thirdparty) + ########################################### # Setup compiler and build environment ########################################### @@ -133,17 +135,6 @@ if (MUE_COMPILE_USE_CCACHE) include(TryUseCcache) endif(MUE_COMPILE_USE_CCACHE) -########################################### -# Setup MuseScore config -########################################### - -include(${CMAKE_CURRENT_LIST_DIR}/config.cmake) -configure_file ( - ${PROJECT_SOURCE_DIR}/build/config.h.in - ${PROJECT_BINARY_DIR}/config.h - ) - -set(THIRDPARTY_DIR ${PROJECT_SOURCE_DIR}/thirdparty) ########################################### # Setup external dependencies diff --git a/SetupConfigure.cmake b/SetupConfigure.cmake index a93d59fc40..08dd8ba9e9 100644 --- a/SetupConfigure.cmake +++ b/SetupConfigure.cmake @@ -18,37 +18,70 @@ #============================================================================= include(GetBuildType) +include(GetPlatformInfo) +include(version) -message(STATUS "MUSESCORE_BUILD_CONFIGURE: ${MUSESCORE_BUILD_CONFIGURE}") + + +if (NOT MUSESCORE_BUILD_CONFIGURATION) + set(MUSESCORE_BUILD_CONFIGURATION "app") +endif() + +if (NOT MUSESCORE_BUILD_MODE) + set(MUSESCORE_BUILD_MODE "dev") +endif() + +# Set revision for local builds +# Before need run 'make revision' or 'msvc_build.bat revision' +include(${CMAKE_CURRENT_LIST_DIR}/build/cmake/TryUseLocalRevision.cmake) + +message(STATUS "MUSESCORE_BUILD_CONFIGURATION: ${MUSESCORE_BUILD_CONFIGURATION}") message(STATUS "MUSESCORE_BUILD_MODE: ${MUSESCORE_BUILD_MODE}") +message(STATUS "MUSESCORE_BUILD_NUMBER: ${CMAKE_BUILD_NUMBER}") -string(TOUPPER ${MUSESCORE_BUILD_CONFIGURE} BUILD_CONFIGURE) +string(TOUPPER ${MUSESCORE_BUILD_CONFIGURATION} BUILD_CONFIGURE) +string(TOUPPER ${MUSESCORE_BUILD_MODE} BUILD_MODE) ########################################### -# General +# Setup by mode ########################################### - -set(QT_SUPPORT ON) - -if (NOT MUE_BUILD_AUDIO_MODULE) - set(MUE_BUILD_MUSESAMPLER_MODULE OFF) - set(MUE_BUILD_VST_MODULE OFF) +if(BUILD_MODE MATCHES "DEV") + set(MUSESCORE_UNSTABLE ON) + set(MUSESCORE_VERSION_LABEL "dev") + set(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}") endif() -if (NOT MUE_BUILD_IMPORTEXPORT_MODULE) - set(MUE_BUILD_VIDEOEXPORT_MODULE OFF) +if(BUILD_MODE MATCHES "TESTING") + set(MUSESCORE_UNSTABLE OFF) + set(MUSESCORE_VERSION_LABEL "Testing") + set(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR} ${MUSESCORE_VERSION_LABEL}") endif() -if (NOT MUE_BUILD_DIAGNOSTICS_MODULE) - set(MUE_BUILD_CRASHPAD_CLIENT OFF) +if(BUILD_MODE MATCHES "RELEASE") + set(MUSESCORE_UNSTABLE OFF) + set(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}") endif() -if (MUE_BUILD_ASAN) - set(MUE_ENABLE_CUSTOM_ALLOCATOR OFF) +if (MUSESCORE_UNSTABLE) + set (MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION} (${MUSESCORE_VERSION_FULL} unstable)") endif() ########################################### -# Desktop App +# Setup paths +########################################### +if (OS_IS_MAC) + SET(Mscore_INSTALL_NAME "Contents/Resources/") + SET(Mscore_SHARE_NAME "mscore.app/") +elseif (OS_IS_WIN) + SET(Mscore_INSTALL_NAME "") + SET(Mscore_SHARE_NAME "./") +else() + SET(Mscore_INSTALL_NAME "mscore${MUSESCORE_INSTALL_SUFFIX}-${MUSESCORE_VERSION}/") + SET(Mscore_SHARE_NAME "share/") +endif() + +########################################### +# CONFIGURE: Desktop App ########################################### set(MUE_GENERAL_APP OFF) if(BUILD_CONFIGURE MATCHES "APP") @@ -68,14 +101,12 @@ if (MUE_GENERAL_APP) endif() endif() -if (OS_IS_MAC OR OS_IS_WIN) - if (WIN_PORTABLE) - set(MUE_BUILD_UPDATE_MODULE OFF) - endif() +if (WIN_PORTABLE) + set(MUE_BUILD_UPDATE_MODULE OFF) endif() ########################################### -# VTest +# CONFIGURE: VTest ########################################### if(BUILD_CONFIGURE MATCHES "VTEST") set(MUE_BUILD_AUDIO_MODULE OFF) @@ -102,16 +133,53 @@ if(BUILD_CONFIGURE MATCHES "VTEST") endif() ########################################### -# UTest +# CONFIGURE: UTest ########################################### if(BUILD_CONFIGURE MATCHES "UTEST") set(MUE_BUILD_UNIT_TESTS ON) set(MUE_ENABLE_LOGGER_DEBUGLEVEL ON) endif() +########################################### +# Subsystem +########################################### + +set(QT_SUPPORT ON) + +if (NOT MUE_BUILD_AUDIO_MODULE) + set(MUE_BUILD_MUSESAMPLER_MODULE OFF) + set(MUE_BUILD_VST_MODULE OFF) +endif() + +if (NOT MUE_BUILD_IMPORTEXPORT_MODULE) + set(MUE_BUILD_VIDEOEXPORT_MODULE OFF) +endif() + +if (NOT MUE_BUILD_DIAGNOSTICS_MODULE) + set(MUE_BUILD_CRASHPAD_CLIENT OFF) +endif() + +if (MUE_BUILD_ASAN) + set(MUE_ENABLE_CUSTOM_ALLOCATOR OFF) +endif() + ########################################### # Global definitions ########################################### + +add_definitions(-DMUSESCORE_REVISION="${MUSESCORE_REVISION}") +add_definitions(-DMUSESCORE_BUILD_NUMBER="${CMAKE_BUILD_NUMBER}") +add_definitions(-DMUSESCORE_VERSION="${MUSESCORE_VERSION_FULL}") +add_definitions(-DMUSESCORE_VERSION_LABEL="${MUSESCORE_VERSION_LABEL}") +add_definitions(-DMUSESCORE_INSTALL_SUFFIX="${MUSESCORE_INSTALL_SUFFIX}") +add_definitions(-DMUSESCORE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") +add_definitions(-DMUSESCORE_INSTALL_NAME="${Mscore_INSTALL_NAME}") + +if (MUSESCORE_UNSTABLE) + add_definitions(-DMUSESCORE_UNSTABLE) +endif() + + function(def_opt name val) if (${val}) add_definitions(-D${name}) @@ -153,7 +221,6 @@ if (WIN_PORTABLE) add_definitions(-DWIN_PORTABLE) endif() -add_definitions(-DMUSESCORE_REVISION="${MUSESCORE_REVISION}") add_definitions(-DHAW_PROFILER_ENABLED) if (MUE_ENABLE_LOAD_QML_FROM_SOURCE) diff --git a/build/Linux+BSD/mscore.1.in b/build/Linux+BSD/mscore.1.in index 32d1c0c10a..a636105644 100644 --- a/build/Linux+BSD/mscore.1.in +++ b/build/Linux+BSD/mscore.1.in @@ -7,8 +7,8 @@ .Dt @MAN_MSCORE_UPPER@ 1 .Os MuseScore .Sh NAME@Variables_substituted_by_CMAKE_on_installation@ -.Nm mscore@MSCORE_INSTALL_SUFFIX@ , -.Nm musescore@MSCORE_INSTALL_SUFFIX@ +.Nm mscore@MUSESCORE_INSTALL_SUFFIX@ , +.Nm musescore@MUSESCORE_INSTALL_SUFFIX@ .Nd @MUSESCORE_NAME_VERSION@ sheet music editor .Sh SYNOPSIS .Nm @@ -80,7 +80,7 @@ GNU General Public Licence (GPLv2). @MAN_PORTABLE@If MuseScore is installed, the manual can be viewed using @MAN_PORTABLE@the familiar command: @MAN_PORTABLE@.Pp -@MAN_PORTABLE@.Dl man mscore@MSCORE_INSTALL_SUFFIX@ +@MAN_PORTABLE@.Dl man mscore@MUSESCORE_INSTALL_SUFFIX@ @MAN_PORTABLE@.It Cm install Oo Fl i Oc Op Ar prefix @MAN_PORTABLE@Run this without the options to fully integrate MuseScore @MAN_PORTABLE@with the desktop environment (GNOME, KDE, etc). diff --git a/build/Linux+BSD/mscore.1.preview.sh b/build/Linux+BSD/mscore.1.preview.sh index 3c2a3ad08c..ce94b26906 100755 --- a/build/Linux+BSD/mscore.1.preview.sh +++ b/build/Linux+BSD/mscore.1.preview.sh @@ -32,7 +32,7 @@ esac sed \ -e 's!@MAN_MSCORE_UPPER@!MSCORE!g' \ -e 's!@Variables_substituted_by_CMAKE_on_installation@!!g' \ - -e 's!@MSCORE_INSTALL_SUFFIX@!!g' \ + -e 's!@MUSESCORE_INSTALL_SUFFIX@!!g' \ -e 's!@MUSESCORE_NAME_VERSION@!MuseScore 4!g' \ -e 's!@MAN_PORTABLE@!'"$portable"'!g' \ -e 's!@PORTABLE_INSTALL_NAME@!MuseScorePortable!g' \ diff --git a/build/Linux+BSD/musescore.xml.in b/build/Linux+BSD/musescore.xml.in index ee151d37ff..107f80f643 100644 --- a/build/Linux+BSD/musescore.xml.in +++ b/build/Linux+BSD/musescore.xml.in @@ -7,7 +7,7 @@ MuseScore File - + @@ -15,7 +15,7 @@ - + @@ -30,7 +30,7 @@ - + @@ -44,7 +44,7 @@ MuseScore compressed backup score - + @@ -52,7 +52,7 @@ - + @@ -105,7 +105,7 @@ MusicXML compressed score - + @@ -116,7 +116,7 @@ - + diff --git a/build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in b/build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in index 0574540d7b..d768300f75 100644 --- a/build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in +++ b/build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in @@ -9,11 +9,11 @@ $ appstreamcli validate [filename] $ appstream-util validate-relax [filename] --> - org.musescore.MuseScore@MSCORE_INSTALL_SUFFIX@ + org.musescore.MuseScore@MUSESCORE_INSTALL_SUFFIX@ CC0-1.0 MuseScore Create, play and print beautiful sheet music - mscore@MSCORE_INSTALL_SUFFIX@ + mscore@MUSESCORE_INSTALL_SUFFIX@

MuseScore is cross-platform, multi-lingual, open source music notation software. It features an easy to use WYSIWYG editor with audio score playback for results that look and sound beautiful. It supports unlimited staves with up to four voices each, dynamics, articulations, lyrics, chords, lead sheet notation, import/export of MIDI and MusicXML, export to PDF and WAV, plus online score sharing.

MuseScore can upload scores directly to the score sharing site musescore.com. Program support is provided on musescore.org.

@@ -55,11 +55,11 @@ https://musescore.org/en/forum/6 https://github.com/musescore/MuseScore https://musescore.org/en/contribute - org.musescore.MuseScore@MSCORE_INSTALL_SUFFIX@.desktop + org.musescore.MuseScore@MUSESCORE_INSTALL_SUFFIX@.desktop - mscore@MSCORE_INSTALL_SUFFIX@ - org.musescore.MuseScore@MSCORE_INSTALL_SUFFIX@.desktop + mscore@MUSESCORE_INSTALL_SUFFIX@ + org.musescore.MuseScore@MUSESCORE_INSTALL_SUFFIX@.desktop @@ -101,10 +101,10 @@ https://raw.githubusercontent.com/flathub/org.musescore.MuseScore/master/screenshots/07-new-score-wizard.png - mscore@MSCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/instruments - mscore@MSCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/musescore - mscore@MSCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/qt - mscore@MSCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/qtbase + mscore@MUSESCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/instruments + mscore@MUSESCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/musescore + mscore@MUSESCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/qt + mscore@MUSESCORE_INSTALL_SUFFIX@-@MUSESCORE_VERSION@/locale/qtbase diff --git a/build/Linux+BSD/org.musescore.MuseScore.desktop.in b/build/Linux+BSD/org.musescore.MuseScore.desktop.in index 7b9dc55a28..c9367902b2 100644 --- a/build/Linux+BSD/org.musescore.MuseScore.desktop.in +++ b/build/Linux+BSD/org.musescore.MuseScore.desktop.in @@ -11,8 +11,8 @@ GenericName[fr]=Notation musicale Comment=Create, play and print beautiful sheet music Comment[ru]=Визуальный редактор нотных партитур Comment[fr]=Gravure de partitions musicales -Icon=mscore@MSCORE_INSTALL_SUFFIX@ -Exec=mscore@MSCORE_INSTALL_SUFFIX@ %F +Icon=mscore@MUSESCORE_INSTALL_SUFFIX@ +Exec=mscore@MUSESCORE_INSTALL_SUFFIX@ %F Terminal=false MimeType=application/x-musescore;application/x-musescore+xml;application/vnd.recordare.musicxml;application/vnd.recordare.musicxml+xml;audio/midi;application/x-bww;application/x-biab;application/x-capella;audio/x-gtp;application/x-musedata;application/x-overture;audio/x-ptb;application/x-sf2;application/x-sf3; Categories=AudioVideo;Audio;Graphics;2DGraphics;VectorGraphics;RasterGraphics;Publishing;Midi;Mixer;Sequencer;Music;Qt; diff --git a/build/Linux+BSD/portable/AppRun.in b/build/Linux+BSD/portable/AppRun.in index 2684365270..77c6b59b7c 100644 --- a/build/Linux+BSD/portable/AppRun.in +++ b/build/Linux+BSD/portable/AppRun.in @@ -28,6 +28,6 @@ case "$1" in "${APPDIR}/bin/portable-utils" "$@" ;; * ) - "${APPDIR}/bin/mscore@MSCORE_INSTALL_SUFFIX@" "$@" + "${APPDIR}/bin/mscore@MUSESCORE_INSTALL_SUFFIX@" "$@" ;; esac diff --git a/build/Linux+BSD/portable/portable-utils.in b/build/Linux+BSD/portable/portable-utils.in index 71f8bb78da..4409e51024 100644 --- a/build/Linux+BSD/portable/portable-utils.in +++ b/build/Linux+BSD/portable/portable-utils.in @@ -18,7 +18,7 @@ function main() { removeResources "$2" "$3" || errorMsg "Unable to remove from '${prefix}'" ;; man|manual|manpage ) - man "${APPDIR}/share/man/man1/mscore@MSCORE_INSTALL_SUFFIX@.1.gz" + man "${APPDIR}/share/man/man1/mscore@MUSESCORE_INSTALL_SUFFIX@.1.gz" ;; check-depends|check-dependencies ) checkDependencies "$2" @@ -48,13 +48,13 @@ Special options for MuseScore Portable AppImage: check-depends [exes-only] Displays system information for developers. Ordinary MuseScore options: -$("${APPDIR}/bin/mscore@MSCORE_INSTALL_SUFFIX@" --help | tail -n +5) +$("${APPDIR}/bin/mscore@MUSESCORE_INSTALL_SUFFIX@" --help | tail -n +5) EOF } function printVersion() { - local pretty=$(sed -rn "s|^Name=([^#]*)|\1|p" "${APPDIR}/org.musescore.MuseScore@MSCORE_INSTALL_SUFFIX@.desktop") - local long=$("${APPDIR}/bin/mscore@MSCORE_INSTALL_SUFFIX@" --long-version 2>&1 | tail -n 1) + local pretty=$(sed -rn "s|^Name=([^#]*)|\1|p" "${APPDIR}/org.musescore.MuseScore@MUSESCORE_INSTALL_SUFFIX@.desktop") + local long=$("${APPDIR}/bin/mscore@MUSESCORE_INSTALL_SUFFIX@" --long-version 2>&1 | tail -n 1) if [ "$1" == "centered" ]; then printf "%*s\n" "$(((${#pretty}+80)/2))" "$pretty" printf "%*s\n" "$(((${#long}+80)/2))" "$long" @@ -183,18 +183,18 @@ EOF echo "Please enter 'm', 'c', 'n', or 'h'. ('h' shows help)" done fi - sed -ri "s|^Exec=[^#%]*(.*)\$|Exec=${APPIMAGE} \1|" "share/applications/org.musescore.MuseScore@MSCORE_INSTALL_SUFFIX@.desktop" + sed -ri "s|^Exec=[^#%]*(.*)\$|Exec=${APPIMAGE} \1|" "share/applications/org.musescore.MuseScore@MUSESCORE_INSTALL_SUFFIX@.desktop" echo "Finished installing MuseScore to $prefix" cat </dev/null; then cat < $ARTIFACTS_DIR/env/release_channel.env +echo ${MUSESCORE_RELEASE_CHANNEL} > $ARTIFACTS_DIR/env/release_channel.env cat $ARTIFACTS_DIR/env/release_channel.env diff --git a/build/ci/tools/make_version_env.sh b/build/ci/tools/make_version_env.sh index 26f99702f6..9a15d13566 100644 --- a/build/ci/tools/make_version_env.sh +++ b/build/ci/tools/make_version_env.sh @@ -26,7 +26,7 @@ ARTIFACTS_DIR="build.artifacts" # default output dir if [ -z "$2" ]; then OUT_DIR=${ARTIFACTS_DIR}/env; fi -export MUSESCORE_VERSION=$(cmake -P config.cmake | sed -n -e 's/^.*MUSESCORE_VERSION_FULL *//p') +export MUSESCORE_VERSION=$(cmake -P version.cmake | sed -n -e 's/^.*MUSESCORE_VERSION_FULL *//p') MUSESCORE_VERSION_FULL=$MUSESCORE_VERSION.$BUILD_NUMBER diff --git a/build/ci/windows/build.bat b/build/ci/windows/build.bat index 44272fd8e3..24a0c8af93 100644 --- a/build/ci/windows/build.bat +++ b/build/ci/windows/build.bat @@ -54,16 +54,16 @@ SET "PATH=%QT_DIR%\msvc2019_64\bin;%JACK_DIR%;%PATH%" SET BUILD_VST=ON SET VST3_SDK_PATH=C:\vst\VST3_SDK -SET MUSESCORE_BUILD_CONFIGURE="app" +SET MUSESCORE_BUILD_CONFIGURATION="app" IF %BUILD_WIN_PORTABLE% == ON ( SET INSTALL_DIR=../build.install/App/MuseScore - SET MUSESCORE_BUILD_CONFIGURE="app-portable" + SET MUSESCORE_BUILD_CONFIGURATION="app-portable" ) bash ./build/ci/tools/make_revision_env.sh SET /p MUSESCORE_REVISION=<%ARTIFACTS_DIR%\env\build_revision.env -SET MUSESCORE_BUILD_CONFIGURE=%MUSESCORE_BUILD_CONFIGURE% +SET MUSESCORE_BUILD_CONFIGURATION=%MUSESCORE_BUILD_CONFIGURATION% SET MUSESCORE_BUILD_MODE=%MUSESCORE_BUILD_MODE% SET MUSESCORE_BUILD_NUMBER=%BUILD_NUMBER% SET MUSESCORE_REVISION=%MUSESCORE_REVISION% diff --git a/build/ci/windows/package.bat b/build/ci/windows/package.bat index df94980ef3..ca512a52d3 100644 --- a/build/ci/windows/package.bat +++ b/build/ci/windows/package.bat @@ -147,7 +147,7 @@ IF %BUILD_MODE% == stable_build ( SET PACKAGE_FILE_ASSOCIATION=ON ) cd "%BUILD_DIR%" -cmake -DMUE_PACKAGE_FILE_ASSOCIATION=%PACKAGE_FILE_ASSOCIATION% .. +cmake -DMUE_ENABLE_FILE_ASSOCIATION=%PACKAGE_FILE_ASSOCIATION% .. SET PATH=%WIX_DIR%;%PATH% cmake --build . --target package || GOTO END_ERROR diff --git a/build/cmake/GetPlatformInfo.cmake b/build/cmake/GetPlatformInfo.cmake index 7bd545dcaa..d0029edb7b 100644 --- a/build/cmake/GetPlatformInfo.cmake +++ b/build/cmake/GetPlatformInfo.cmake @@ -11,54 +11,55 @@ else() message(FATAL_ERROR "Unsupported platform: ${CMAKE_HOST_SYSTEM_NAME}") endif() -# architecture detection -# based on QT5 processor detection code -# qtbase/blobs/master/src/corelib/global/qprocessordetection.h +if (NOT ARCH_DETECTED) + # architecture detection + # based on QT5 processor detection code + # qtbase/blobs/master/src/corelib/global/qprocessordetection.h -# we only have binary blobs compatible with x86_64, aarch64, and armv7l + # we only have binary blobs compatible with x86_64, aarch64, and armv7l -set(archdetect_c_code " -#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__) || defined(__ARM64__) - #if defined(__aarch64__) || defined(__ARM64__) - #error cmake_ARCH aarch64 - #elif defined(__ARM_ARCH_7A__) - #error cmake_ARCH armv7l + set(archdetect_c_code " + #if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__) || defined(__ARM64__) + #if defined(__aarch64__) || defined(__ARM64__) + #error cmake_ARCH aarch64 + #elif defined(__ARM_ARCH_7A__) + #error cmake_ARCH armv7l + #endif + #elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) + #error cmake_ARCH x86_64 #endif -#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) - #error cmake_ARCH x86_64 -#endif -#error cmake_ARCH unknown -") + #error cmake_ARCH unknown + ") -if(CMAKE_C_COMPILER_LOADED) - set(TA_EXTENSION "c") -elseif(CMAKE_CXX_COMPILER_LOADED) - set(TA_EXTENSION "cpp") -elseif(CMAKE_FORTRAN_COMPILER_LOADED) - set(TA_EXTENSION "F90") -else() - message(FATAL_ERROR "You must enable a C, CXX, or Fortran compiler to use TargetArch.cmake") -endif() + if(CMAKE_C_COMPILER_LOADED) + set(TA_EXTENSION "c") + elseif(CMAKE_CXX_COMPILER_LOADED) + set(TA_EXTENSION "cpp") + elseif(CMAKE_FORTRAN_COMPILER_LOADED) + set(TA_EXTENSION "F90") + else() + message(FATAL_ERROR "You must enable a C, CXX, or Fortran compiler to use TargetArch.cmake") + endif() -file(WRITE "${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}" "${archdetect_c_code}") + file(WRITE "${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}" "${archdetect_c_code}") -try_run( - run_result_unused - compile_result_unused - "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}" - COMPILE_OUTPUT_VARIABLE ARCH - CMAKE_FLAGS ${TA_CMAKE_FLAGS} -) + try_run( + run_result_unused + compile_result_unused + "${CMAKE_BINARY_DIR}" + "${CMAKE_BINARY_DIR}/arch.${TA_EXTENSION}" + COMPILE_OUTPUT_VARIABLE ARCH + CMAKE_FLAGS ${TA_CMAKE_FLAGS} + ) -string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") + string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") -string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") - -if (NOT ARCH_MSG) + string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") message(STATUS "Detected CPU Architecture: ${ARCH}") - set(ARCH_MSG ON) -endif() + + set(ARCH_DETECTED ON) + +endif(NOT ARCH_DETECTED) if(${ARCH} MATCHES "armv7l") set(ARCH_IS_ARMV7L 1) diff --git a/build/cmake/SetupAppImagePackaging.cmake b/build/cmake/SetupAppImagePackaging.cmake index c46a4ac363..678bd5c24e 100644 --- a/build/cmake/SetupAppImagePackaging.cmake +++ b/build/cmake/SetupAppImagePackaging.cmake @@ -6,24 +6,24 @@ if (NOT MINGW AND NOT MSVC AND NOT APPLE) # qt libraries as we used at compile time # - if (MSCORE_UNSTABLE) + if (MUSESCORE_UNSTABLE) # Use short name to avoid truncation by GNOME launcher. Save room for # a suffix in case multiple dev/nightly builds are installed. set(DESKTOP_LAUNCHER_NAME "MU ${MUSESCORE_VERSION}") # MU X.Y - else (MSCORE_UNSTABLE) + else (MUSESCORE_UNSTABLE) # Use full name for stable releases set(DESKTOP_LAUNCHER_NAME "${MUSESCORE_NAME} ${MUSESCORE_VERSION}") # MuseScore X.Y - endif(MSCORE_UNSTABLE) + endif(MUSESCORE_UNSTABLE) - if (${MSCORE_INSTALL_SUFFIX} MATCHES "dev") + if (${MUSESCORE_INSTALL_SUFFIX} MATCHES "dev") set(DESKTOP_LAUNCHER_NAME "${DESKTOP_LAUNCHER_NAME} Dev") - elseif (${MSCORE_INSTALL_SUFFIX} MATCHES "nightly") + elseif (${MUSESCORE_INSTALL_SUFFIX} MATCHES "nightly") set(DESKTOP_LAUNCHER_NAME "${DESKTOP_LAUNCHER_NAME} Nightly") - elseif (${MSCORE_INSTALL_SUFFIX} MATCHES "testing") + elseif (${MUSESCORE_INSTALL_SUFFIX} MATCHES "testing") set(DESKTOP_LAUNCHER_NAME "${DESKTOP_LAUNCHER_NAME} Testing") - endif(${MSCORE_INSTALL_SUFFIX} MATCHES "dev") + endif(${MUSESCORE_INSTALL_SUFFIX} MATCHES "dev") - if (${MSCORE_INSTALL_SUFFIX} MATCHES "portable") # Note: "portableanything" would match + if (${MUSESCORE_INSTALL_SUFFIX} MATCHES "portable") # Note: "portableanything" would match set(DESKTOP_LAUNCHER_NAME "${DESKTOP_LAUNCHER_NAME} Portable") # distinguish our build from distro packages # Build portable AppImage as per https://github.com/probonopd/AppImageKit add_subdirectory(build/Linux+BSD/portable) @@ -32,9 +32,9 @@ if (NOT MINGW AND NOT MSVC AND NOT APPLE) endif (NOT DEFINED ARCH) get_filename_component(PORTABLE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} PATH)# Get path (dirname) get_filename_component(PORTABLE_INSTALL_NAME ${CMAKE_INSTALL_PREFIX} NAME)# Strip path (basename) - if (NOT MSCORE_UNSTABLE) + if (NOT MUSESCORE_UNSTABLE) set(PORTABLE_INSTALL_NAME "${PORTABLE_INSTALL_NAME}-${MUSESCORE_VERSION_FULL}") # Append version info. - endif (NOT MSCORE_UNSTABLE) + endif (NOT MUSESCORE_UNSTABLE) set(PORTABLE_INSTALL_NAME "${PORTABLE_INSTALL_NAME}-${ARCH}") # Append system architecture. set(CMAKE_INSTALL_PREFIX ${PORTABLE_INSTALL_PATH}/${PORTABLE_INSTALL_NAME}.AppDir) # E.g. "MuseScore-X.Y.Z-x86_64.AppDir" execute_process(COMMAND echo ${CMAKE_INSTALL_PREFIX} OUTPUT_FILE PREFIX.txt) @@ -46,41 +46,41 @@ if (NOT MINGW AND NOT MSVC AND NOT APPLE) build/Linux+BSD/portable/ldd-recursive build/rm-empty-dirs DESTINATION bin COMPONENT portable) install(FILES build/Linux+BSD/portable/qt.conf DESTINATION bin COMPONENT portable) - else (${MSCORE_INSTALL_SUFFIX} MATCHES "portable") + else (${MUSESCORE_INSTALL_SUFFIX} MATCHES "portable") set(MAN_PORTABLE ".\\\"") # comment out lines in man page that are only relevant to the portable version - endif (${MSCORE_INSTALL_SUFFIX} MATCHES "portable") + endif (${MUSESCORE_INSTALL_SUFFIX} MATCHES "portable") # Identify MuseScore's main window so that it receives the correct name # and icon in the OS dock / taskbar. Run `xprop WM_CLASS` and click on # MuseScore's main window to find out what string to use here. - if (MSCORE_UNSTABLE) + if (MUSESCORE_UNSTABLE) set(WINDOW_MANAGER_CLASS "MuseScore4Development") - else (MSCORE_UNSTABLE) + else (MUSESCORE_UNSTABLE) set(WINDOW_MANAGER_CLASS "MuseScore4") - endif(MSCORE_UNSTABLE) + endif(MUSESCORE_UNSTABLE) # Install desktop file (perform variable substitution first) - configure_file(build/Linux+BSD/org.musescore.MuseScore.desktop.in org.musescore.MuseScore${MSCORE_INSTALL_SUFFIX}.desktop) - install( FILES ${PROJECT_BINARY_DIR}/org.musescore.MuseScore${MSCORE_INSTALL_SUFFIX}.desktop DESTINATION share/applications) + configure_file(build/Linux+BSD/org.musescore.MuseScore.desktop.in org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.desktop) + install( FILES ${PROJECT_BINARY_DIR}/org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.desktop DESTINATION share/applications) # Install appdata file (perform variable substitution first) - if ("${MSCORE_INSTALL_SUFFIX}" MATCHES "-") + if ("${MUSESCORE_INSTALL_SUFFIX}" MATCHES "-") message(FATAL_ERROR - "MSCORE_INSTALL_SUFFIX='${MSCORE_INSTALL_SUFFIX}'\n" - "MSCORE_INSTALL_SUFFIX must not contain hyphen characters. It will be used " + "MUSESCORE_INSTALL_SUFFIX='${MUSESCORE_INSTALL_SUFFIX}'\n" + "MUSESCORE_INSTALL_SUFFIX must not contain hyphen characters. It will be used " "inside the tag in *.appdata.xml and hyphens are discouraged there." ) - endif ("${MSCORE_INSTALL_SUFFIX}" MATCHES "-") - configure_file(build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in org.musescore.MuseScore${MSCORE_INSTALL_SUFFIX}.appdata.xml) - install( FILES ${PROJECT_BINARY_DIR}/org.musescore.MuseScore${MSCORE_INSTALL_SUFFIX}.appdata.xml DESTINATION share/metainfo) + endif ("${MUSESCORE_INSTALL_SUFFIX}" MATCHES "-") + configure_file(build/Linux+BSD/org.musescore.MuseScore.appdata.xml.in org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.appdata.xml) + install( FILES ${PROJECT_BINARY_DIR}/org.musescore.MuseScore${MUSESCORE_INSTALL_SUFFIX}.appdata.xml DESTINATION share/metainfo) # Substitute variables within man pages set(MAN_NAME mscore) set(MAN_ALIAS musescore) set(MAN_EXTENSION .1) - set(MAN_FULL_NAME ${MAN_NAME}${MSCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) - set(MAN_FULL_ALIAS ${MAN_ALIAS}${MSCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) + set(MAN_FULL_NAME ${MAN_NAME}${MUSESCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) + set(MAN_FULL_ALIAS ${MAN_ALIAS}${MUSESCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) set(MAN_TARGET ${PROJECT_SOURCE_DIR}/build/Linux+BSD/${MAN_NAME}${MAN_EXTENSION}.in) set(MAN_BUILD ${PROJECT_BINARY_DIR}/${MAN_FULL_NAME}) - string(TOUPPER "mscore${MSCORE_INSTALL_SUFFIX}" MAN_MSCORE_UPPER) # Command name shown in uppercase in man pages by convention + string(TOUPPER "mscore${MUSESCORE_INSTALL_SUFFIX}" MAN_MSCORE_UPPER) # Command name shown in uppercase in man pages by convention configure_file(${MAN_TARGET} ${MAN_BUILD}) # Compress man pages if gzip is installed (don't on OpenBSD) # Note: Compressing man pages is normal on Linux but not OpenBSD @@ -89,8 +89,8 @@ if (NOT MINGW AND NOT MSVC AND NOT APPLE) message(STATUS "Found 'gzip'. Man pages will be compressed.") set(MAN_TARGET ${MAN_BUILD}) set(MAN_EXTENSION ${MAN_EXTENSION}.gz) - set(MAN_FULL_NAME ${MAN_NAME}${MSCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) - set(MAN_FULL_ALIAS ${MAN_ALIAS}${MSCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) + set(MAN_FULL_NAME ${MAN_NAME}${MUSESCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) + set(MAN_FULL_ALIAS ${MAN_ALIAS}${MUSESCORE_INSTALL_SUFFIX}${MAN_EXTENSION}) set(MAN_BUILD ${PROJECT_BINARY_DIR}/${MAN_FULL_NAME}) add_custom_command( OUTPUT ${MAN_BUILD} @@ -130,7 +130,7 @@ if (NOT MINGW AND NOT MSVC AND NOT APPLE) message(STATUS "'ln' not found (it is optional). No symlink aliases will be created.") endif (LN_EXECUTABLE) # Add .MSCZ, .MSCX and .MSCS to MIME database (informs system that filetypes .MSCZ, .MSCX and .MSCS are MuseScore files) - configure_file(build/Linux+BSD/musescore.xml.in musescore${MSCORE_INSTALL_SUFFIX}.xml) - install( FILES ${PROJECT_BINARY_DIR}/musescore${MSCORE_INSTALL_SUFFIX}.xml DESTINATION share/mime/packages COMPONENT doc) + configure_file(build/Linux+BSD/musescore.xml.in musescore${MUSESCORE_INSTALL_SUFFIX}.xml) + install( FILES ${PROJECT_BINARY_DIR}/musescore${MUSESCORE_INSTALL_SUFFIX}.xml DESTINATION share/mime/packages COMPONENT doc) # Note: Must now run "update-mime-database" to apply changes. endif (NOT MINGW AND NOT MSVC AND NOT APPLE) diff --git a/build/cmake/config/dev.cmake b/build/cmake/config/dev.cmake deleted file mode 100644 index 307e69c3ce..0000000000 --- a/build/cmake/config/dev.cmake +++ /dev/null @@ -1,27 +0,0 @@ -#============================================================================= -# MuseScore -# Music Composition & Notation -# -# Copyright (C) 2002-2020 MuseScore BVBA and others -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#============================================================================= - -set(MSCORE_UNSTABLE TRUE) # Mark as unstable -set(MSCORE_RELEASE_CHANNEL "devel") - -if (NOT MUSESCORE_VERSION_LABEL) - SET(MUSESCORE_VERSION_LABEL "dev") -endif (NOT MUSESCORE_VERSION_LABEL) - -SET(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}") diff --git a/build/cmake/config/release.cmake b/build/cmake/config/release.cmake deleted file mode 100644 index 72479f31fd..0000000000 --- a/build/cmake/config/release.cmake +++ /dev/null @@ -1,23 +0,0 @@ -#============================================================================= -# MuseScore -# Music Composition & Notation -# -# Copyright (C) 2002-2020 MuseScore BVBA and others -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#============================================================================= - -set(MSCORE_UNSTABLE FALSE) -set(MSCORE_RELEASE_CHANNEL "stable") - -SET(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}") diff --git a/build/cmake/config/testing.cmake b/build/cmake/config/testing.cmake deleted file mode 100644 index 95f882d764..0000000000 --- a/build/cmake/config/testing.cmake +++ /dev/null @@ -1,27 +0,0 @@ -#============================================================================= -# MuseScore -# Music Composition & Notation -# -# Copyright (C) 2002-2020 MuseScore BVBA and others -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#============================================================================= - -set(MSCORE_UNSTABLE FALSE) -set(MSCORE_RELEASE_CHANNEL "testing") - -if (NOT MUSESCORE_VERSION_LABEL) - SET(MUSESCORE_VERSION_LABEL "Testing") -endif (NOT MUSESCORE_VERSION_LABEL) - -SET(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR} ${MUSESCORE_VERSION_LABEL}") diff --git a/build/config.h.in b/build/config.h.in deleted file mode 100644 index 0eb122aa18..0000000000 --- a/build/config.h.in +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-License-Identifier: GPL-3.0-only - * MuseScore-CLA-applies - * - * MuseScore - * Music Composition & Notation - * - * Copyright (C) 2021 MuseScore BVBA and others - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef MUSESCORE_CONFIG_H -#define MUSESCORE_CONFIG_H - -#cmakedefine MSCORE_UNSTABLE - -#define MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION}" -#define INSTALL_NAME "${Mscore_INSTALL_NAME}" -#define INSTPREFIX "${CMAKE_INSTALL_PREFIX}" -#define INSTSUFFIX "${MSCORE_INSTALL_SUFFIX}" -#define VERSION "${MUSESCORE_VERSION_FULL}" -#define VERSION_LABEL "${MUSESCORE_VERSION_LABEL}" -#define BUILD_NUMBER "${CMAKE_BUILD_NUMBER}" -#define SPARKLE_APPCAST_URL "${SPARKLE_APPCAST_URL}" - -#endif /* MUSESCORE_CONFIG_H */ diff --git a/config.cmake b/config.cmake deleted file mode 100644 index 7ac9274e98..0000000000 --- a/config.cmake +++ /dev/null @@ -1,71 +0,0 @@ -#============================================================================= -# MuseScore -# Linux Music Score Editor -# -# Copyright (C) 2002-2020 MuseScore BVBA and others -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#============================================================================= - -# The MuseScore version number. -SET(MUSESCORE_NAME "MuseScore") -SET(MUSESCORE_VERSION_MAJOR "4") -SET(MUSESCORE_VERSION_MINOR "1") -SET(MUSESCORE_VERSION_PATCH "0") -SET(MUSESCORE_VERSION_LABEL "") - -message(STATUS "MUSESCORE_BUILD_MODE ${MUSESCORE_BUILD_MODE}") -if (NOT MUSESCORE_BUILD_MODE) - SET(MUSESCORE_BUILD_MODE "dev") -endif() - -include(${CMAKE_CURRENT_LIST_DIR}/build/cmake/config/${MUSESCORE_BUILD_MODE}.cmake) - -SET(MUSESCORE_VERSION "${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR}") -# Version schema x.x.x is hardcoded in source -SET(MUSESCORE_VERSION_FULL "${MUSESCORE_VERSION}.${MUSESCORE_VERSION_PATCH}") - -if (MUSESCORE_LABEL) - set(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION} ${MUSESCORE_LABEL}") -endif() - -if (MSCORE_UNSTABLE) - set (MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION} (${MUSESCORE_VERSION_FULL} unstable)") -endif() - -# Set revision for local builds -# Before need run 'make revision' or 'msvc_build.bat revision' -include(${CMAKE_CURRENT_LIST_DIR}/build/cmake/TryUseLocalRevision.cmake) - -# Print variables which are needed by CI build scripts. -# STATUS mode makes message() command use stdout for its output. -message(STATUS "MSCORE_UNSTABLE ${MSCORE_UNSTABLE}") -message(STATUS "MSCORE_RELEASE_CHANNEL ${MSCORE_RELEASE_CHANNEL}") -message(STATUS "MUSESCORE_VERSION_FULL ${MUSESCORE_VERSION_FULL}") -if (MSCORE_UNSTABLE) - message(STATUS "VERSION ${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR}b-${MUSESCORE_REVISION}") -else() - message(STATUS "VERSION ${MUSESCORE_VERSION_FULL}") -endif() -message(STATUS "MUSESCORE_REVISION: ${MUSESCORE_REVISION}") - -if (APPLE) - SET(Mscore_INSTALL_NAME "Contents/Resources/") - SET(Mscore_SHARE_NAME "mscore.app/") -elseif (MSVC OR MINGW) - SET(Mscore_INSTALL_NAME "") - SET(Mscore_SHARE_NAME "./") -else() - SET(Mscore_INSTALL_NAME "mscore${MSCORE_INSTALL_SUFFIX}-${MUSESCORE_VERSION}/") - SET(Mscore_SHARE_NAME "share/") -endif() diff --git a/msvc_build.bat b/msvc_build.bat index a33bb5138d..480923e899 100644 --- a/msvc_build.bat +++ b/msvc_build.bat @@ -78,7 +78,7 @@ ECHO "BUILD_WIN_PORTABLE: %BUILD_WIN_PORTABLE%" IF "%BUILD_WIN_PORTABLE%"=="ON" ( SET "INSTALL_FOLDER=MuseScorePortable\App\MuseScore" SET "BUILD_AUTOUPDATE=OFF" - SET "WIN_PORTABLE_OPT=-DMUSESCORE_BUILD_CONFIGURE="app-portable" + SET "WIN_PORTABLE_OPT=-DMUSESCORE_BUILD_CONFIGURATION="app-portable" ) ECHO "INSTALL_FOLDER: %INSTALL_FOLDER%" diff --git a/ninja_build.sh b/ninja_build.sh index d856b22139..fe9d804895 100755 --- a/ninja_build.sh +++ b/ninja_build.sh @@ -23,8 +23,7 @@ TARGET=release MUSESCORE_INSTALL_DIR=${MUSESCORE_INSTALL_DIR:-"../build.install"} MUSESCORE_INSTALL_SUFFIX=${MUSESCORE_INSTALL_SUFFIX:-""} -MUSESCORE_LABEL=${MUSESCORE_LABEL:-""} -MUSESCORE_BUILD_CONFIGURE=${DMUSESCORE_BUILD_CONFIGURE:-"app"} +MUSESCORE_BUILD_CONFIGURATION=${DMUSESCORE_BUILD_CONFIGURATION:-"app"} MUSESCORE_BUILD_MODE=${MUSESCORE_BUILD_MODE:-"dev"} MUSESCORE_BUILD_NUMBER=${MUSESCORE_BUILD_NUMBER:-"12345678"} MUSESCORE_REVISION=${MUSESCORE_REVISION:-"abc123456"} @@ -69,9 +68,8 @@ function do_build() { cmake .. -GNinja \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ -DCMAKE_INSTALL_PREFIX="${MUSESCORE_INSTALL_DIR}" \ - -DMSCORE_INSTALL_SUFFIX="${MUSESCORE_INSTALL_SUFFIX}" \ - -DMUSESCORE_LABEL="${MUSESCORE_LABEL}" \ - -DMUSESCORE_BUILD_CONFIGURE="${MUSESCORE_BUILD_CONFIGURE}" \ + -DMUSESCORE_INSTALL_SUFFIX="${MUSESCORE_INSTALL_SUFFIX}" \ + -DMUSESCORE_BUILD_CONFIGURATION="${MUSESCORE_BUILD_CONFIGURATION}" \ -DMUSESCORE_BUILD_MODE="${MUSESCORE_BUILD_MODE}" \ -DCMAKE_BUILD_NUMBER="${MUSESCORE_BUILD_NUMBER}" \ -DMUSESCORE_REVISION="${MUSESCORE_REVISION}" \ @@ -145,7 +143,6 @@ case $TARGET in appimage) MUSESCORE_INSTALL_DIR=../MuseScore MUSESCORE_INSTALL_SUFFIX="4portable${MUSESCORE_INSTALL_SUFFIX}" # e.g. "4portable" or "4portablenightly" - MUSESCORE_LABEL="Portable AppImage" MUSESCORE_NO_RPATH=ON mkdir -p build.release diff --git a/sandbox/engraving/config.h b/sandbox/engraving/config.h index 4de82b62db..940b08d4c7 100644 --- a/sandbox/engraving/config.h +++ b/sandbox/engraving/config.h @@ -20,30 +20,7 @@ #ifndef MUSESCORE_CONFIG_H #define MUSESCORE_CONFIG_H -#define MSCORE_UNSTABLE - -/* #undef HAS_MIDI */ -/* #undef HAS_AUDIOFILE */ - -#define MUSESCORE_NAME_VERSION "MuseScore 4 (4.0.0 unstable)" -#define INSTALL_NAME "mscore-4.0/" -#define INSTPREFIX "/home/igor/Dev/MuseScore/build.debug/install" #define VERSION "4.0.0" -#define VERSION_LABEL "Development" -#define BUILD_NUMBER "" -#define SPARKLE_APPCAST_URL "" -/* #undef ENGRAVING_BUILD_ACCESSIBLE_TREE */ - -/* #undef OPENGL */ - - -/* #undef Q_WS_UIKIT */ - - -#define USE_BSP true - -// does not work on windows/mac: -//#define USE_GLYPHS true #endif /* MUSESCORE_CONFIG_H */ diff --git a/share/icons/CMakeLists.txt b/share/icons/CMakeLists.txt index 9dadd41df6..f196657103 100644 --- a/share/icons/CMakeLists.txt +++ b/share/icons/CMakeLists.txt @@ -42,12 +42,12 @@ elseif(OS_IS_WIN) elseif(OS_IS_LIN) foreach(SIZE 16 24 32 48 64 96 128 512) - install(FILES AppIcon/MS4_AppIcon_${SIZE}x${SIZE}.png RENAME mscore${MSCORE_INSTALL_SUFFIX}.png DESTINATION share/icons/hicolor/${SIZE}x${SIZE}/apps) + install(FILES AppIcon/MS4_AppIcon_${SIZE}x${SIZE}.png RENAME mscore${MUSESCORE_INSTALL_SUFFIX}.png DESTINATION share/icons/hicolor/${SIZE}x${SIZE}/apps) endforeach() - install(FILES MsczIcon/MS4_MsczIcon.png RENAME application-x-musescore${MSCORE_INSTALL_SUFFIX}.png + install(FILES MsczIcon/MS4_MsczIcon.png RENAME application-x-musescore${MUSESCORE_INSTALL_SUFFIX}.png DESTINATION share/icons/hicolor/512x512/mimetypes) - install(FILES MscxIcon/MS4_MscxIcon.png RENAME application-x-musescore${MSCORE_INSTALL_SUFFIX}+xml.png + install(FILES MscxIcon/MS4_MscxIcon.png RENAME application-x-musescore${MUSESCORE_INSTALL_SUFFIX}+xml.png DESTINATION share/icons/hicolor/512x512/mimetypes) # Note: Must now run "gtk-update-icon-cache" to set the new icons. diff --git a/src/appshell/appshell.cpp b/src/appshell/appshell.cpp index 8540033bfd..3ada430315 100644 --- a/src/appshell/appshell.cpp +++ b/src/appshell/appshell.cpp @@ -22,8 +22,6 @@ #include "appshell.h" -#include "config.h" - #include #include #include @@ -112,7 +110,7 @@ int AppShell::run(int argc, char** argv) #if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) && !defined(Q_OS_WASM) // Any OS that uses Freedesktop.org Desktop Entry Specification (e.g. Linux, BSD) - QGuiApplication::setDesktopFileName("org.musescore.MuseScore" INSTSUFFIX ".desktop"); + QGuiApplication::setDesktopFileName("org.musescore.MuseScore" MUSESCORE_INSTALL_SUFFIX ".desktop"); #endif // ==================================================== diff --git a/src/appshell/commandlinecontroller.cpp b/src/appshell/commandlinecontroller.cpp index bd5612b682..6c0e8572b4 100644 --- a/src/appshell/commandlinecontroller.cpp +++ b/src/appshell/commandlinecontroller.cpp @@ -23,7 +23,6 @@ #include "log.h" #include "global/muversion.h" -#include "config.h" using namespace mu::appshell; using namespace mu::framework; diff --git a/src/appshell/internal/appshellconfiguration.cpp b/src/appshell/internal/appshellconfiguration.cpp index 2f6bf27ddd..2d9fa5070d 100644 --- a/src/appshell/internal/appshellconfiguration.cpp +++ b/src/appshell/internal/appshellconfiguration.cpp @@ -24,7 +24,6 @@ #include #include -#include "config.h" #include "settings.h" #include "multiinstances/resourcelockguard.h" @@ -171,7 +170,7 @@ std::string AppShellConfiguration::musicXMLLicenseDeedUrl() const std::string AppShellConfiguration::museScoreVersion() const { - return VERSION + std::string(".") + BUILD_NUMBER; + return MUSESCORE_VERSION + std::string(".") + MUSESCORE_BUILD_NUMBER; } std::string AppShellConfiguration::museScoreRevision() const @@ -250,7 +249,7 @@ std::string AppShellConfiguration::utmParameters(const std::string& utmMedium) c { return "utm_source=desktop&utm_medium=" + utmMedium + "&utm_content=" + MUSESCORE_REVISION - + "&utm_campaign=MuseScore" + VERSION; + + "&utm_campaign=MuseScore" + MUSESCORE_VERSION; } std::string AppShellConfiguration::sha() const diff --git a/src/appshell/view/aboutmodel.cpp b/src/appshell/view/aboutmodel.cpp index 3a06435b2e..6a62640fe8 100644 --- a/src/appshell/view/aboutmodel.cpp +++ b/src/appshell/view/aboutmodel.cpp @@ -23,7 +23,6 @@ #include "translation.h" #include "muversion.h" -#include "config.h" #include #include @@ -92,8 +91,8 @@ void AboutModel::copyRevisionToClipboard() const .arg(QSysInfo::prettyProductName()) .arg(QSysInfo::currentCpuArchitecture()) .arg(QSysInfo::WordSize) - .arg(VERSION) - .arg(BUILD_NUMBER) + .arg(MUSESCORE_VERSION) + .arg(MUSESCORE_BUILD_NUMBER) .arg(MUSESCORE_REVISION)); } diff --git a/src/appshell/view/appmenumodel.cpp b/src/appshell/view/appmenumodel.cpp index d02077189f..215babcdda 100644 --- a/src/appshell/view/appmenumodel.cpp +++ b/src/appshell/view/appmenumodel.cpp @@ -23,7 +23,6 @@ #include "types/translatablestring.h" -#include "config.h" #include "log.h" using namespace mu::appshell; diff --git a/src/cloud/internal/cloudconfiguration.cpp b/src/cloud/internal/cloudconfiguration.cpp index 280473a561..ebba16c909 100644 --- a/src/cloud/internal/cloudconfiguration.cpp +++ b/src/cloud/internal/cloudconfiguration.cpp @@ -21,7 +21,6 @@ */ #include "cloudconfiguration.h" -#include "config.h" #include "settings.h" #include @@ -66,8 +65,8 @@ static QString userAgent() }; return QString("MS_EDITOR/%1.%2 (%3)") - .arg(VERSION) - .arg(BUILD_NUMBER) + .arg(MUSESCORE_VERSION) + .arg(MUSESCORE_BUILD_NUMBER) .arg(systemInfo.join(' ')).toLatin1(); } diff --git a/src/cloud/internal/cloudservice.cpp b/src/cloud/internal/cloudservice.cpp index 39b9ff49d3..3b4ce8a4fd 100644 --- a/src/cloud/internal/cloudservice.cpp +++ b/src/cloud/internal/cloudservice.cpp @@ -21,7 +21,6 @@ */ #include "cloudservice.h" -#include "config.h" #include #include @@ -53,7 +52,7 @@ static const QString REFRESH_TOKEN_KEY("refresh_token"); static const QString DEVICE_ID_KEY("device_id"); static const QString SCORE_ID_KEY("score_id"); static const QString EDITOR_SOURCE_KEY("editor_source"); -static const QString EDITOR_SOURCE_VALUE(QString("Musescore Editor %1").arg(VERSION)); +static const QString EDITOR_SOURCE_VALUE(QString("Musescore Editor %1").arg(MUSESCORE_VERSION)); static const QString PLATFORM_KEY("platform"); static const std::string CLOUD_ACCESS_TOKEN_RESOURCE_NAME("CLOUD_ACCESS_TOKEN"); diff --git a/src/context/internal/uicontextresolver.cpp b/src/context/internal/uicontextresolver.cpp index f8dad7c85a..b72cc92f99 100644 --- a/src/context/internal/uicontextresolver.cpp +++ b/src/context/internal/uicontextresolver.cpp @@ -24,7 +24,6 @@ #include "diagnostics/diagnosticutils.h" #include "shortcutcontext.h" -#include "config.h" #include "log.h" using namespace mu::context; diff --git a/src/diagnostics/diagnosticsmodule.cpp b/src/diagnostics/diagnosticsmodule.cpp index 70348bf803..8d0226737d 100644 --- a/src/diagnostics/diagnosticsmodule.cpp +++ b/src/diagnostics/diagnosticsmodule.cpp @@ -55,7 +55,6 @@ #include "devtools/crashhandlerdevtoolsmodel.h" #include "log.h" -#include "config.h" using namespace mu::diagnostics; using namespace mu::modularity; diff --git a/src/diagnostics/internal/drawdata/drawdatagenerator.cpp b/src/diagnostics/internal/drawdata/drawdatagenerator.cpp index 0a55feabf2..5e9dcb0d6d 100644 --- a/src/diagnostics/internal/drawdata/drawdatagenerator.cpp +++ b/src/diagnostics/internal/drawdata/drawdatagenerator.cpp @@ -33,7 +33,6 @@ #include "engraving/rw/scorereader.h" #include "engraving/libmscore/masterscore.h" -#include "config.h" #ifdef MUE_BUILD_IMPORTEXPORT_MODULE #include "importexport/guitarpro/internal/guitarproreader.h" #endif diff --git a/src/engraving/infrastructure/paint.cpp b/src/engraving/infrastructure/paint.cpp index 7a3b9e4fb0..60e41bb90b 100644 --- a/src/engraving/infrastructure/paint.cpp +++ b/src/engraving/infrastructure/paint.cpp @@ -29,7 +29,6 @@ #include "debugpaint.h" #include "log.h" -#include "config.h" using namespace mu::engraving; diff --git a/src/engraving/libmscore/mscore.cpp b/src/engraving/libmscore/mscore.cpp index 64c6ecbbef..97a9967885 100644 --- a/src/engraving/libmscore/mscore.cpp +++ b/src/engraving/libmscore/mscore.cpp @@ -31,8 +31,6 @@ #include "stafftype.h" #include "volta.h" -#include "config.h" - using namespace mu; namespace mu::engraving { diff --git a/src/engraving/libmscore/page.cpp b/src/engraving/libmscore/page.cpp index 7c9a4b9e7a..979875d7ae 100644 --- a/src/engraving/libmscore/page.cpp +++ b/src/engraving/libmscore/page.cpp @@ -475,7 +475,7 @@ String Page::replaceTextMacros(const String& s) const break; case 'v': if (score()->dirty()) { - d += String::fromAscii(VERSION); + d += String::fromAscii(MUSESCORE_VERSION); } else { d += score()->mscoreVersion(); } diff --git a/src/engraving/libmscore/score.cpp b/src/engraving/libmscore/score.cpp index 546036d3b7..1b2341d2d6 100644 --- a/src/engraving/libmscore/score.cpp +++ b/src/engraving/libmscore/score.cpp @@ -98,8 +98,6 @@ #include "accessibility/accessibleroot.h" #endif -#include "config.h" - #include "log.h" using namespace mu; diff --git a/src/engraving/libmscore/scorefile.cpp b/src/engraving/libmscore/scorefile.cpp index 551db89436..e8c86c2346 100644 --- a/src/engraving/libmscore/scorefile.cpp +++ b/src/engraving/libmscore/scorefile.cpp @@ -54,7 +54,6 @@ #include "utils.h" #include "log.h" -#include "config.h" using namespace mu; using namespace mu::io; @@ -375,7 +374,7 @@ bool Score::writeScore(io::IODevice* f, bool msczFormat, bool onlySelection, com xml.startElement("museScore", { { "version", MSC_VERSION } }); if (!MScore::testMode) { - xml.tag("programVersion", VERSION); + xml.tag("programVersion", MUSESCORE_VERSION); xml.tag("programRevision", MUSESCORE_REVISION); } write(xml, onlySelection, hook); @@ -384,7 +383,7 @@ bool Score::writeScore(io::IODevice* f, bool msczFormat, bool onlySelection, com if (!onlySelection) { //update version values for i.e. plugin access - _mscoreVersion = String::fromAscii(VERSION); + _mscoreVersion = String::fromAscii(MUSESCORE_VERSION); _mscoreRevision = AsciiStringView(MUSESCORE_REVISION).toInt(nullptr, 16); _mscVersion = MSCVERSION; } diff --git a/src/engraving/libmscore/utils.cpp b/src/engraving/libmscore/utils.cpp index 3fba87b211..37c9afcec1 100644 --- a/src/engraving/libmscore/utils.cpp +++ b/src/engraving/libmscore/utils.cpp @@ -30,7 +30,6 @@ #include "chord.h" #include "chordrest.h" #include "clef.h" -#include "config.h" #include "measure.h" #include "note.h" #include "page.h" diff --git a/src/engraving/style/styledef.h b/src/engraving/style/styledef.h index cd3ce92d8d..8d7479c37c 100644 --- a/src/engraving/style/styledef.h +++ b/src/engraving/style/styledef.h @@ -29,7 +29,6 @@ #include "types/string.h" #include "types/propertyvalue.h" #include "libmscore/property.h" -#include "config.h" namespace mu::engraving { // Needs to be duplicated here and in symid.h since moc doesn't handle macros from #include'd files diff --git a/src/framework/accessibility/internal/accessibilityconfiguration.cpp b/src/framework/accessibility/internal/accessibilityconfiguration.cpp index 9beab1cee5..0d093757f0 100644 --- a/src/framework/accessibility/internal/accessibilityconfiguration.cpp +++ b/src/framework/accessibility/internal/accessibilityconfiguration.cpp @@ -23,8 +23,6 @@ #include -#include "config.h" - using namespace mu::accessibility; class AccessibilityActivationObserver : public QAccessible::ActivationObserver diff --git a/src/framework/audio/internal/worker/audiooutputhandler.cpp b/src/framework/audio/internal/worker/audiooutputhandler.cpp index 9bed24c7a8..3079b04ff7 100644 --- a/src/framework/audio/internal/worker/audiooutputhandler.cpp +++ b/src/framework/audio/internal/worker/audiooutputhandler.cpp @@ -22,8 +22,6 @@ #include "audiooutputhandler.h" -#include "config.h" - #include "async/async.h" #include "containers.h" diff --git a/src/framework/draw/bufferedpaintprovider.cpp b/src/framework/draw/bufferedpaintprovider.cpp index fd44d0705b..63b034f201 100644 --- a/src/framework/draw/bufferedpaintprovider.cpp +++ b/src/framework/draw/bufferedpaintprovider.cpp @@ -23,7 +23,6 @@ #include "utils/drawlogger.h" #include "log.h" -#include "config.h" using namespace mu; using namespace mu::draw; diff --git a/src/framework/draw/painter.h b/src/framework/draw/painter.h index 906ea4e911..ed0fcba4c3 100644 --- a/src/framework/draw/painter.h +++ b/src/framework/draw/painter.h @@ -25,7 +25,6 @@ #include #include -#include "config.h" #include "ipaintprovider.h" #include "types/string.h" diff --git a/src/framework/global/allocator.cpp b/src/framework/global/allocator.cpp index e55c8aff6e..4944ea67f9 100644 --- a/src/framework/global/allocator.cpp +++ b/src/framework/global/allocator.cpp @@ -30,7 +30,7 @@ using namespace mu; -int ObjectAllocator::__used = 0; +int ObjectAllocator::s_used = 0; size_t ObjectAllocator::DEFAULT_BLOCK_SIZE(1024 * 256); // 256 kB static inline size_t align(size_t n) @@ -44,14 +44,14 @@ static inline size_t align(size_t n) void ObjectAllocator::used() { #ifdef MUE_ENABLE_CUSTOM_ALLOCATOR - __used++; + s_used++; #endif } void ObjectAllocator::unused() { #ifdef MUE_ENABLE_CUSTOM_ALLOCATOR - __used--; + s_used--; #endif } diff --git a/src/framework/global/allocator.h b/src/framework/global/allocator.h index 415f85727b..d802749f87 100644 --- a/src/framework/global/allocator.h +++ b/src/framework/global/allocator.h @@ -104,11 +104,11 @@ public: Info stateInfo() const; - static bool enabled() { return __used; } + static bool enabled() { return s_used; } static void used(); static void unused(); - static int __used; + static int s_used; private: struct Chunk { diff --git a/src/framework/global/globalmodule.cpp b/src/framework/global/globalmodule.cpp index 69624c4849..75c4c2b455 100644 --- a/src/framework/global/globalmodule.cpp +++ b/src/framework/global/globalmodule.cpp @@ -28,7 +28,6 @@ #include "logremover.h" #include "thirdparty/haw_logger/logger/logdefdest.h" #include "muversion.h" -#include "config.h" #include "internal/application.h" #include "internal/interactive.h" @@ -45,8 +44,6 @@ #include "diagnostics/idiagnosticspathsregister.h" -#include "config.h" - using namespace mu::framework; using namespace mu::modularity; using namespace mu::io; @@ -112,7 +109,7 @@ void GlobalModule::onPreInit(const IApplication::RunMode& mode) #endif LOGI() << "log path: " << logFile->filePath(); - LOGI() << "=== Started MuseScore " << framework::MUVersion::fullVersion() << ", build number " << BUILD_NUMBER << " ==="; + LOGI() << "=== Started MuseScore " << framework::MUVersion::fullVersion() << ", build number " << MUSESCORE_BUILD_NUMBER << " ==="; //! --- Setup profiler --- using namespace haw::profiler; diff --git a/src/framework/global/internal/globalconfiguration.cpp b/src/framework/global/internal/globalconfiguration.cpp index c17dc19988..ea1a99a871 100644 --- a/src/framework/global/internal/globalconfiguration.cpp +++ b/src/framework/global/internal/globalconfiguration.cpp @@ -26,7 +26,6 @@ #include #include -#include "config.h" #include "settings.h" #include "muversion.h" #include "log.h" @@ -61,7 +60,7 @@ io::path_t GlobalConfiguration::appDataPath() const QString GlobalConfiguration::resolveAppDataPath() const { #ifdef Q_OS_WIN - QDir dir(QCoreApplication::applicationDirPath() + QString("/../" INSTALL_NAME)); + QDir dir(QCoreApplication::applicationDirPath() + QString("/../" MUSESCORE_INSTALL_NAME)); return dir.absolutePath() + "/"; #elif defined(Q_OS_MAC) QDir dir(QCoreApplication::applicationDirPath() + QString("/../Resources")); @@ -70,12 +69,12 @@ QString GlobalConfiguration::resolveAppDataPath() const return "/files/share"; #else // Try relative path (needed for portable AppImage and non-standard installations) - QDir dir(QCoreApplication::applicationDirPath() + QString("/../share/" INSTALL_NAME)); + QDir dir(QCoreApplication::applicationDirPath() + QString("/../share/" MUSESCORE_INSTALL_NAME)); if (dir.exists()) { return dir.absolutePath() + "/"; } // Otherwise fall back to default location (e.g. if binary has moved relative to share) - return QString(INSTPREFIX "/share/" INSTALL_NAME); + return QString(MUSESCORE_INSTALL_PREFIX "/share/" MUSESCORE_INSTALL_NAME); #endif } diff --git a/src/framework/global/muversion.cpp b/src/framework/global/muversion.cpp index c60aa4c34e..7fc85c34ad 100644 --- a/src/framework/global/muversion.cpp +++ b/src/framework/global/muversion.cpp @@ -23,14 +23,11 @@ #include "types/version.h" -#include "config.h" -#include "log.h" - using namespace mu::framework; bool MUVersion::unstable() { -#ifdef MSCORE_UNSTABLE +#ifdef MUSESCORE_UNSTABLE return true; #else return false; @@ -39,14 +36,14 @@ bool MUVersion::unstable() mu::String MUVersion::version() { - return String::fromStdString(VERSION); + return String::fromStdString(MUSESCORE_VERSION); } mu::String MUVersion::fullVersion() { Version res(version()); - String versionLabel = String::fromStdString(VERSION_LABEL); + String versionLabel = String::fromStdString(MUSESCORE_VERSION_LABEL); if (!versionLabel.isEmpty()) { res.setSuffix(versionLabel); } diff --git a/src/framework/global/muversion.h b/src/framework/global/muversion.h index 25937c69a0..1f44ba6dc9 100644 --- a/src/framework/global/muversion.h +++ b/src/framework/global/muversion.h @@ -22,7 +22,7 @@ #ifndef MU_FRAMEWORK_MUVERSION_H #define MU_FRAMEWORK_MUVERSION_H -#include "types/version.h" +#include "types/string.h" namespace mu::framework { class MUVersion diff --git a/src/framework/global/settings.cpp b/src/framework/global/settings.cpp index 90f5884d92..88f0fe6731 100644 --- a/src/framework/global/settings.cpp +++ b/src/framework/global/settings.cpp @@ -21,7 +21,6 @@ */ #include "settings.h" -#include "config.h" #include "log.h" #include diff --git a/src/framework/global/tests/allocator_tests.cpp b/src/framework/global/tests/allocator_tests.cpp index f097559340..b278a955fb 100644 --- a/src/framework/global/tests/allocator_tests.cpp +++ b/src/framework/global/tests/allocator_tests.cpp @@ -82,7 +82,7 @@ public: void SetUp() override { - ObjectAllocator::__used++; + ObjectAllocator::s_used++; } }; diff --git a/src/framework/testing/gtest.cmake b/src/framework/testing/gtest.cmake index de14a7e76b..8836ec8d3d 100644 --- a/src/framework/testing/gtest.cmake +++ b/src/framework/testing/gtest.cmake @@ -28,7 +28,7 @@ # After all the settings you need to do: # include(${PROJECT_SOURCE_DIR}/framework/testing/gtest.cmake) -message(STATUS "Configuring ${MODULE_TEST} (gtest)") +message(STATUS "Configuring ${MODULE_TEST}") get_property(gmock_LIBS GLOBAL PROPERTY gmock_LIBS) get_property(gmock_INCLUDE_DIRS GLOBAL PROPERTY gmock_INCLUDE_DIRS) diff --git a/src/framework/ui/internal/navigationcontroller.cpp b/src/framework/ui/internal/navigationcontroller.cpp index 7ed876b911..f9f087619c 100644 --- a/src/framework/ui/internal/navigationcontroller.cpp +++ b/src/framework/ui/internal/navigationcontroller.cpp @@ -34,8 +34,6 @@ #include "defer.h" #include "log.h" -#include "config.h" - // #define NAVIGATION_LOGGING_ENABLED #ifdef NAVIGATION_LOGGING_ENABLED diff --git a/src/framework/ui/internal/uiengine.cpp b/src/framework/ui/internal/uiengine.cpp index ed4d5a8fa8..6811dd747b 100644 --- a/src/framework/ui/internal/uiengine.cpp +++ b/src/framework/ui/internal/uiengine.cpp @@ -28,7 +28,6 @@ #include #include -#include "config.h" #include "log.h" using namespace mu::ui; diff --git a/src/framework/uicomponents/view/popupview.cpp b/src/framework/uicomponents/view/popupview.cpp index c3458d379c..b71d0988ac 100644 --- a/src/framework/uicomponents/view/popupview.cpp +++ b/src/framework/uicomponents/view/popupview.cpp @@ -41,7 +41,6 @@ #endif #include "log.h" -#include "config.h" using namespace mu::uicomponents; diff --git a/src/importexport/capella/capellamodule.cpp b/src/importexport/capella/capellamodule.cpp index 8b301a6502..ef8014ed9f 100644 --- a/src/importexport/capella/capellamodule.cpp +++ b/src/importexport/capella/capellamodule.cpp @@ -22,7 +22,6 @@ #include "capellamodule.h" #include "log.h" -#include "config.h" #include "modularity/ioc.h" #include "project/inotationreadersregister.h" diff --git a/src/importexport/imagesexport/internal/pdfwriter.cpp b/src/importexport/imagesexport/internal/pdfwriter.cpp index 99172218db..4e968827a0 100644 --- a/src/importexport/imagesexport/internal/pdfwriter.cpp +++ b/src/importexport/imagesexport/internal/pdfwriter.cpp @@ -120,7 +120,7 @@ mu::Ret PdfWriter::writeList(const INotationPtrList& notations, QIODevice& desti void PdfWriter::preparePdfWriter(QPdfWriter& pdfWriter, const QString& title, const QSizeF& size) const { pdfWriter.setResolution(configuration()->exportPdfDpiResolution()); - pdfWriter.setCreator("MuseScore Version: " VERSION); + pdfWriter.setCreator("MuseScore Version: " MUSESCORE_VERSION); pdfWriter.setTitle(title); pdfWriter.setPageMargins(QMarginsF()); pdfWriter.setPageLayout(QPageLayout(QPageSize(size, QPageSize::Inch), QPageLayout::Orientation::Portrait, QMarginsF())); diff --git a/src/importexport/imagesexport/internal/svggenerator.cpp b/src/importexport/imagesexport/internal/svggenerator.cpp index 7cda485e82..e1b973cc36 100644 --- a/src/importexport/imagesexport/internal/svggenerator.cpp +++ b/src/importexport/imagesexport/internal/svggenerator.cpp @@ -157,7 +157,7 @@ public: resolution = mu::engraving::DPI; attributes.title = QLatin1String("MuseScore SVG Document"); - attributes.description = QString("Generated by MuseScore %1").arg(VERSION); + attributes.description = QString("Generated by MuseScore %1").arg(MUSESCORE_VERSION); // UNUSED // attributes.font_family = QLatin1String("serif"); // attributes.font_size = QLatin1String("10pt"); diff --git a/src/importexport/musicxml/internal/musicxml/exportxml.cpp b/src/importexport/musicxml/internal/musicxml/exportxml.cpp index 9afb3df4d8..9dc1eca5c2 100644 --- a/src/importexport/musicxml/internal/musicxml/exportxml.cpp +++ b/src/importexport/musicxml/internal/musicxml/exportxml.cpp @@ -129,7 +129,6 @@ #include "../../imusicxmlconfiguration.h" #include "engraving/iengravingconfiguration.h" -#include "config.h" #include "log.h" using namespace mu; @@ -5978,7 +5977,7 @@ void ExportMusicXml::identification(XmlWriter& xml, Score const* const score) xml.tag("software", QString("MuseScore 0.7.0")); xml.tag("encoding-date", QString("2007-09-10")); } else { - xml.tag("software", QString("MuseScore ") + QString(VERSION)); + xml.tag("software", QString("MuseScore ") + QString(MUSESCORE_VERSION)); xml.tag("encoding-date", QDate::currentDate().toString(Qt::ISODate)); } diff --git a/src/importexport/musicxml/musicxmlmodule.cpp b/src/importexport/musicxml/musicxmlmodule.cpp index fb520ba115..351022405b 100644 --- a/src/importexport/musicxml/musicxmlmodule.cpp +++ b/src/importexport/musicxml/musicxmlmodule.cpp @@ -22,7 +22,6 @@ #include "musicxmlmodule.h" #include "log.h" -#include "config.h" #include "modularity/ioc.h" #include "project/inotationreadersregister.h" diff --git a/src/learn/internal/learnconfiguration.cpp b/src/learn/internal/learnconfiguration.cpp index b45b86ef11..9064ddb3f5 100644 --- a/src/learn/internal/learnconfiguration.cpp +++ b/src/learn/internal/learnconfiguration.cpp @@ -23,8 +23,6 @@ #include -#include "config.h" - using namespace mu::learn; using namespace mu::network; diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 86150ae974..2a4d2faf10 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -54,9 +54,9 @@ if (OS_IS_WIN) elseif(OS_IS_LIN) - if (MSCORE_INSTALL_SUFFIX) - set(MSCORE_OUTPUT_NAME "${EXECUTABLE_NAME}${MSCORE_INSTALL_SUFFIX}") - endif(MSCORE_INSTALL_SUFFIX) + if (MUSESCORE_INSTALL_SUFFIX) + set(MSCORE_OUTPUT_NAME "${EXECUTABLE_NAME}${MUSESCORE_INSTALL_SUFFIX}") + endif(MUSESCORE_INSTALL_SUFFIX) set(CMAKE_INSTALL_RPATH "${QT_INSTALL_LIBS}") if (BUILD_SHARED_LIBS) @@ -373,10 +373,10 @@ elseif(OS_IS_LIN) if (LN_EXECUTABLE) add_custom_target(mscore_alias ALL COMMAND echo "Creating symlink alias for mscore executable." - COMMAND ${LN_EXECUTABLE} -sf "mscore${MSCORE_INSTALL_SUFFIX}" "musescore${MSCORE_INSTALL_SUFFIX}" - COMMAND echo 'Symlink alias: musescore${MSCORE_INSTALL_SUFFIX} -> mscore${MSCORE_INSTALL_SUFFIX}' + COMMAND ${LN_EXECUTABLE} -sf "mscore${MUSESCORE_INSTALL_SUFFIX}" "musescore${MUSESCORE_INSTALL_SUFFIX}" + COMMAND echo 'Symlink alias: musescore${MUSESCORE_INSTALL_SUFFIX} -> mscore${MUSESCORE_INSTALL_SUFFIX}' ) - install(FILES ${PROJECT_BINARY_DIR}/src/main/musescore${MSCORE_INSTALL_SUFFIX} DESTINATION bin) + install(FILES ${PROJECT_BINARY_DIR}/src/main/musescore${MUSESCORE_INSTALL_SUFFIX} DESTINATION bin) else (LN_EXECUTABLE) add_custom_target(mscore_alias ALL COMMAND echo "No symlink aliases will be created." VERBATIM ) endif (LN_EXECUTABLE) diff --git a/src/main/main.cpp b/src/main/main.cpp index 4a6e656e05..c5655d086a 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -22,7 +22,6 @@ #include -#include "config.h" #include "runtime.h" #include "log.h" diff --git a/src/notation/internal/notationinteraction.cpp b/src/notation/internal/notationinteraction.cpp index 6b8c7da2ca..fdcc7135ff 100644 --- a/src/notation/internal/notationinteraction.cpp +++ b/src/notation/internal/notationinteraction.cpp @@ -1589,14 +1589,6 @@ bool NotationInteraction::applyPaletteElement(mu::engraving::EngravingItem* elem return false; } -//#ifdef MSCORE_UNSTABLE -// if (ScriptRecorder* rec = adapter()->getScriptRecorder()) { -// if (modifiers == 0) { -// rec->recordPaletteElement(element); -// } -// } -//#endif - startEdit(); if (sel.isList()) { diff --git a/src/palette/palettemodule.cpp b/src/palette/palettemodule.cpp index e05b7fc478..c0c7ac3b63 100644 --- a/src/palette/palettemodule.cpp +++ b/src/palette/palettemodule.cpp @@ -25,7 +25,6 @@ #include "log.h" -#include "config.h" #include "modularity/ioc.h" #include "ui/iuiengine.h" #include "ui/iinteractiveuriregister.h" diff --git a/src/plugins/api/util.cpp b/src/plugins/api/util.cpp index 199c79442d..7cbacfe2d9 100644 --- a/src/plugins/api/util.cpp +++ b/src/plugins/api/util.cpp @@ -22,7 +22,6 @@ #include -#include "config.h" #include "util.h" #include "score.h" diff --git a/src/stubs/framework/CMakeLists.txt b/src/stubs/framework/CMakeLists.txt index b7359310fa..3d19c0cbfd 100644 --- a/src/stubs/framework/CMakeLists.txt +++ b/src/stubs/framework/CMakeLists.txt @@ -30,8 +30,6 @@ if (NOT MUE_BUILD_SHORTCUTS_MODULE) add_subdirectory(shortcuts) endif() - - -if (NOT BUILD_VST_MODULE) +if (NOT MUE_BUILD_VST_MODULE) add_subdirectory(vst) -endif (NOT BUILD_VST_MODULE) +endif() diff --git a/src/update/internal/updateconfiguration.cpp b/src/update/internal/updateconfiguration.cpp index ab961a50bc..b2bcdb5fa3 100644 --- a/src/update/internal/updateconfiguration.cpp +++ b/src/update/internal/updateconfiguration.cpp @@ -21,7 +21,6 @@ */ #include "updateconfiguration.h" -#include "config.h" #include "settings.h" using namespace mu::update; @@ -50,7 +49,7 @@ static QString userAgent() QString cpuArchitecture = QSysInfo::currentCpuArchitecture(); return QString("Musescore/%1 (%2 %3; %4)") - .arg(VERSION, osName, osVersion, cpuArchitecture); + .arg(MUSESCORE_VERSION, osName, osVersion, cpuArchitecture); } void UpdateConfiguration::init() diff --git a/src/update/internal/updatescenario.cpp b/src/update/internal/updatescenario.cpp index dc5c08ecf3..44d12c5245 100644 --- a/src/update/internal/updatescenario.cpp +++ b/src/update/internal/updatescenario.cpp @@ -28,7 +28,6 @@ #include "updateerrors.h" #include "translation.h" -#include "config.h" #include "defer.h" #include "log.h" diff --git a/src/update/internal/updateservice.cpp b/src/update/internal/updateservice.cpp index 3efad83c79..05a52e8200 100644 --- a/src/update/internal/updateservice.cpp +++ b/src/update/internal/updateservice.cpp @@ -34,7 +34,6 @@ #include "muversion.h" #include "translation.h" -#include "config.h" #include "log.h" using namespace mu::update; diff --git a/tools/check_build_without_qt/CMakeLists.txt b/tools/check_build_without_qt/CMakeLists.txt index 18e5113efa..5f5d0ea493 100644 --- a/tools/check_build_without_qt/CMakeLists.txt +++ b/tools/check_build_without_qt/CMakeLists.txt @@ -4,10 +4,6 @@ project(engraving_app LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) -#set(CMAKE_AUTOUIC ON) -#set(CMAKE_AUTOMOC ON) -#set(CMAKE_AUTORCC ON) - set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -23,18 +19,7 @@ set(CMAKE_MODULE_PATH include(SetupBuildEnvironment) include(GetPlatformInfo) -set(QT_MIN_VERSION "5.15.0") -#find_package(Qt5Core ${QT_MIN_VERSION} REQUIRED) -#find_package(Qt5Gui ${QT_MIN_VERSION} REQUIRED) - -set(QT_LIBRARIES -# Qt5::Core -# Qt5::Gui -) - include_directories( -# ${Qt5Core_INCLUDE_DIRS} -# ${Qt5Gui_INCLUDE_DIRS} ${CMAKE_CURRENT_LIST_DIR} ${MU_ROOT}/thirdparty/dtl ) @@ -44,7 +29,14 @@ set(THIRDPARTY_DIR ${MU_ROOT}/thirdparty) add_definitions( -DNO_QT_SUPPORT -DGLOBAL_NO_INTERNAL - #-DHAW_LOGGER_QT_SUPPORT + + -DMUSESCORE_REVISION="abc123" + -DMUSESCORE_BUILD_NUMBER="123456" + -DMUSESCORE_VERSION="4.0.0" + -DMUSESCORE_VERSION_LABEL="dev" + -DMUSESCORE_INSTALL_SUFFIX="" + -DMUSESCORE_INSTALL_PREFIX="" + -DMUSESCORE_INSTALL_NAME="" ) set(GLOBAL_NO_INTERNAL ON) diff --git a/tools/check_build_without_qt/config.h b/tools/check_build_without_qt/config.h deleted file mode 100644 index 02b056a29d..0000000000 --- a/tools/check_build_without_qt/config.h +++ /dev/null @@ -1,51 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// -// Copyright (C) 2002-2010 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#ifndef MUSESCORE_CONFIG_H -#define MUSESCORE_CONFIG_H - -#define MSCORE_UNSTABLE - -/* #undef HAS_MIDI */ -// #define SCRIPT_INTERFACE -/* #undef HAS_AUDIOFILE */ - -#define MUSESCORE_NAME_VERSION "MuseScore 4 (4.0.0 unstable)" -#define INSTALL_NAME "mscore-4.0/" -#define INSTPREFIX "/home/igor/Dev/MuseScore/build.debug/install" -#define VERSION "4.0.0" -#define VERSION_LABEL "Development" -#define BUILD_NUMBER "" -#define SPARKLE_APPCAST_URL "" - - -/* #undef ENGRAVING_BUILD_ACCESSIBLE_TREE */ - -/* #undef OPENGL */ - - -/* #undef Q_WS_UIKIT */ - - -#define USE_BSP true - -// does not work on windows/mac: -//#define USE_GLYPHS true - -#endif /* MUSESCORE_CONFIG_H */ diff --git a/version.cmake b/version.cmake new file mode 100644 index 0000000000..bfc06450c0 --- /dev/null +++ b/version.cmake @@ -0,0 +1,43 @@ +#============================================================================= +# MuseScore +# Linux Music Score Editor +# +# Copyright (C) 2002-2020 MuseScore BVBA and others +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#============================================================================= + +set(MUSESCORE_NAME "MuseScore") +set(MUSESCORE_VERSION_MAJOR "4") +set(MUSESCORE_VERSION_MINOR "1") +set(MUSESCORE_VERSION_PATCH "0") +set(MUSESCORE_VERSION "${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR}") +set(MUSESCORE_VERSION_FULL "${MUSESCORE_VERSION}.${MUSESCORE_VERSION_PATCH}") +set(MUSESCORE_VERSION_LABEL "") + +if(MUSESCORE_BUILD_MODE MATCHES "dev") + set(MUSESCORE_RELEASE_CHANNEL "devel") +endif() + +if(MUSESCORE_BUILD_MODE MATCHES "testing") + set(MUSESCORE_RELEASE_CHANNEL "testing") +endif() + +if(MUSESCORE_BUILD_MODE MATCHES "release") + set(MUSESCORE_RELEASE_CHANNEL "stable") +endif() + +# Print variables which are needed by CI build scripts. +message(STATUS "MUSESCORE_RELEASE_CHANNEL ${MUSESCORE_RELEASE_CHANNEL}") +message(STATUS "MUSESCORE_VERSION_FULL ${MUSESCORE_VERSION_FULL}") + diff --git a/vtest/build.sh b/vtest/build.sh index e8724bcc1f..74ca8de55f 100644 --- a/vtest/build.sh +++ b/vtest/build.sh @@ -33,5 +33,5 @@ mkdir -p $INSTALL_DIR bash $HERE/../ninja_build.sh -t clean MUSESCORE_INSTALL_DIR=$INSTALL_DIR \ -MUSESCORE_BUILD_CONFIGURE="vtest" \ +MUSESCORE_BUILD_CONFIGURATION="vtest" \ bash ninja_build.sh -t installdebug \ No newline at end of file