MuseScore/CMakeLists.txt

822 lines
32 KiB
CMake
Raw Normal View History

2012-05-26 14:49:10 +02:00
#=============================================================================
2016-06-10 10:37:53 +02:00
# MuseScore
2012-05-26 14:49:10 +02:00
# Linux Music Score Editor
#
2016-06-10 10:37:53 +02:00
# Copyright (C) 2002-2016 by Werner Schweer and others
2012-05-26 14:49:10 +02:00
#
# 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.
#=============================================================================
project(mscore)
2016-06-10 10:37:53 +02:00
# Minimum tested, report if it works with older
2016-04-12 19:44:31 +02:00
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
2015-04-15 10:14:06 +02:00
set (CI $ENV{CI})
if (CI)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif (CI)
# Libraries linked via full path no longer produce linker search paths.
2012-05-26 14:49:10 +02:00
cmake_policy(SET CMP0003 NEW)
2013-07-11 23:18:17 +02:00
2018-06-27 15:37:05 +02:00
# Apperently needed on Mac only (?)
if (APPLE)
# Issue no warning non-existent target argument to get_targer_property()
# and set the result variable to a -NOTFOUND value rather than issuing a FATAL_ERROR 40
if(POLICY CMP0045)
cmake_policy(SET CMP0045 OLD)
endif(POLICY CMP0045)
# Silently ignore non-existent dependencies (mops1, mops2)
if(POLICY CMP0046)
cmake_policy(SET CMP0046 OLD)
endif(POLICY CMP0046)
endif (APPLE)
# RPATH settings on macOS do not affect install_name
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif(POLICY CMP0068)
# Don't process generated source files with AUTOMOC
if(POLICY CMP0071)
cmake_policy(SET CMP0071 OLD)
endif(POLICY CMP0071)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
# Define MINGW for VS, as it appears not to be defined
if (MSVC)
set (MINGW false)
endif (MSVC)
2016-06-10 10:37:53 +02:00
# Look for Qt5
2017-05-08 16:48:03 +02:00
SET(QT_MIN_VERSION "5.8.0")
2016-06-10 10:37:53 +02:00
# Include modules
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build" ${CMAKE_MODULE_PATH})
include (FindQt5)
2016-06-10 10:37:53 +02:00
include (UsePkgConfig1) # Defines MACRO(PKGCONFIG1 _package _minVersion _include_DIR _link_DIR _link_FLAGS _cflags)
include (FindPulseAudio)
include (GetCompilerVersion)
2013-03-12 11:42:10 +01:00
include (CreatePrecompiledHeader)
2016-06-10 10:37:53 +02:00
# For debugging the make system uncomment next line:
# set(CMAKE_VERBOSE_MAKEFILE ON)
2012-05-26 14:49:10 +02:00
2016-06-10 10:37:53 +02:00
set(CMAKE_AUTOMOC TRUE)
set(MSCORE_UNSTABLE TRUE) # Mark as unstable
2012-05-26 14:49:10 +02:00
set(USE_SSE TRUE)
2012-07-09 14:50:03 +02:00
set(SCRIPT_INTERFACE TRUE)
2012-05-26 14:49:10 +02:00
# Disable components not supported on Windows
if (MSVC OR MINGW)
2016-06-10 10:37:53 +02:00
set(WIN_NOT_AVAIL "Not available on Windows")
option(BUILD_PULSEAUDIO ${WIN_NOT_AVAIL} OFF)
option(BUILD_ALSA ${WIN_NOT_AVAIL} OFF)
endif (MSVC OR MINGW)
# Disable components not supported on Mac
if (APPLE)
2016-06-10 10:37:53 +02:00
set(MAC_NOT_AVAIL "Not available on Mac")
option(BUILD_PULSEAUDIO ${MAC_NOT_AVAIL} OFF)
option(BUILD_ALSA ${MAC_NOT_AVAIL} OFF)
endif (APPLE)
# Disable components not supported on Linux/BSD
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (NOT APPLE AND NOT MINGW AND NOT MSVC)
2016-06-10 10:37:53 +02:00
set(NIX_NOT_AVAIL "Not available on Linux/BSD")
2017-05-14 17:43:28 +02:00
#option(BUILD_PORTMIDI "PortMidi disabled on Linux. (It uses ALSA but it's better to use ALSA directly)" OFF)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (NOT APPLE AND NOT MINGW AND NOT MSVC)
2016-06-10 10:37:53 +02:00
option(AEOLUS "Enable pipe organ synthesizer" OFF)
option(ZERBERUS "Enable experimental SFZ sampler" ON)
option(OSC "Enable OSC remote control protocol" ON)
option(OMR "Enable PDF import" ON) # OMR - optical music recognition
# For installation see: http://ubuntuforums.org/showthread.php?t=1647350
option(OCR "Enable OCR, requires OMR" OFF) # Requires tesseract 3.0, needs work on mac/win
option(SOUNDFONT3 "Ogg Vorbis compressed fonts" ON) # Enable Ogg Vorbis compressed fonts, requires Ogg & Vorbis
option(HAS_AUDIOFILE "Enable audio export" ON) # Requires libsndfile
2013-03-12 11:42:10 +01:00
option(USE_SYSTEM_QTSINGLEAPPLICATION "Use system QtSingleApplication" OFF)
option(USE_SYSTEM_FREETYPE "Use system FreeType" OFF) # requires freetype >= 2.5.2, does not work on win
2016-06-10 10:37:53 +02:00
option(BUILD_LAME "Enable MP3 export" ON) # Requires libmp3lame (non-free), call CMake with -DBUILD_LAME="OFF" to disable
option(DOWNLOAD_SOUNDFONT "Download the latest soundfont version as part of the build process" ON)
2012-05-26 14:49:10 +02:00
2016-06-10 10:37:53 +02:00
SET(JACK_LONGNAME "JACK (Jack Audio Connection Kit)")
2013-03-12 11:42:10 +01:00
SET(JACK_MIN_VERSION "0.98.0")
2016-06-10 10:37:53 +02:00
option(BUILD_JACK "Build with support for ${JACK_LONGNAME} audio backend. JACK >= ${JACK_MIN_VERSION} will be needed." ON)
option(BUILD_PULSEAUDIO "Build with support for PulseAudio audio backend." ON)
option(BUILD_ALSA "Build with support for ALSA audio backend." ON)
2016-06-10 10:37:53 +02:00
option(BUILD_PORTAUDIO "Build with support for PortAudio audio backend." ON)
2016-08-09 00:25:42 +02:00
option(BUILD_PORTMIDI "Build with support for PortAudio's MIDI features." ${BUILD_PORTAUDIO}) # PortAudio required
option(BUILD_WEBEBENGINE "Built in webkit support" ON)
2017-03-10 15:49:25 +01:00
option(BUILD_PCH "Build using precompiled headers." ON)
option(BUILD_FOR_WINSTORE "Build for the Windows Store." OFF)
option(COVERAGE "Build with instrumentation to record code coverage." OFF)
2012-05-26 14:49:10 +02:00
if (APPLE)
set (CMAKE_CXX_COMPILER clang++)
2013-02-13 22:01:48 +01:00
set (CMAKE_CXX_COMPILER_ID "Clang")
2012-05-26 14:49:10 +02:00
# Currently, just 'ppc', 'i386' or 'ppc i386' are useful architectures,
# because the Flash-Player is not yet available as a 64-bit version.
# Flash is required for displaying the videos of MuseScore-Connect.
# See http://qt.gitorious.org/qt/pages/Qt470KnownIssues
# Since 10.6+ only runs on intel, just set it to i386.
set(CMAKE_OSX_ARCHITECTURES x86_64)
# Adjust and uncomment this variable, if you target a different version
# of MacOSX.
2016-06-10 10:37:53 +02:00
#set(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
2012-05-26 14:49:10 +02:00
2016-06-10 10:37:53 +02:00
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7) # Min version required
set(HAS_AUDIOFILE TRUE) # Requires libsndfile
2012-05-26 14:49:10 +02:00
find_library(AudioToolboxFW NAMES AudioToolbox)
find_library(AudioUnitFW NAMES AudioUnit)
find_library(CoreAudioFW NAMES CoreAudio)
find_library(CoreMidiFW NAMES CoreMIDI)
find_library(SystemConfigurationFW NAMES SystemConfiguration)
find_library(CoreServicesFW NAMES CoreServices)
find_library(AppKit NAMES AppKit)
set(OsxFrameworks ${AudioToolboxFW} ${AudioUnitFW} ${CoreAudioFW} ${CoreMidiFW} ${SystemConfigurationFW} ${CoreServicesFW} ${AppKit})
2012-05-26 14:49:10 +02:00
endif (APPLE)
2013-02-13 22:01:48 +01:00
#
# Check for gcc compiler >= 4.8
2013-02-13 22:01:48 +01:00
#
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
2013-03-26 19:59:51 +01:00
if (${CMAKE_CXX_COMPILER_MAJOR} LESS 4
OR ((${CMAKE_CXX_COMPILER_MAJOR} EQUAL 4) AND (${CMAKE_CXX_COMPILER_MINOR} LESS 8)))
message(FATAL_ERROR "bad gcc compiler version " ${CMAKE_CXX_COMPILER_VERSION}
" >= 4.8 required")
2013-02-13 22:01:48 +01:00
endif()
endif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (NOT MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
endif (NOT MSVC)
2013-03-13 18:55:42 +01:00
if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -stdlib=libc++ -Wno-inconsistent-missing-override")
2016-06-10 10:37:53 +02:00
# This is necessary for genManual to be executed during the build phase,
2016-04-14 16:20:44 +02:00
# it needs to be able to get the Qt libs.
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_RPATH "${QT_INSTALL_PREFIX}/lib")
2013-03-13 18:55:42 +01:00
else (APPLE)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (MSVC)
# Set compiler options for VS2017 toolchain.
# Note: /D_CRT_SECURE_NO WARNINGS disables warnings when using "non-secure" library functions like sscanf...
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /GR /EHsc /D_UNICODE /DUNICODE /D_CRT_SECURE_NO_WARNINGS /execution-charset:utf-8")
if (USE_SSE)
# If USE_SSE is set, enable use of SSE instructions to compiler.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE")
endif (USE_SSE)
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /permissive- /std:c++14 /W4 /Zi /Ob0 /Od /RTC1")
set(CMAKE_CXX_FLAGS_RELEASE "/MD /permissive- /std:c++14 /W4 /O2 /Ob2 -DNDEBUG -DQT_NO_DEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /permissive- /std:c++14 /W4 /Zi /O2 /Ob1 -DNDEBUG -DQT_NO_DEBUG")
else (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
if (MINGW)
# -mno-ms-bitfields see #22048
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware")
else (MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG_OUTPUT")
endif (MINGW)
endif (MSVC)
2013-03-13 18:55:42 +01:00
endif(APPLE)
2012-05-26 14:49:10 +02:00
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) # Call CMake with option -DCMAKE_SKIP_RPATH to not set RPATH (Debian packaging requirement)
2012-05-26 14:49:10 +02:00
set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
2016-06-10 10:37:53 +02:00
# The MuseScore version number.
SET(MUSESCORE_NAME "MuseScore")
2016-04-21 12:57:41 +02:00
SET(MUSESCORE_VERSION_MAJOR "3")
SET(MUSESCORE_VERSION_MINOR "0")
2013-03-12 11:42:10 +01:00
SET(MUSESCORE_VERSION_PATCH "0")
SET(MUSESCORE_VERSION "${MUSESCORE_VERSION_MAJOR}.${MUSESCORE_VERSION_MINOR}")
SET(MUSESCORE_NAME_VERSION "${MUSESCORE_NAME} ${MUSESCORE_VERSION_MAJOR}")
2012-05-26 14:49:10 +02:00
#
2016-06-10 10:37:53 +02:00
# Version schema x.x.x is hardcoded in source
2012-05-26 14:49:10 +02:00
#
2013-03-12 11:42:10 +01:00
SET(MUSESCORE_VERSION_FULL "${MUSESCORE_VERSION}.${MUSESCORE_VERSION_PATCH}")
2012-05-26 14:49:10 +02:00
if (BUILD_WEBEBENGINE)
if (MINGW)
SET (USE_WEBENGINE 0)
else (MINGW)
SET (USE_WEBENGINE 1)
endif(MINGW)
endif (BUILD_WEBEBENGINE)
if (MUSESCORE_LABEL)
SET (MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION} ${MUSESCORE_LABEL}")
endif (MUSESCORE_LABEL)
if (MSCORE_UNSTABLE)
SET (MUSESCORE_NAME_VERSION "${MUSESCORE_NAME_VERSION} (${MUSESCORE_VERSION_FULL} unstable)")
endif (MSCORE_UNSTABLE)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (MINGW OR MSVC OR APPLE)
if(MINGW OR MSVC)
# Option for MINGW and MSVC
2012-05-26 14:49:10 +02:00
SET(Mscore_INSTALL_NAME "")
SET(Mscore_SHARE_NAME "./")
else(MINGW OR MSVC)
# Option for Apple
SET(Mscore_INSTALL_NAME "Contents/Resources/")
SET(Mscore_SHARE_NAME "mscore.app/")
endif(MINGW OR MSVC)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
else (MINGW OR MSVC OR APPLE)
SET(Mscore_INSTALL_NAME "mscore${MSCORE_INSTALL_SUFFIX}-${MUSESCORE_VERSION}/")
2012-05-26 14:49:10 +02:00
SET(Mscore_SHARE_NAME "share/")
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (MINGW OR MSVC OR APPLE)
2012-05-26 14:49:10 +02:00
# Download MuseScore SoundFont
if (DOWNLOAD_SOUNDFONT)
set (SF_VERSION_REMOTE_FILE ${PROJECT_BINARY_DIR}/VERSION)
set (SF_VERSION_LOCAL_FILE ${PROJECT_SOURCE_DIR}/share/sound/VERSION)
set (DOWNLOAD_URL_ROOT "http://ftp.osuosl.org/pub/musescore/soundfont/MuseScore_General")
set (SOUND_DIRECTORY ${PROJECT_SOURCE_DIR}/share/sound)
file(DOWNLOAD ${DOWNLOAD_URL_ROOT}/VERSION ${SF_VERSION_REMOTE_FILE} STATUS SF_VERSION_DL_STATUS_LIST)
list(GET SF_VERSION_DL_STATUS_LIST 0 SF_VERSION_DL_STATUS)
if(EXISTS ${SF_VERSION_REMOTE_FILE} AND SF_VERSION_DL_STATUS EQUAL 0)
file (STRINGS ${SF_VERSION_REMOTE_FILE} SF_VERSION_REMOTE)
set(SF_VERSION_LOCAL "0.0")
if (EXISTS ${SF_VERSION_LOCAL_FILE})
file (STRINGS ${SF_VERSION_LOCAL_FILE} SF_VERSION_LOCAL)
endif ()
string(COMPARE LESS ${SF_VERSION_LOCAL} ${SF_VERSION_REMOTE} DO_DOWNLOAD)
if (DO_DOWNLOAD)
message("Downloading version ${SF_VERSION_REMOTE} of the MuseScore SoundFont. Version is outdated ${SF_VERSION_LOCAL}.")
# delete soundfont and download new version
## TODO check STATUS of downloads
file (REMOVE ${SOUND_DIRECTORY}/MuseScore_General.sf3
${SOUND_DIRECTORY}/MuseScore_General-License.md
${SOUND_DIRECTORY}/MuseScore_General-changelog.txt)
file(DOWNLOAD ${DOWNLOAD_URL_ROOT}/MuseScore_General.sf3 ${SOUND_DIRECTORY}/MuseScore_General.sf3 SHOW_PROGRESS STATUS SF_DL_STATUS)
list(GET SF_DL_STATUS 0 HTTP_STATUS)
if (NOT HTTP_STATUS EQUAL 0)
list(GET SF_DL_STATUS 1 HTTP_STATUS_TEXT)
message(FATAL_ERROR "Cannot download new soundfont. Error: ${HTTP_STATUS_TEXT}")
endif()
file(DOWNLOAD ${DOWNLOAD_URL_ROOT}/MuseScore_General-License.md ${SOUND_DIRECTORY}/MuseScore_General-License.md)
file(DOWNLOAD ${DOWNLOAD_URL_ROOT}/MuseScore_General-changelog.txt ${SOUND_DIRECTORY}/MuseScore_General-changelog.txt)
# replace VERSION file (in any case, delete VERSION file)
file (COPY ${SF_VERSION_REMOTE_FILE} DESTINATION ${SOUND_DIRECTORY})
file (REMOVE ${SF_VERSION_REMOTE_FILE})
else(DO_DOWNLOAD)
message("MuseScore SoundFont is up to date.")
endif(DO_DOWNLOAD)
endif()
endif(DOWNLOAD_SOUNDFONT)
if (BUILD_FOR_WINSTORE)
set(FOR_WINSTORE 1)
endif(BUILD_FOR_WINSTORE)
##
## freetype2 >= 2.5.2
##
if (USE_SYSTEM_FREETYPE)
if (APPLE)
PKGCONFIG (freetype2 2.5.2 FREETYPE_INCLUDE_DIRS FREETYPE_LIBDIR FREETYPE_LIBRARIES FREETYPE_CPP)
if (FREETYPE_INCLUDE_DIRS)
STRING(REGEX REPLACE "\"" "" FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
STRING(REGEX REPLACE "\"" "" FREETYPE_LIBDIR ${FREETYPE_LIBDIR})
message("freetype2 detected ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_LIBDIR} ${FREETYPE_LIBRARIES}")
else (FREETYPE_INCLUDE_DIRS)
message(FATAL_ERROR "freetype >= 2.5.2 is required\n")
endif (FREETYPE_INCLUDE_DIRS)
else (APPLE)
find_package(Freetype REQUIRED)
endif (APPLE)
endif (USE_SYSTEM_FREETYPE)
2012-05-26 14:49:10 +02:00
##
2016-06-10 10:37:53 +02:00
## ALSA >= 1.0.0
2012-05-26 14:49:10 +02:00
##
if (BUILD_ALSA)
PKGCONFIG1 (alsa 1.0.0 ALSA_INCDIR ALSA_LIBDIR ALSA_LIB ALSA_CPP )
2012-05-26 14:49:10 +02:00
if (NOT ALSA_INCDIR)
message(SEND_ERROR "Error: ALSA support requested (BUILD_ALSA=${BUILD_ALSA}), but ALSA >= 1.0.0 was not found.")
2012-05-26 14:49:10 +02:00
else (NOT ALSA_INCDIR)
2016-03-30 13:31:15 +02:00
message("ALSA >= 1.0.0 found. ALSA support enabled. INCDIR ${ALSA_INCDIR}, LIBDIR ${ALSA_LIBDIR}, LIB ${ALSA_LIB}, CPP ${ALSA_CPP}")
2012-05-26 14:49:10 +02:00
set (USE_ALSA 1)
endif (NOT ALSA_INCDIR)
else (BUILD_ALSA)
message(STATUS "ALSA support disabled")
endif (BUILD_ALSA)
2012-05-26 14:49:10 +02:00
##
## MIDI
2012-05-26 14:49:10 +02:00
##
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (APPLE OR MINGW OR MSVC)
set (HAS_MIDI 1)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
else (APPLE OR MINGW OR MSVC)
if (USE_ALSA)
set (HAS_MIDI 1)
endif (USE_ALSA)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (APPLE OR MINGW OR MSVC)
##
2016-06-10 10:37:53 +02:00
## PulseAudio
##
if (BUILD_PULSEAUDIO)
2012-05-26 14:49:10 +02:00
if (PULSEAUDIO_FOUND)
set(USE_PULSEAUDIO 1)
2016-06-10 10:37:53 +02:00
message("PulseAudio found. PulseAudio support enabled.")
2012-05-26 14:49:10 +02:00
else (PULSEAUDIO_FOUND)
2016-06-10 10:37:53 +02:00
message(SEND_ERROR "Error: PulseAudio support requested (BUILD_PULSEAUDIO=${BUILD_PULSEAUDIO}), but PulseAudio was not found.")
2012-05-26 14:49:10 +02:00
endif (PULSEAUDIO_FOUND)
else (BUILD_PULSEAUDIO)
2016-06-10 10:37:53 +02:00
message(STATUS "PulseAudio support disabled")
endif (BUILD_PULSEAUDIO)
2012-05-26 14:49:10 +02:00
##
2016-06-10 10:37:53 +02:00
## LAME
##
if (APPLE OR MINGW)
if (BUILD_LAME)
include (FindLame)
set (USE_LAME 1)
endif (BUILD_LAME)
else (APPLE OR MINGW)
if (BUILD_LAME)
if (MSVC)
include(FindLameMSVC)
else (MSVC)
include (FindLame)
endif (MSVC)
if (LAME_FOUND)
set(USE_LAME 1)
MESSAGE("LAME found.")
else (LAME_FOUND)
set(USE_LAME 0)
MESSAGE("LAME not found.")
endif (LAME_FOUND)
else (BUILD_LAME)
MESSAGE(STATUS "LAME MP3 support disabled")
endif (BUILD_LAME)
endif (APPLE OR MINGW)
2012-05-26 14:49:10 +02:00
##
2016-06-10 10:37:53 +02:00
## Find JACK >= JACK_MIN_VERSION
2012-05-26 14:49:10 +02:00
##
2012-05-26 14:49:10 +02:00
IF(BUILD_JACK)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
IF(MINGW OR MSVC)
2012-05-26 14:49:10 +02:00
set (USE_JACK 1)
IF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
2012-05-26 14:49:10 +02:00
# "pure" 32-bit environment
set (progenv "PROGRAMFILES")
ELSE("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
2012-05-26 14:49:10 +02:00
# "pure" 64-bit environment
set (progenv "PROGRAMFILES(x86)")
ENDIF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
2012-05-26 14:49:10 +02:00
ELSE("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
# 32-bit program running with an underlying 64-bit environment
set (progenv "PROGRAMFILES(x86)")
2012-05-26 14:49:10 +02:00
ELSE("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
2016-06-10 10:37:53 +02:00
# Theoretically impossible case...
MESSAGE(SEND_ERROR "Error: Impossible program/environment bitness combination deduced: 64-bit program running in 32-bit environment. This is a programming error. PROCESSOR_ARCHITEW6432=$ENV{PROCESSOR_ARCHITEW6432}. PROCESSOR_ARCHITECTURE=$ENV{PROCESSOR_ARCHITECTURE}")
2012-05-26 14:49:10 +02:00
ENDIF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "x86")
ENDIF("$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
set (JACK_INCDIR "$ENV{${progenv}}/Jack/includes")
set (JACK_LIB "$ENV{${progenv}}/Jack/lib/libjack.a")
2016-06-10 10:37:53 +02:00
MESSAGE("JACK support enabled.")
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
ELSE(MINGW OR MSVC)
PKGCONFIG1 (jack ${JACK_MIN_VERSION} JACK_INCDIR JACK_LIBDIR JACK_LIB JACK_CPP)
2012-05-26 14:49:10 +02:00
IF(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} found. jack support enabled.")
2012-05-26 14:49:10 +02:00
SET(USE_JACK 1)
ELSE(JACK_INCDIR)
MESSAGE(STATUS "${JACK_LONGNAME} >= ${JACK_MIN_VERSION} not found")
2016-06-10 10:37:53 +02:00
MESSAGE(SEND_ERROR "Error: JACK support requested (BUILD_JACK=${BUILD_JACK}), but JACK was not found")
2012-05-26 14:49:10 +02:00
ENDIF(JACK_INCDIR)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
ENDIF(MINGW OR MSVC)
2012-05-26 14:49:10 +02:00
ELSE(BUILD_JACK)
MESSAGE(STATUS "${JACK_LONGNAME} support disabled")
ENDIF(BUILD_JACK)
##
2016-06-10 10:37:53 +02:00
## PortAudio
2012-05-26 14:49:10 +02:00
##
if (BUILD_PORTAUDIO)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (MINGW OR MSVC)
set ( USE_PORTAUDIO 1 )
2018-08-04 14:35:55 +02:00
if (MSVC)
include(FindPortAudio)
add_library(portaudio1 SHARED IMPORTED)
message(STATUS ${PORTAUDIO_LIBRARY})
set_target_properties(portaudio1 PROPERTIES IMPORTED_IMPLIB ${PROJECT_SOURCE_DIR}/dependencies/libx86/portaudio.lib)
endif(MSVC)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
else (MINGW OR MSVC)
PKGCONFIG1 (portaudio-2.0 19 PORTAUDIO_INCDIR PORTAUDIO_LIBDIR PORTAUDIO_LIB PORTAUDIO_CPP)
if (PORTAUDIO_INCDIR)
2016-08-09 00:25:42 +02:00
message("PortAudio found. PortAudio support enabled. INCDIR ${PORTAUDIO_INCDIR}, LIBDIR ${PORTAUDIO_LIBDIR}, LIB ${PORTAUDIO_LIB}")
set ( USE_PORTAUDIO 1 )
else (PORTAUDIO_INCDIR)
2016-06-10 10:37:53 +02:00
message(SEND_ERROR "Error: PortAudio support requested (BUILD_PORTAUDIO=${BUILD_PORTAUDIO}), but portaudio-2.0 version 19 was not found (package portaudio19-dev)")
endif (PORTAUDIO_INCDIR)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (MINGW OR MSVC)
else (BUILD_PORTAUDIO)
2016-06-10 10:37:53 +02:00
message(STATUS "PortAudio support disabled")
endif (BUILD_PORTAUDIO)
2012-05-26 14:49:10 +02:00
2016-08-09 00:25:42 +02:00
##
## PortMidi
##
if (BUILD_PORTMIDI)
if (NOT BUILD_PORTAUDIO)
message(SEND_ERROR "Error: PortMidi support requested (BUILD_PORTMIDI=${BUILD_PORTMIDI}), but PortAudio support is disabled (BUILD_PORTAUDIO=${BUILD_PORTAUDIO}). PortMidi requires PortAudio.")
endif (NOT BUILD_PORTAUDIO)
set (USE_PORTMIDI 1)
else (BUILD_PORTMIDI)
message(STATUS "PortMidi support disabled")
endif (BUILD_PORTMIDI)
2013-05-21 18:26:08 +02:00
if (APPLE)
if(SOUNDFONT3)
##
## libvorbis
##
PKGCONFIG1 (vorbis 1.3.3 VORBIS_INCDIR VORBIS_LIBDIR VORBIS_LIB VORBIS_CPP)
if (VORBIS_INCDIR)
message("libvorbis detected ${VORBIS_INCDIR} ${VORBIS_LIBDIR} ${VORBIS_LIB}")
else (VORBIS_INCDIR)
message("libvorbis not found\n")
endif (VORBIS_INCDIR)
##
## libogg
##
PKGCONFIG1 (ogg 1.3.0 OGG_INCDIR OGG_LIBDIR OGG_LIB OGG_CPP)
if (OGG_INCDIR)
message("libogg detected ${OGG_INCDIR} ${OGG_LIBDIR} ${OGG_LIB}")
else (OGG_INCDIR)
message("libogg not found\n")
endif (OGG_INCDIR)
endif(SOUNDFONT3)
if(HAS_AUDIOFILE)
##
## libsndfile
##
PKGCONFIG1 (sndfile 1.0.25 SNDFILE_INCDIR SNDFILE_LIBDIR SNDFILE_LIB SNDFILE_CPP)
if (SNDFILE_INCDIR)
message("libsndfile detected ${SNDFILE_INCDIR} ${SNDFILE_LIBDIR} ${SNDFILE_LIB}")
else (SNDFILE_INCDIR)
message("libsndfile not found\n")
endif (SNDFILE_INCDIR)
endif(HAS_AUDIOFILE)
2013-05-21 18:26:08 +02:00
else(APPLE)
2018-08-04 14:35:55 +02:00
if (MINGW OR MSVC)
2013-05-21 18:26:08 +02:00
set(SNDFILE_LIB sndfile-1)
2018-08-04 14:35:55 +02:00
if (MSVC)
include(FindVorbis)
add_library(vorbis1 SHARED IMPORTED)
set_target_properties(vorbis1 PROPERTIES IMPORTED_IMPLIB ${VORBIS_LIBRARY})
include(FindSndFile)
add_library(sndfile1 SHARED IMPORTED)
set_target_properties(sndfile1 PROPERTIES IMPORTED_IMPLIB ${SNDFILE_LIBRARY})
include(FindVorbisfile)
add_library(vorbisfile1 SHARED IMPORTED)
set_target_properties(vorbisfile1 PROPERTIES IMPORTED_IMPLIB ${VORBISFILE_LIBRARY})
include(FindOgg)
add_library(ogg1 SHARED IMPORTED)
set_target_properties(ogg1 PROPERTIES IMPORTED_IMPLIB ${OGG_LIBRARY})
endif(MSVC)
2018-08-04 14:35:55 +02:00
else (MINGW OR MSVC)
2013-05-21 18:26:08 +02:00
set(SNDFILE_LIB sndfile)
2018-08-04 14:35:55 +02:00
endif (MINGW OR MSVC)
set(OGG_LIB ogg)
set(VORBIS_LIB vorbis)
2013-05-21 18:26:08 +02:00
endif(APPLE)
2013-03-12 11:42:10 +01:00
##
## QtSingleApplication
##
if (USE_SYSTEM_QTSINGLEAPPLICATION)
find_path(QTSINGLEAPPLICATION_INCLUDE_DIRS qtsingleapplication.h PATH_SUFFIXES QtSolutions)
find_library(QTSINGLEAPPLICATION_LIBRARIES QtSolutions_SingleApplication-2.6)
else(USE_SYSTEM_QTSINGLEAPPLICATION)
subdirs (thirdparty/singleapp)
set(QTSINGLEAPPLICATION_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/singleapp/src)
set(QTSINGLEAPPLICATION_LIBRARIES qtsingleapp)
endif(USE_SYSTEM_QTSINGLEAPPLICATION)
2012-05-26 14:49:10 +02:00
##
## produce config.h file
##
configure_file (
${PROJECT_SOURCE_DIR}/build/config.h.in
${PROJECT_BINARY_DIR}/config.h
)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (NOT MINGW AND NOT MSVC AND NOT APPLE)
#### PACKAGING for Linux and BSD based systems (more in mscore/CMakeLists.txt) ####
2013-03-12 11:42:10 +01:00
#
# set library search path for runtime linker to load the same
# qt libraries as we used at compile time
#
2016-06-10 10:37:53 +02:00
SET(CMAKE_INSTALL_RPATH "${_qt5Core_install_prefix}/lib") # Ignored if CMAKE_SKIP_RPATH="TRUE"
string(TOUPPER "mscore${MSCORE_INSTALL_SUFFIX}" MAN_MSCORE_UPPER) # Command name shown in uppercase in man pages by convention
if (${MSCORE_INSTALL_SUFFIX} MATCHES "portable") # Note: "-portable-anything" would match
# Build portable AppImage as per https://github.com/probonopd/AppImageKit
if (NOT DEFINED ARCH)
2016-06-10 10:37:53 +02:00
execute_process(COMMAND arch OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)# Get architecture (strip trailing newline)
endif (NOT DEFINED ARCH)
2016-06-10 10:37:53 +02:00
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)
2016-06-10 10:37:53 +02:00
set(PORTABLE_INSTALL_NAME "${PORTABLE_INSTALL_NAME}-${MUSESCORE_VERSION_FULL}") # Append version info.
endif (NOT MSCORE_UNSTABLE)
2016-06-10 10:37:53 +02:00
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)
# Prepare portable scripts:
configure_file(build/Linux+BSD/portable/AppRun.in AppRun @ONLY)
configure_file(build/Linux+BSD/portable/portable-utils.in portable-utils @ONLY)
set(SCRIPT_PERMS PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ WORLD_READ)
install(PROGRAMS ${PROJECT_BINARY_DIR}/AppRun DESTINATION . COMPONENT portable ${SCRIPT_PERMS})
install(PROGRAMS ${PROJECT_BINARY_DIR}/portable-utils
build/Linux+BSD/portable/ldd-recursive
build/rm-empty-dirs DESTINATION bin COMPONENT portable ${SCRIPT_PERMS})
install(FILES build/Linux+BSD/portable/qt.conf DESTINATION bin COMPONENT portable)
else (${MSCORE_INSTALL_SUFFIX} MATCHES "portable")
set(MAN_PORTABLE .\\\") # comment out lines in man page that are only relevent to the portable version
endif (${MSCORE_INSTALL_SUFFIX} MATCHES "portable")
2016-06-10 10:37:53 +02:00
# Install desktop file (perform variable substitution first)
configure_file(build/Linux+BSD/mscore.desktop.in mscore${MSCORE_INSTALL_SUFFIX}.desktop)
install( FILES ${PROJECT_BINARY_DIR}/mscore${MSCORE_INSTALL_SUFFIX}.desktop DESTINATION share/applications)
2016-06-10 10:37:53 +02:00
# 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_TARGET ${PROJECT_SOURCE_DIR}/build/Linux+BSD/${MAN_NAME}${MAN_EXTENSION}.in)
set(MAN_BUILD ${PROJECT_BINARY_DIR}/${MAN_FULL_NAME})
configure_file(${MAN_TARGET} ${MAN_BUILD})
2016-06-10 10:37:53 +02:00
# Compress man pages if gzip is installed (don't on OpenBSD)
# Note: Compressing man pages is normal on Linux but not OpenBSD
find_program( GZIP_EXECUTABLE gzip DOC "A tool for compressing manpages (optional)." )
if (GZIP_EXECUTABLE AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
2016-06-10 10:37:53 +02:00
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_BUILD ${PROJECT_BINARY_DIR}/${MAN_FULL_NAME})
add_custom_command(
OUTPUT ${MAN_BUILD}
DEPENDS ${MAN_TARGET}
COMMAND ${GZIP_EXECUTABLE} -9 < ${MAN_TARGET} > ${MAN_BUILD}
)
add_custom_target(manpages ALL
DEPENDS ${MAN_BUILD}
COMMAND echo "Man pages have been compressed ready for installation."
VERBATIM
)
else (GZIP_EXECUTABLE AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
message(STATUS "System is OpenBSD: Man pages will not be compressed.")
else (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
2016-06-10 10:37:53 +02:00
message(STATUS "'gzip' not found (it is optional). Man pages will not be compressed.")
endif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
add_custom_target(manpages ALL
COMMAND echo "Man pages will be installed uncompressed."
VERBATIM
)
endif (GZIP_EXECUTABLE AND NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
2016-06-10 10:37:53 +02:00
# Install man pages in either compressed or uncompressed form
install( FILES ${MAN_BUILD} DESTINATION share/man/man1 COMPONENT doc)
2016-06-10 10:37:53 +02:00
# Create symlink alias for man pages so `man musescore` = `man mscore`
find_program( LN_EXECUTABLE ln DOC "A tool for creating symbolic link aliases (optional)." )
if (LN_EXECUTABLE)
2016-06-10 10:37:53 +02:00
message(STATUS "Found 'ln'. Symlink aliases will be created for MuseScore executable and the man pages.")
add_custom_command(
TARGET manpages
COMMAND echo "Creating symlink alias for man pages."
COMMAND ${LN_EXECUTABLE} -sf "${MAN_FULL_NAME}" "${MAN_FULL_ALIAS}"
COMMAND echo 'Symlink alias: ${MAN_FULL_ALIAS} -> ${MAN_FULL_NAME}'
)
install( FILES ${PROJECT_BINARY_DIR}/${MAN_FULL_ALIAS} DESTINATION share/man/man1 COMPONENT doc)
else (LN_EXECUTABLE)
2016-06-10 10:37:53 +02:00
message(STATUS "'ln' not found (it is optional). No symlink aliases will be created.")
endif (LN_EXECUTABLE)
2016-06-10 10:37:53 +02:00
# Add .MSCZ and .MSCX to MIME database (informs system that filetypes .MSCZ & .MSCX 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)
2016-06-10 10:37:53 +02:00
# Note: Must now run "update-mime-database" to apply changes. This is done in the Makefile.
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (NOT MINGW AND NOT MSVC AND NOT APPLE)
2012-05-26 14:49:10 +02:00
#
2016-06-10 10:37:53 +02:00
# Create precompiled header file
2012-05-26 14:49:10 +02:00
#
2013-02-04 16:56:01 +01:00
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
# all.h is expected in PROJECT_BINARY_DIR by subdirs, except for MSVC
if (NOT MSVC)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/all.h ${PROJECT_BINARY_DIR}/all.h
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
endif (NOT MSVC)
2014-06-26 13:33:16 +02:00
precompiled_header(QT_INCLUDES all ${BUILD_PCH})
2014-06-26 13:33:16 +02:00
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
# MSVC does not require these targets, as all.h is not copied and the
# PCH generation is done per-project
if (NOT MSVC)
ADD_CUSTOM_TARGET(mops1 DEPENDS ${PROJECT_BINARY_DIR}/all.h)
ADD_CUSTOM_TARGET(mops2 DEPENDS ${PCH})
endif (NOT MSVC)
2012-05-26 14:49:10 +02:00
2013-03-12 11:42:10 +01:00
##
2016-06-10 10:37:53 +02:00
## Add subdirs
2013-03-12 11:42:10 +01:00
##
2013-04-15 10:38:16 +02:00
subdirs(
2017-08-17 22:08:09 +02:00
mscore awl bww2mxml share midi audiofile fluid libmscore synthesizer
effects thirdparty/rtf2html thirdparty/diff thirdparty/beatroot
thirdparty/qzip thirdparty/kQOAuth
2013-04-15 10:38:16 +02:00
)
# thirdparty/xmlstream
2018-04-02 03:20:04 +02:00
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
if (APPLE AND CMAKE_BUILD_TYPE MATCHES "DEBUG")
2016-06-10 10:37:53 +02:00
# With xcode, we need to have all the targets in the same project
add_subdirectory(mtest)
else(APPLE AND CMAKE_BUILD_TYPE MATCHES "DEBUG")
2014-06-26 13:33:16 +02:00
add_subdirectory(mtest EXCLUDE_FROM_ALL)
endif(APPLE AND CMAKE_BUILD_TYPE MATCHES "DEBUG")
2012-05-26 14:49:10 +02:00
2015-02-18 11:35:09 +01:00
add_subdirectory(rdoc EXCLUDE_FROM_ALL)
2013-04-08 16:28:21 +02:00
add_subdirectory(miditools EXCLUDE_FROM_ALL)
2013-11-06 15:58:05 +01:00
add_subdirectory(fonttools EXCLUDE_FROM_ALL)
add_subdirectory(manual)
2014-11-12 16:36:40 +01:00
add_subdirectory(demos)
2012-05-26 14:49:10 +02:00
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
if (USE_PORTMIDI AND (MINGW OR APPLE OR MSVC))
2012-05-26 14:49:10 +02:00
subdirs (thirdparty/portmidi)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
endif (USE_PORTMIDI AND (MINGW OR APPLE OR MSVC))
2012-05-26 14:49:10 +02:00
if (AEOLUS)
subdirs (aeolus)
endif (AEOLUS)
2013-03-26 19:59:51 +01:00
if (ZERBERUS)
subdirs (zerberus)
endif (ZERBERUS)
2012-05-26 14:49:10 +02:00
if (OMR)
subdirs (omr thirdparty/poppler)
2012-05-26 14:49:10 +02:00
endif (OMR)
if (OSC)
subdirs (thirdparty/ofqf)
endif (OSC)
if (NOT USE_SYSTEM_FREETYPE)
subdirs (thirdparty/freetype)
endif (NOT USE_SYSTEM_FREETYPE)
2013-03-12 11:42:10 +01:00
##
2016-06-10 10:37:53 +02:00
## Includes
2013-03-12 11:42:10 +01:00
##
2012-05-26 14:49:10 +02:00
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_BINARY_DIR}
${ALSA_INCDIR}
${JACK_INCDIR}
${PORTAUDIO_INCDIR}
${OGG_INCDIR}
${VORBIS_INCDIR}
${SNDFILE_INCDIR}
${LAME_INCLUDE_DIR}
2012-05-26 14:49:10 +02:00
)
if (MSVC)
include_directories(${PROJECT_SOURCE_DIR}/dependencies)
include_directories(${PROJECT_SOURCE_DIR}/dependencies/include)
include_directories(${PROJECT_SOURCE_DIR}/dependencies/include/vorbis)
include_directories(${SNDFILE_INCLUDE_DIR})
include_directories(${VORBIS_INCLUDE_DIR})
include_directories(${PORTAUDIO_INCLUDE_DIR})
include_directories(${OGG_INCLUDE_DIR})
endif (MSVC)
if (USE_SYSTEM_FREETYPE)
include_directories(${FREETYPE_INCLUDE_DIRS})
else (USE_SYSTEM_FREETYPE)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/freetype/include)
endif (USE_SYSTEM_FREETYPE)
if (OMR)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/poppler)
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/poppler/poppler)
endif (OMR)
2012-05-26 14:49:10 +02:00
##
2013-03-26 19:59:51 +01:00
## Include packaging
2012-05-26 14:49:10 +02:00
##
2013-03-12 11:42:10 +01:00
include(Packaging)
2012-05-26 14:49:10 +02:00
2013-03-12 11:42:10 +01:00
##
2016-06-10 10:37:53 +02:00
## Custom target for translation generation
2013-03-12 11:42:10 +01:00
##
2012-05-26 14:49:10 +02:00
## lupdate is used to generate the translation text files based off of the source code
2012-05-26 14:49:10 +02:00
add_custom_target(lupdate
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-qt-projectfile ${PROJECT_SOURCE_DIR} > mscore.pro
COMMAND Qt5::lupdate ${PROJECT_BINARY_DIR}/mscore.pro
COMMAND ${PROJECT_SOURCE_DIR}/build/gen-instruments-projectfile ${PROJECT_SOURCE_DIR}/share/instruments > instruments.pro
COMMAND Qt5::lupdate ${PROJECT_BINARY_DIR}/instruments.pro
2012-05-26 14:49:10 +02:00
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
## lrelease is used to compile the translated text files generated by lupdate into binary resources
file(GLOB TS_FILES
"share/locale/*.ts"
)
2012-05-26 14:49:10 +02:00
add_custom_target(lrelease
COMMAND Qt5::lrelease
${TS_FILES}
2012-05-26 14:49:10 +02:00
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
2013-03-12 11:42:10 +01:00
##
2016-06-10 10:37:53 +02:00
## Create and install the plugin framework manual
2013-03-12 11:42:10 +01:00
##
2012-08-08 11:16:55 +02:00
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/plugins
COMMAND genManual ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}
DEPENDS genManual
)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
##
## For MSVC: set the startup project to be mscore
## (requires CMake 3.6.3+ to work, but should be benign on other versions
## as it is just setting the value for a property).
##
if (MSVC)
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY true)
This commit contains all the changes to the CMake build system required to generate a valid Visual Studio 2017 solution and projects for MuseScore. In detail, changes are as follows: - Changed .gitignore to ignore VS-specific files and directories. - VS uses a global settings file for the CMake build process: CMakeSettings.json. This is a text file, which is conceptually equivalent to the Makefile used to invoke CMake through Make. This file might need to be changed on an individual user basis, if dependencies are not installed in default paths. - New cmake macros to copy files in build\CopyFilesMacros.cmake. The code is from https://cmake.org/pipermail/cmake/2009-March/027892.html - Pre-compiled headers: Visual Studio requires to create pre-compiled headers per-project (a general per-solution PCH file, although possible, is extremely problematic and not recommended). Therefore, the new macro vstudio_pch in CreatePrecompiledHeader.cmake was created to add the pre-compiled header creation step to an existing target (similar to what is done for XCode). The existing macro precompiled_header was modified to set the values for a group of variables. As part of this, the empty file all.cpp was added to the root of the source tree, as VS requires a source file to create pre-compiled headers (the header file alone can not be compiled). - all.h is not copied to binary dir for MSVC, as I could determine no need to do this. Because of this, and the differences in PCH handling, the pseudo-targets mops1 and mops2 are not created for MSVC. - Revised all steps conditional on toolchain, and added MSVC paths as needed. In many instances, the MSVC path is the same as the MINGW path, but not always. - The manual (genManual) target used the getopt() functionality defined in POSIX libraries, which is not available on Windows. An LGPL'd port of getopt() for Windows was added in manual\getopt. The original source is in GitHub: nanoporetech/getopt-win32, based on a CodeProject article: https://www.codeproject.com/KB/cpp/getopt4win.aspx?msg=3987371. The corresponding CMakeLists.txt file was modified to include this files when compiling with MSVC. - Changes in CMakeLists.txt files to create valid MSVC targets. The changes, always conditional on the MSVC toolchain, consist of: x Setting target properties for MSVC x Using all.h in source dir x Adding pre-compiled headers to target x Removing dependency from mops1 and mops2 Notes: - The INSTALL target has NOT BEEN UPDATED for MSVC.
2018-05-01 17:48:42 +02:00
set(VS_STARTUP_PROJECT mscore)
endif (MSVC)
## TEMP: Display all variables!
### message(STATUS "===========================================================")
### message(STATUS "VARIABLES:")
### message(STATUS "")
### get_cmake_property(_variableNames VARIABLES)
### list (SORT _variableNames)
### foreach (_variableName ${_variableNames})
### message(STATUS "${_variableName}=${${_variableName}}")
### endforeach()
### message(STATUS "===========================================================")