Skip to content

Commit ae62a98

Browse files
Reorder cmake targets and bump version
1 parent 682c013 commit ae62a98

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

.github/workflows/build-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
CXX: ${{matrix.config.CXX}}
3232
BUILD_DIR: "build/"
3333
run: |
34-
cmake -B ${BUILD_DIR} -DENABLE_CLI=OFF -DENABLE_QT=OFF -DENABLE_TEST=ON
34+
cmake -B ${BUILD_DIR} -DSKIP_CLI=ON -DSKIP_GUI=ON -DSKIP_KDE=ON -DENABLE_TEST=ON
3535
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
3636
ctest --test-dir ${BUILD_DIR} -V
3737
@@ -41,7 +41,7 @@ jobs:
4141
CXX: ${{matrix.config.CXX}}
4242
BUILD_DIR: "build-coverage/"
4343
run: |
44-
cmake -B ${BUILD_DIR} -DENABLE_CLI=OFF -DENABLE_QT=OFF -DENABLE_TEST_COVERAGE=ON
44+
cmake -B ${BUILD_DIR} -DSKIP_CLI=ON -DSKIP_GUI=ON -DSKIP_KDE=ON -DENABLE_TEST_COVERAGE=ON
4545
MAKEFLAGS=-j$(nproc) cmake --build ${BUILD_DIR}
4646
cmake --build ${BUILD_DIR} --target coverage
4747
if: matrix.config.CC == 'gcc'

CMakeLists.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
cmake_minimum_required(VERSION 3.12)
22

3-
project(MediaCopier VERSION 2.2.3)
3+
project(MediaCopier VERSION 2.3.0)
44

55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
88
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
99

10+
option(SKIP_GUI "Don't build graphical user interface" OFF)
11+
option(SKIP_CLI "Don't build command line interface" OFF)
12+
option(SKIP_KDE "Don't build KDE Plasma integration" OFF)
13+
option(USE_QT5 "Build against Qt5 libraries (legacy)" OFF)
14+
option(ENABLE_TEST "Enable test targets" OFF)
15+
option(ENABLE_TEST_COVERAGE "Enable test and coverage targets" OFF)
16+
option(INSTALL_DEV_FILES "Install library headers and cmake targets" OFF)
17+
1018
if(${MSVC})
1119
# range-v3 library needs permissive ruleset when compiled with MSVC
1220
# https://github.com/ericniebler/range-v3#supported-compilers
@@ -27,32 +35,24 @@ if(${MSVC})
2735
set(CLI_TARGET_FLAGS WIN32)
2836
endif()
2937

30-
option(ENABLE_CLI "Build cli tool" ON)
31-
option(ENABLE_QT "Build Qt5 based graphical user interface" OFF)
32-
option(ENABLE_QT6 "Build Qt6 based graphical user interface" OFF)
33-
option(ENABLE_KDE "Enable KDE Plasma integration for graphical user interface" OFF)
34-
option(ENABLE_TEST "Enable test targets" OFF)
35-
option(ENABLE_TEST_COVERAGE "Enable test and coverage targets" OFF)
36-
option(INSTALL_DEV_FILES "Install library headers and cmake targets" OFF)
37-
3838
set(MEDIACOPIER_CORE_LIB libmediacopier-core)
3939
set(MEDIACOPIER_UI_LIB libmediacopier-ui)
4040

4141
add_subdirectory(lib/core)
4242

43-
if(${ENABLE_CLI})
44-
add_subdirectory(app/mediacopier-cli)
45-
endif()
46-
47-
if(${ENABLE_QT} OR ${ENABLE_QT6} OR ${ENABLE_KDE})
43+
if(NOT ${SKIP_GUI} OR NOT ${SKIP_KDE})
4844
add_subdirectory(lib/ui)
4945
endif()
5046

51-
if(${ENABLE_QT} OR ${ENABLE_QT6})
47+
if(NOT ${SKIP_GUI})
5248
add_subdirectory(app/mediacopier)
5349
endif()
5450

55-
if(${ENABLE_KDE})
51+
if(NOT ${SKIP_CLI})
52+
add_subdirectory(app/mediacopier-cli)
53+
endif()
54+
55+
if(NOT ${SKIP_KDE})
5656
add_subdirectory(app/mediacopier-plasma)
5757
endif()
5858

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ podman run -it --rm -v ${PWD}:/usr/src/mediacopier mediacopier-build
103103
Inside the container, run the test suite with the following commands
104104

