Skip to content
Open
27 changes: 12 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,21 @@ project(StyleSheets CXX)
set(StyleSheets_VERSION_MAJOR 0)
set(StyleSheets_VERSION_MINOR 1)

# Enable C++11
set(CMAKE_CXX_STANDARD 17)

# Enable C++17
include(CheckCXXCompilerFlag)
if(MSVC)
# Check if we are using Visual Studio 2015 or later
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
message(FATAL_ERROR "You are using an unsupported Windows compiler! (Visual C++ 2015 or later required)")
# Check if we are using Visual Studio 2017 or later
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15)
message(FATAL_ERROR "You are using an unsupported Windows compiler! (Visual C++ 2017 or later required)")
endif()
else()
set(cxx11_options -std=c++11)
CHECK_CXX_COMPILER_FLAG(${cxx11_options} COMPILER_SUPPORTS_CXX11)
set(cxx17_options -std=c++1z)
CHECK_CXX_COMPILER_FLAG(${cxx17_options} COMPILER_SUPPORTS_CXX17)

if(NOT COMPILER_SUPPORTS_CXX11)
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has insufficient C++11 support. Please use a different C++ compiler.")
if(NOT COMPILER_SUPPORTS_CXX17)
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has insufficient C++17 support. Please use a different C++ compiler.")
endif()
endif()

Expand All @@ -52,8 +54,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL Clang
set(warning_options
-Werror
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-c++1z-compat
-Wno-c++1z-compat-pedantic
-Wno-disabled-macro-expansion
-Wno-documentation-unknown-command
-Wno-exit-time-destructors
Expand Down Expand Up @@ -87,11 +89,6 @@ find_package(Qt5Qml 5.3.0 REQUIRED)
find_package(Qt5Test 5.3.0 REQUIRED)
find_package(Qt5QuickTest 5.3.0 REQUIRED)

if(DEFINED Boost_INCLUDE_DIR)
get_filename_component(Boost_INCLUDE_DIR ${Boost_INCLUDE_DIR} ABSOLUTE)
endif()
find_package(Boost 1.54 REQUIRED)

include(FeatureSummary)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ fewer lines of code through selectors that apply across many components.
Dependencies:

- Qt (>= 5.3)
- Boost (>= 1.54)
- CMake (>= 2.8.12)

Mac:
Expand All @@ -29,7 +28,7 @@ Mac:

Windows:

- Visual Studio 2015
- Visual Studio 2017


## Build and Test
Expand All @@ -50,10 +49,6 @@ The unit tests can be executed with ctest:
ctest -V -C Release
```

You might set the following variables:

- Boost_INCLUDE_DIR to the folder, where Boost headers are found

In case the CMake files shipped with Qt are not found, set the CMAKE_PREFIX_PATH
to the Qt installation prefix. See the
[Qt5 CMake manual](http://qt-project.org/doc/qt-5/cmake-manual.html) for more.
Expand Down
8 changes: 1 addition & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@ clone_depth: 5

environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
CMAKE_GENERATOR: "Visual Studio 14 2015 Win64"
BOOST_ROOT: C:\Libraries\boost_1_60_0
CMAKE_PREFIX_PATH: C:\Qt\5.6.3\msvc2015_64

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
BOOST_ROOT: C:\Libraries\boost_1_67_0
CMAKE_PREFIX_PATH: C:\Qt\5.11.3\msvc2017_64

install:
- set PATH=%PATH%;%CMAKE_PREFIX_PATH%\bin

build_script:
- mkdir build && cd build
- cmake .. -G"%CMAKE_GENERATOR%" -DBoost_INCLUDE_DIR=%BOOST_ROOT%
- cmake .. -G"%CMAKE_GENERATOR%"
- cmake --build . --config Release
- cmake --build . --config Release --target install

Expand Down
Loading