Commit graph

11 commits

Author SHA1 Message Date
Eric Fontaine 656cd70a41 MSCV pch allow switch configuration
Previously, changing build configuration in MSCV would result in a failed compilation.  That's because CreatePrecompiledHeader.cmake told MSVC to use the same pre-compiled header file for all configurations, causing the compiler to complain that the pch was generated with different incompatible compiler options.

This commit fixes that by using the MSVC string for configuration as part of the directory for the pre-compiled header location, so each configuration (Release, Debug, RelWithDebInfo, or any other) will have its own precompiled header which works properly during compile.  That allows programmer to easily switch between configurations.
2019-01-02 02:06:58 -05:00
alexandr df114f189c Compile under MSVC: this commit caontais all changes to run MSVC build
1) fix some bugs which appear in runtime:  replace QString::tostdstring() to Foo.toUtf8().constData().

2) Enable start center online community. To use it you need download webengine in your QT lib. see instruction https://musescore.org/en/handbook/developers-handbook/compilation/compile-instructions-windows-visual-studio-2017-wip

3) update install steps. Add additional dlls for webEngine. Add copying dlls and musescore.exe to /msvc.install/bin folder. Run project will work with the "$(ProjectDir)\..\..\msvc.install\bin\MuseScore.exe" specified in Debugging field in mscore project

4) Moving AppVeyor from MinGW to MSVC. Exclude ALL MSVC project from INSTALL project. Exclude ALL from PACKAGE. Remove migw-cmake in script build, add .bat instead. Remove xcopy from 7z archive step

5) Fix warning : Warning C4703 potentially uninitialized local pointer variable '' used; Warning C4456 declaration of '' hides previous local declaration; Warning C4458 declaration of '' hides class member

6) Change path to 11 version wix toolset which created .msi installer package
2018-08-04 12:17:31 +02:00
Andres Fernandez de Prado 188386ba2e 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-08-03 09:15:42 +02:00
mirabilos 1599046957 Fix use of CMAKE_CXX_FLAGS for PCH generation
The standard cmake build commands use the values of both
CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE},
so when we use either we also must use the other; if not
the PCH may become invalidated by missing flags.
2018-03-07 14:59:13 +01:00
lasconic 13d0b5334a Make PCH_HEADER and PCH_INCLUDE always available, unbreaks Clang builds on non macOS platforms 2017-08-07 16:57:25 +02:00
Joachim Schmitz 2ef157283e Fix spelling in CMakeLists.txt files 2016-06-10 10:38:13 +02:00
ws b42d129364 build system: add find_package for Qt 2014-06-27 14:03:17 +02:00
lasconic 8f3ed9b4b1 remove precompiled header for Mingw :( see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56926 2013-12-16 23:35:32 +01:00
lasconic 7825ff8db0 precompiled header for mac 2013-03-14 16:00:06 +01:00
lasconic bdb01a0725 fix compilation on MacOSX 2013-03-13 18:55:42 +01:00
lasconic c14a8c86c3 clean up cmake files 2013-03-12 11:42:10 +01:00