105105
```sh
106-
cmake -DUSE_QT5=ON -DSKIP_GUI=ON -DENABLE_TEST=ON /usr/src/mediacopier/ && make -j $(nproc) && make test
106+
cmake -DUSE_QT5=ON -DSKIP_GUI=ON -DSKIP_KDE=ON -DENABLE_TEST=ON /usr/src/mediacopier/ && make -j $(nproc) && make test
107107
```
108108

109109
Alternatively, create a test coverage report like this (result can also be found [here](https://coveralls.io/github/patrickziegler/MediaCopier))
110110

111111
```sh
112-
cmake -DUSE_QT5=ON -DSKIP_GUI=ON -DENABLE_TEST_COVERAGE=ON /usr/src/mediacopier/ && make -j $(nproc) && make coverage
112+
cmake -DUSE_QT5=ON -DSKIP_GUI=ON -DSKIP_KDE=ON -DENABLE_TEST_COVERAGE=ON /usr/src/mediacopier/ && make -j $(nproc) && make coverage
113113
```
114114

115115
### :paperclip: Build Instructions for Windows
@@ -123,7 +123,7 @@ Prepare the [vcpkg](https://github.com/microsoft/vcpkg#using-vcpkg-with-cmake) e
123123

124124
Use the vcpkg toolchain file with cmake
125125
```sh
126-
cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -B build -S .
126+
cmake -DCMAKE_TOOLCHAIN_FILE=${VCPKG_DIR}\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DSKIP_KDE=ON -B build -S .
127127
cmake --build build --config Release
128128
```
129129

app/mediacopier-plasma/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
set(KF_LIBS)
22

3-
if(ENABLE_QT6)
4-
find_package(KF6I18n REQUIRED)
5-
find_package(KF6JobWidgets REQUIRED)
6-
list(APPEND KF_LIBS KF6::I18n KF6::JobWidgets)
7-
set(KF_VERSION ${KF6I18n_VERSION})
8-
else()
3+
if(${USE_QT5})
94
find_package(KF5I18n REQUIRED)
105
find_package(KF5JobWidgets REQUIRED)
116
list(APPEND KF_LIBS KF5::I18n KF5::JobWidgets)
127
set(KF_VERSION ${KF5I18n_VERSION})
8+
else()
9+
find_package(KF6I18n REQUIRED)
10+
find_package(KF6JobWidgets REQUIRED)
11+
list(APPEND KF_LIBS KF6::I18n KF6::JobWidgets)
12+
set(KF_VERSION ${KF6I18n_VERSION})
1313
endif()
1414

1515
set(TARGET_NAME mediacopier-plasma)

app/mediacopier-plasma/source/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121

2222
#include <KJob>
2323
#include <KUiServerV2JobTracker>
24+
2425
#include <QApplication>
2526
#include <QTranslator>
27+
2628
#include <spdlog/spdlog.h>
2729

2830
class KMediaCopierJob : public KJob {

lib/core/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ if(${INSTALL_DEV_FILES})
126126
FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
127127
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
128128
DESTINATION "${TARGETS_INSTALL_DIR}")
129-
130-
elseif(${ENABLE_SHARED_LIB})
131-
install(TARGETS ${TARGET_NAME})
132-
133129
endif()
130+
131+
install(TARGETS ${TARGET_NAME})

lib/ui/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
set(QT_LIBS)
22

3-
if(ENABLE_QT6)
4-
find_package(Qt6 REQUIRED COMPONENTS Core Widgets StateMachine LinguistTools)
5-
list(APPEND QT_LIBS Qt6::Core Qt6::Widgets Qt6::StateMachine)
6-
else()
3+
if(${USE_QT5})
74
find_package(Qt5 REQUIRED COMPONENTS Core Widgets LinguistTools)
85
list(APPEND QT_LIBS Qt5::Core Qt5::Widgets)
6+
else()
7+
find_package(Qt6 REQUIRED COMPONENTS Core Widgets StateMachine LinguistTools)
8+
list(APPEND QT_LIBS Qt6::Core Qt6::Widgets Qt6::StateMachine)
99
endif()
1010

1111
find_package(spdlog 1.9.2 REQUIRED) # qt_sink_* available since v1.9.2

0 commit comments

Comments
 (0)