Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Switch from CMake to Qbs #213

Merged
merged 94 commits into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
4679d59
Try qbs instead of cmake
ColinDuquesnoy Jan 21, 2018
547b1f9
Merge branch 'develop' into qbs
ColinDuquesnoy Jan 28, 2018
2cf8ed7
Trying to use qbs instead of cmake
ColinDuquesnoy Jan 28, 2018
e9c3fc4
Improve qbs files
ColinDuquesnoy Jan 28, 2018
2c56388
Fix build on MacOs
ColinDuquesnoy Jan 28, 2018
8a108b9
Fix window not showing on OSX
ColinDuquesnoy Jan 29, 2018
f38be4a
Always build libs as static libraries
ColinDuquesnoy Jan 29, 2018
a264cae
Use "import qbs" instead of "import qbs 1.0"
ColinDuquesnoy Jan 29, 2018
f805043
Move web plugins in a subfolder
ColinDuquesnoy Jan 29, 2018
f616543
Add qbs install rule for web plugins
ColinDuquesnoy Jan 29, 2018
8ddc229
Working on tests
ColinDuquesnoy Jan 29, 2018
8c51a17
Fix build date format
ColinDuquesnoy Jan 30, 2018
ef9b7a6
Improve project organization
ColinDuquesnoy Jan 30, 2018
92c7e6c
Automatically generate imports for qml and translation files
ColinDuquesnoy Jan 31, 2018
4f30ce6
Remove annoying print statement in tests
ColinDuquesnoy Jan 31, 2018
3cdb2c8
Don't run unit tests at the end of build
ColinDuquesnoy Jan 31, 2018
da939de
Add some qbs tools to help generate translations
ColinDuquesnoy Feb 4, 2018
9051f49
Fix another build date format issue
ColinDuquesnoy Feb 4, 2018
ba67b1e
Add a qbs file for each test executable
ColinDuquesnoy Feb 4, 2018
63ee9bd
Allow to build with system qxtglobalshortcut
ColinDuquesnoy Feb 4, 2018
6d050e4
Add qbs target to update qmldir
ColinDuquesnoy Feb 4, 2018
eab3cd8
Rename SettingsTranslator.js.in qbs target to update_settings_translator
ColinDuquesnoy Feb 4, 2018
765448d
Add MellowPlayerLib product template
ColinDuquesnoy Feb 4, 2018
65f64b0
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 10, 2018
942e0cb
Add better warning granularity (gcc only)
ColinDuquesnoy Feb 11, 2018
13b852c
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 11, 2018
8a86da7
Add precompiled headers and a target to build documentation
ColinDuquesnoy Feb 11, 2018
9b3dc43
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 11, 2018
76f69da
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 11, 2018
4bebe40
Fix windows build issues
ColinDuquesnoy Feb 13, 2018
400181a
Merge remote-tracking branch 'origin/develop' into qbs
ColinDuquesnoy Feb 13, 2018
cd41fb0
Mark file download as may fail
ColinDuquesnoy Feb 13, 2018
3a9f0c2
Use console application for tests only on windows
ColinDuquesnoy Feb 13, 2018
9f786b5
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 13, 2018
6a16463
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 15, 2018
4735574
Add code coverage support
ColinDuquesnoy Feb 15, 2018
9c83e65
Use Qt 5.10 on travis ci
ColinDuquesnoy Feb 17, 2018
f9dc31c
Update ubuntu-14.04-env-setup.sh
ColinDuquesnoy Feb 17, 2018
744d87e
Update ubuntu-14.04-env-setup.sh
ColinDuquesnoy Feb 17, 2018
c291b61
Travis: ubuntu 14.04 setup
ColinDuquesnoy Feb 18, 2018
f822dd4
Travis: osx setup
ColinDuquesnoy Feb 18, 2018
6b8cd57
Cleanup
ColinDuquesnoy Feb 18, 2018
0575a42
AppVeyor: windows commit build
ColinDuquesnoy Feb 18, 2018
93c8408
Fix appveyor init script
ColinDuquesnoy Feb 18, 2018
6c83f85
Fix appveyor init script
ColinDuquesnoy Feb 18, 2018
6153433
AppVeyor: use c++17 standard (now building with msvc2017)
ColinDuquesnoy Feb 18, 2018
9e71e93
AppVeyor: use qbs 1.10.1
ColinDuquesnoy Feb 18, 2018
dbb5ef7
AppVeyor: fix errors
ColinDuquesnoy Feb 18, 2018
34542c1
Cleanu platform cxx flags for tests
ColinDuquesnoy Feb 18, 2018
99468f9
Update make_appimage script
ColinDuquesnoy Feb 18, 2018
f5ff8a0
make_appimage: fix syntax issues
ColinDuquesnoy Feb 18, 2018
981a6e8
Update make_dmg script
ColinDuquesnoy Feb 18, 2018
4c3b142
Travis: add missing dependencies for appimage
ColinDuquesnoy Feb 18, 2018
0861863
OSX dmg fix plugins path
ColinDuquesnoy Feb 18, 2018
d7bb69c
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 18, 2018
4d8574b
Fix copying plugins to .app
ColinDuquesnoy Feb 18, 2018
c294177
Merge branch 'develop' into qbs
ColinDuquesnoy Feb 18, 2018
a1c3b62
Travis: use qt 5.9.3
ColinDuquesnoy Feb 18, 2018
c56529c
OSX: load plugins from PlugIns/services/web
ColinDuquesnoy Feb 18, 2018
9317023
Fix ppa url
ColinDuquesnoy Feb 18, 2018
22669be
Travis: use a version of qbs built with Qt 5.9.3
ColinDuquesnoy Feb 18, 2018
f2c20ee
Try to fix static linking to libstdc++ when building appimage
ColinDuquesnoy Feb 19, 2018
0ea8955
Enable qxtglobal shortcut initialization
ColinDuquesnoy Feb 25, 2018
c8db678
Define USE_LIBNOTIFY when libnotify is found
ColinDuquesnoy Feb 25, 2018
ed8930e
Try to fix dmg issues
ColinDuquesnoy Feb 25, 2018
ff0056b
Fix windows build
ColinDuquesnoy Feb 25, 2018
4a7a85b
build qbs test runner on windows
ColinDuquesnoy Feb 25, 2018
ec6129e
Cleanup
ColinDuquesnoy Feb 25, 2018
9e5b334
Revert "build qbs test runner on windows"
ColinDuquesnoy Feb 25, 2018
3b01fc3
Windows packaging
ColinDuquesnoy Feb 25, 2018
7bf1afe
Fix syntax error in appveyor.yml
ColinDuquesnoy Feb 25, 2018
8c20758
Add setup.iss to git
ColinDuquesnoy Feb 25, 2018
563426c
Don't build innosetup installer by default
ColinDuquesnoy Feb 25, 2018
aba0130
qbs project structure improvements
ColinDuquesnoy Feb 25, 2018
1e0f0b5
AppVeyor fix runtests script
ColinDuquesnoy Feb 25, 2018
36b69ac
Revert "AppVeyor fix runtests script"
ColinDuquesnoy Feb 25, 2018
e26e13c
Add mayfail flag to more integration tests
ColinDuquesnoy Feb 25, 2018
e12d7d8
Use innosetup item only on windows
ColinDuquesnoy Feb 25, 2018
d5ed4af
Try using qtci to download and install official qt version
ColinDuquesnoy Feb 26, 2018
9875e41
Fix install-qt script extension
ColinDuquesnoy Feb 26, 2018
7da7eef
Merge branch 'develop' into qbs
ColinDuquesnoy Mar 3, 2018
fd1fe59
Install official qt version on Travis CI
ColinDuquesnoy Mar 3, 2018
c3b49da
[Travis-CI] Install official Qt release on OSX
ColinDuquesnoy Mar 3, 2018
b412dc8
[Travis-CI] Fix running all tests on OSX
ColinDuquesnoy Mar 3, 2018
2bf0302
[Travis-CI] Improve scripts
ColinDuquesnoy Mar 3, 2018
d5a070e
Add travis_wait for commands that could take time
ColinDuquesnoy Mar 3, 2018
d54a273
[Travis-CI] Revert usage of qtci on linux
ColinDuquesnoy Mar 4, 2018
0113b7f
[Travis-CI] Fix path to Qt install dir to create appimage
ColinDuquesnoy Mar 4, 2018
3491c29
Try to read CI build number
ColinDuquesnoy Mar 4, 2018
60d0e75
Fix javascript error
ColinDuquesnoy Mar 4, 2018
72691c1
Update README.md
ColinDuquesnoy Mar 10, 2018
8d09103
Update README.md
ColinDuquesnoy Mar 10, 2018
a5e579a
Update install.rst
ColinDuquesnoy Mar 10, 2018
0f919a1
Update README.md
ColinDuquesnoy Mar 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ Makefile*
doxyxml
# sphinx
_build
bin
dist
# Python
*.pyc

