-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
340 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,52 @@ | ||
cmake_minimum_required(VERSION 3.17.5) | ||
|
||
# Check for Qt version in given arguments. Fallback to Qt5. | ||
if (NOT DEFINED QT_DEFAULT_MAJOR_VERSION) | ||
set(QT_DEFAULT_MAJOR_VERSION 5) | ||
endif() | ||
message("-- Using Qt${QT_DEFAULT_MAJOR_VERSION}") | ||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
# Custom CMake modules. | ||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
include(DeployQt) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
# Enable parallel build (not enabled by default on Windows). | ||
set(CMAKE_BUILD_PARALLEL_LEVEL $ENV{NUMBER_OF_PROCESSORS}) | ||
|
||
# Set project information. | ||
project("qlementine" | ||
LANGUAGES CXX | ||
VERSION 1.0.0.0 | ||
DESCRIPTION "Modern QStyle for desktop Qt applications." | ||
) | ||
set(PROJECT_COPYRIGHT "© Olivier Cléro, MIT License.") | ||
set(PROJECT_NAMESPACE "oclero") | ||
|
||
# Temporary hack to make it work with Qt6 <6.4.2 && >6.4.2 | ||
# With Qt5, it was "path/to/Qt/6.7.0/msvc2019_64/lib/cmake/Qt6", | ||
# but with Qt6, it is now "path/to/Qt/6.7.0/msvc2019_64". | ||
string(FIND ${CMAKE_PREFIX_PATH} "/lib/cmake/Qt6" USING_Qt6_INDEX) | ||
if(NOT ${USING_Qt6_INDEX} EQUAL -1) | ||
string(REPLACE "/lib/cmake/Qt6" "" ${CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) | ||
endif() | ||
|
||
# Global flags. | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.6") | ||
|
||
# Find Qt. | ||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) | ||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Widgets Svg) | ||
|
||
if(${QT_VERSION_MAJOR} STREQUAL "6") | ||
qt_standard_project_setup() | ||
endif() | ||
|
||
include(DeployQt) | ||
|
||
# The library. | ||
add_subdirectory(lib) | ||
|
||
# Sandbox. | ||
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) | ||
if(${PROJECT_IS_TOP_LEVEL}) | ||
add_subdirectory(sandbox) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
{ | ||
"version": 6, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 17, | ||
"patch": 5 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "macos", | ||
"displayName": "macOS", | ||
"description": "Xcode project for macOS", | ||
"generator": "Xcode", | ||
"binaryDir": "${sourceDir}/_build", | ||
"cacheVariables": { | ||
"QT_DIR": "/opt/homebrew/opt/qt/lib/cmake/Qt6" | ||
}, | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Darwin" | ||
} | ||
}, | ||
{ | ||
"name": "windows", | ||
"displayName": "Windows", | ||
"description": "Visual Studio project for Windows", | ||
"generator": "Visual Studio 17 2022", | ||
"binaryDir": "${sourceDir}/_build", | ||
"cacheVariables": { | ||
"CMAKE_PREFIX_PATH": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5" | ||
}, | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
}, | ||
{ | ||
"name": "linux", | ||
"displayName": "Linux", | ||
"description": "Makefile for Linux", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/_build", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Linux" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "macos", | ||
"displayName": "macOS", | ||
"configurePreset": "macos", | ||
"description": "Release build with Xcode for macOS", | ||
"targets": ["qlementine"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Darwin" | ||
} | ||
}, | ||
{ | ||
"name": "macos-sandbox", | ||
"displayName": "Sandbox for macOS", | ||
"configurePreset": "macos", | ||
"description": "Sandbox - Release build with Xcode for macOS", | ||
"targets": ["sandbox"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Darwin" | ||
} | ||
}, | ||
{ | ||
"name": "windows", | ||
"displayName": "Windows", | ||
"configurePreset": "windows", | ||
"description": "Release build with Visual Studio for Windows", | ||
"targets": ["qlementine"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
}, | ||
{ | ||
"name": "windows-sandbox", | ||
"displayName": "Sandbox for Windows", | ||
"configurePreset": "windows", | ||
"description": "Sandbox - Release build with Visual Studio for Windows", | ||
"targets": ["sandbox"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
}, | ||
{ | ||
"name": "linux", | ||
"displayName": "Linux", | ||
"configurePreset": "linux", | ||
"description": "Release build for Linux", | ||
"targets": ["qlementine"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Linux" | ||
} | ||
}, | ||
{ | ||
"name": "linux-sandbox", | ||
"displayName": "Sandbox for Linux", | ||
"configurePreset": "linux", | ||
"description": "Sandbox - Release build for Linux", | ||
"targets": ["sandbox"], | ||
"configuration": "Release", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Linux" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.