Skip to content

Commit

Permalink
Update build system
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Dec 2, 2023
1 parent 92c23a8 commit 64e8c16
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
38 changes: 6 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ project("Fluid"
LANGUAGES CXX C
)

## C++ standard:
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

## ECM:
find_package(ECM 5.245.0 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
Expand All @@ -32,41 +27,20 @@ include(KDECMakeSettings)
## QML module:
include(ECMQmlModule)

## Enable feature summary at the end of the configure run:
include(FeatureSummary)

## Features:
option(FLUID_WITH_DOCUMENTATION "Build documentation" ON)
add_feature_info("Fluid::Documentation" FLUID_WITH_DOCUMENTATION "Build Fluid documentation")
option(FLUID_WITH_DEMO "Build demo application" ON)
add_feature_info("Fluid::Demo" FLUID_WITH_DEMO "Build Fluid demo application")
option(FLUID_WITH_QML_MODULES "Build QML modules" ON)
add_feature_info("Fluid::QMLModules" FLUID_WITH_QML_MODULES "Build Fluid QML modules")
option(FLUID_INSTALL_ICONS "Install Material Design icons" ON)
add_feature_info("Fluid::Icons" FLUID_INSTALL_ICONS "Install Material Design icons")

## Find Qt:
find_package(Qt6
REQUIRED
COMPONENTS
Core
Gui
Svg
Qml
Quick
QuickControls2
QuickTest
)
include(features.cmake)

## Project setup:
qt6_standard_project_setup(REQUIRES 6.6)

## QML import path:
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE STRING "" FORCE)

## Disable use of C++ API deprecated in Qt 5.15
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)

## QML import path:
if(NOT QML_IMPORT_PATH)
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE STRING "" FORCE)
endif()

## Add subdirectories:
if(FLUID_WITH_DOCUMENTATION)
#add_subdirectory(doc)
Expand Down
34 changes: 34 additions & 0 deletions features.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2023 Pier Luigi Fiorini <[email protected]>
# SPDX-License-Identifier: BSD-3-Clause

## Enable feature summary at the end of the configure run:
include(FeatureSummary)

## Find Qt:
find_package(Qt6
REQUIRED
COMPONENTS
Core
Gui
Svg
Qml
Quick
QuickControls2
QuickTest
)

#### Features

option(FLUID_WITH_DOCUMENTATION "Build documentation" ON)
add_feature_info("Fluid::Documentation" FLUID_WITH_DOCUMENTATION "Build Fluid documentation")
option(FLUID_WITH_DEMO "Build demo application" ON)
add_feature_info("Fluid::Demo" FLUID_WITH_DEMO "Build Fluid demo application")
option(FLUID_WITH_QML_MODULES "Build QML modules" ON)
add_feature_info("Fluid::QMLModules" FLUID_WITH_QML_MODULES "Build Fluid QML modules")
option(FLUID_INSTALL_ICONS "Install Material Design icons" ON)
add_feature_info("Fluid::Icons" FLUID_INSTALL_ICONS "Install Material Design icons")

## Features summary:
if(NOT LIRI_SUPERBUILD)
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
endif()
4 changes: 0 additions & 4 deletions src/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ qt6_add_executable(FluidDemo
io.liri.Fluid.Demo.desktop
)

if(NOT QML_IMPORT_PATH)
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE STRING "" FORCE)
endif()

file(GLOB_RECURSE _images RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "images/*")
file(GLOB_RECURSE _qml RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "qml/*")
qt6_add_resources(FluidDemo "resources"
Expand Down

0 comments on commit 64e8c16

Please sign in to comment.