# Pycharm project files
.idea
setup.iss
*.usr

# Dolpin
Expand Down Expand Up @@ -61,10 +59,11 @@ appdir/
qt/

qt\.zip
schema.json
.vscode
/.vs
/venv

*.qmlc
*.jsc

*.dmg
9 changes: 9 additions & 0 deletions 3rdparty/3rdparty.qbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import qbs

Project {
name: "Third Parties"

references: [
"libqxt/libqxt.qbs"
]
}
15 changes: 11 additions & 4 deletions 3rdparty/fakeit/fakeit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
#include <atomic>
#include <tuple>

inline bool catch_uncaught_exceptions() {
#if __cplusplus >= 201703L
return std::uncaught_exceptions() > 0;
#else
return std::uncaught_exception();
#endif
}

namespace fakeit
{
Expand Down Expand Up @@ -9671,7 +9678,7 @@ m_timer.start();
Section::~Section() {
if( m_sectionIncluded ) {
SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
if( std::uncaught_exception() )
if( catch_uncaught_exceptions() )
getResultCapture().sectionEndedEarly( endInfo );
else
getResultCapture().sectionEnded( endInfo );
Expand Down Expand Up @@ -21063,7 +21070,7 @@ namespace fakeit
virtual ~StubbingChange() THROWS
{

if (std::uncaught_exception()) {
if (catch_uncaught_exceptions()) {
return;
}

Expand Down Expand Up @@ -21362,7 +21369,7 @@ namespace fakeit

~SequenceVerificationExpectation() THROWS
{
if (std::uncaught_exception()) {
if (catch_uncaught_exceptions()) {
return;
}
VerifyExpectation(_fakeit);
Expand Down Expand Up @@ -21788,7 +21795,7 @@ namespace fakeit

~VerifyNoOtherInvocationsExpectation() THROWS
{
if (std::uncaught_exception()) {
if (catch_uncaught_exceptions()) {
return;
}

Expand Down
Binary file removed 3rdparty/lcov-1.13.tar.gz
Binary file not shown.
72 changes: 72 additions & 0 deletions 3rdparty/libqxt/libqxt.qbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import qbs
import qbs.Probes

StaticLibrary {
id: product

name: "qxtglobalshortcut"
condition: product.qxt === undefined || !product.qxt.found

cpp.cxxLanguageVersion: platform.cxxLanguageVersion
cpp.includePaths: [
product.sourceDirectory + "/src/core",
product.sourceDirectory + "/src/widgets",
]
cpp.defines: ["QXT_STATIC=1"]
cpp.frameworks: platform.macOs ? base.concat(["Carbon", "Cocoa"]) : base

Group {
name: "Source Files"
files: [
"src/core/*.cpp",
"src/widgets/*.cpp",
]
}

Group {
name: "Header Files"
files: [
"src/core/*.h",
"src/widgets/*.h",
]
}

Group {
name: "Windows"
files: "src/widgets/win/qxtglobalshortcut_win.cpp"
condition: { return product.platform.windows; }
}

Group {
name: "Unix"
files: "src/widgets/x11/qxtglobalshortcut_x11.cpp"
condition: product.platform.unix
}

Group {
name: "MacOS"
files: "src/widgets/mac/qxtglobalshortcut_mac.cpp"
condition: product.platform.macOs
}

Depends { name: 'cpp' }
Depends { name: "platform" }
Depends { name: "Qt.core" }
Depends { name: "Qt.core-private" }
Depends { name: "Qt.gui-private" }
Depends { name: "Qt.widgets" }
Depends { name: "qxt"; condition: platform.unix }
Depends { name: "x11"; condition: platform.unix }

Export {
Depends { name: 'cpp' }
Depends { name: "Qt.core" }
Depends { name: "Qt.core-private" }
Depends { name: "Qt.gui-private" }
Depends { name: "Qt.widgets" }

cpp.includePaths: product.cpp.includePaths
cpp.cxxFlags: product.cxxFlags
cpp.linkerFlags: product.cxxFlags
}
}
80 changes: 0 additions & 80 deletions CMakeLists.txt

This file was deleted.

27 changes: 0 additions & 27 deletions CMakeSettings.json

This file was deleted.

81 changes: 40 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ MellowPlayer is licensed under the GPL license.

## Build dependencies

- cmake
- qbs >= 1.10
- a c++17 compiler (gcc6, msvc 2015 or clang)
- Qt5 (>= 5.9.0, QtWebEngine and QtQuickControls2 needed)
- Libnotify (optional, GNU/Linux only)
Expand All @@ -91,65 +91,64 @@ MellowPlayer is licensed under the GPL license.

# Compilation

Building MellowPlayer requires a **C++17** compiler:
Building MellowPlayer requires [Qbs](http://doc.qt.io/qbs/) >= 1.10 and a **C++17** compiler (GCC >= 6.x or Clang >= 3.5 or MSVC 2015 Update 2).

- GCC >= 6.x
- Clang >= 3.5
- MSVC 2015 Update 2
Qbs is a new build system from the Qt Company that is much easier to use compared to CMake, especially for Qt based projects.

## GNU/Linux
If you want to learn more, please read the [Qbs manual](http://doc.qt.io/qbs/index.html),
especially the [setup guide](http://doc.qt.io/qbs/configuring.html) and how to install artifacts
from the [installation guide](http://doc.qt.io/qbs/installing-files.html).

```bash
mkdir build && cd build
cmake ..
make
```
## From QtCreator

## OSX
Open up `mellowplayer.qbs` with QtCreator, hit build and run.

```bash
mkdir build && cd build
brew install qt5 cmake
cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 ..
make
```
## From Command Line

## Windows
Before you can build, you have to [setup qbs](http://doc.qt.io/qbs/configuring.html). This step must be done the first time you're building MellowPlayer and everytime you update your Qt version or toolchain.

### Setting up qbs

```bash
mkdir build && cd build
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
qbs-setup-toolchains --detect
qbs-setup-qt $(which qmake) qt5 # make sure that qmake is in PATH
qbs-config defaultProfile qt5
```
### Building MellowPlayer

# Build options

You can specify the following options when calling cmake:
```
qbs build release
```

- ``-DCMAKE_BUILD_TYPE=``: **Debug** or **Release** - Default is **Release**.
- ``-DDEFAULT_THEME=``: **Adaptive** by default. Can be set to any theme appearing in the theme combo box.
- ``-DBUILD_TESTS=``: **ON** or **OFF** - Default is **OFF**.
- ``-DENABLE_COVERAGE``: **ON** or **OFF** (requires ``BUILD_TEST=ON`` and ``CMAKE_BUILD_TYPE=Debug``) - Default is **OFF** .
- ``-ENABLE_LCOV_REPORT``: **ON** or **OFF** (requires ``BUILD_TEST=ON``, ``CMAKE_BUILD_TYPE=Debug`` and ``ENABLE_COVERAGE``) - Default is **OFF** .
*Note: If you're using qbs >= 1.11, replace ``release`` by ``config:release``*

Example build commands:
#### Build options

- release build:
```bash
cmake ..
```
- developer build command
You can append the following command line options when building MellowPlayer:

```bash
cmake -DBUILD_TESTS=ON -DENABLE_COVERAGE=ON -DENABLE_LCOV_REPORT=ON -DCMAKE_BUILD_TYPE=Debug ..
```
- ``projects.MellowPlayer.defaultTheme``:``<string>``: the name of the default theme. Can be set to any theme appearing in the theme combo box. Default value: "Adaptive".
- ``projects.MellowPlayer.buildTests``:``<bool>``: true to build mellowplayer test suite. Default value: false.
- ``projects.MellowPlayer.enableCoverage``:``<bool>``: true to enable code coverage build. Require a debug build config and a gcc compiler. Default value: false;

# Running the test suite

Make sure you've built MellowPlayer with -DBUILD_TEST.
Make sure you've built MellowPlayer with ``projects.MellowPlayer.buildTests:true``

```bash
qbs resolve debug projects.MellowPlayer.buildTests:true
qbs build debug projects.MellowPlayer.buildTests:true
```

To run the tests, just build one of the below products (either from QtCreator or from command line):

- ``tests``: run all tests (unit and integration tests)
- ``unit-tests``: run unit tests only
- ``integration-tests``: run integration tests only

Example from command line:

```bash
make test
qbs build -p tests debug
```

# Contributing
Expand Down
Loading