Skip to content

Commit 389b9ab

Browse files
committed
Remove support for CMake <3.22
This project no longer supports Ubuntu 20.04 and in turn the workarounds for CMake 3.16 are no longer needed. The new minimum version is determined by Ubuntu 22.04.
1 parent 8168811 commit 389b9ab

File tree

6 files changed

+12
-35
lines changed

6 files changed

+12
-35
lines changed

CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See LICENSE file.
66
##############################################################################
77

8-
cmake_minimum_required(VERSION 3.16)
8+
cmake_minimum_required(VERSION 3.22)
99

1010
project(emv-utils
1111
VERSION 0.3.1
@@ -15,15 +15,7 @@ project(emv-utils
1515
)
1616

1717
# Determine whether this project is the top-level project
18-
if(${CMAKE_VERSION} VERSION_LESS "3.21")
19-
get_directory_property(EMV_UTILS_HAS_PARENT PARENT_DIRECTORY)
20-
if(NOT EMV_UTILS_HAS_PARENT)
21-
set(EMV_UTILS_IS_TOP_LEVEL True)
22-
endif()
23-
else()
24-
# CMake >=3.21 provides <PROJECT-NAME>_IS_TOP_LEVEL
25-
set(EMV_UTILS_IS_TOP_LEVEL ${emv-utils_IS_TOP_LEVEL})
26-
endif()
18+
set(EMV_UTILS_IS_TOP_LEVEL ${emv-utils_IS_TOP_LEVEL})
2719

2820
# Configure compiler
2921
set(CMAKE_C_STANDARD 11)

cmake/Modules/FindIsoCodes.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##############################################################################
2-
# Copyright 2021 Leon Lynch
2+
# Copyright 2021, 2026 Leon Lynch
33
#
44
# This file is licensed under the terms of the LGPL v2.1 license.
55
# See LICENSE file.
@@ -13,7 +13,7 @@
1313
# IsoCodes_DOMAINS
1414
# IsoCodes_JSON_PATH
1515

16-
cmake_minimum_required(VERSION 3.12) # For list(TRANSFORM...)
16+
cmake_minimum_required(VERSION 3.22)
1717

1818
# Use PkgConfig to find iso-codes
1919
find_package(PkgConfig REQUIRED)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See LICENSE file.
66
##############################################################################
77

8-
cmake_minimum_required(VERSION 3.16)
8+
cmake_minimum_required(VERSION 3.22)
99

1010
# Check whether C99 length modifier 'z' is supported
1111
include(CheckCSourceRuns)

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
##############################################################################
2-
# Copyright 2021-2025 Leon Lynch
2+
# Copyright 2021-2026 Leon Lynch
33
#
44
# This file is licensed under the terms of the LGPL v2.1 license.
55
# See LICENSE file.
66
##############################################################################
77

8-
cmake_minimum_required(VERSION 3.16)
8+
cmake_minimum_required(VERSION 3.22)
99

1010
if (BUILD_TESTING)
1111
add_library(emv_cardreader_emul OBJECT EXCLUDE_FROM_ALL emv_cardreader_emul.c)

tools/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See LICENSE file.
66
##############################################################################
77

8-
cmake_minimum_required(VERSION 3.16)
8+
cmake_minimum_required(VERSION 3.22)
99

1010
# Build command line tools by default
1111
option(BUILD_EMV_DECODE "Build emv-decode" ON)

viewer/CMakeLists.txt

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# See LICENSE.gpl file.
66
##############################################################################
77

8-
cmake_minimum_required(VERSION 3.16)
8+
cmake_minimum_required(VERSION 3.22)
99

1010
project(emv-viewer
1111
VERSION 0.3.1
@@ -15,15 +15,7 @@ project(emv-viewer
1515
)
1616

1717
# Determine whether this project is the top-level project
18-
if(${CMAKE_VERSION} VERSION_LESS "3.21")
19-
get_directory_property(EMV_VIEWER_HAS_PARENT PARENT_DIRECTORY)
20-
if(NOT EMV_VIEWER_HAS_PARENT)
21-
set(EMV_VIEWER_IS_TOP_LEVEL True)
22-
endif()
23-
else()
24-
# CMake >=3.21 provides <PROJECT-NAME>_IS_TOP_LEVEL
25-
set(EMV_VIEWER_IS_TOP_LEVEL ${emv-viewer_IS_TOP_LEVEL})
26-
endif()
18+
set(EMV_VIEWER_IS_TOP_LEVEL ${emv-viewer_IS_TOP_LEVEL})
2719

2820
# Configure compiler
2921
set(CMAKE_CXX_STANDARD 14)
@@ -160,15 +152,8 @@ if(QT_VERSION VERSION_LESS 5.15)
160152
qt5_wrap_cpp(MOC_SRCS ${EMV_VIEWER_MOC_HEADERS})
161153
qt5_add_resources(QRC_SRCS icons.qrc)
162154

163-
if(CMAKE_VERSION VERSION_LESS "3.18")
164-
# CMake versions older than 3.18 cannot create alias targets for
165-
# non-global imported targets and an alternative is to use INTERFACE
166-
# linking instead
167-
add_library(Qt::Widgets INTERFACE IMPORTED)
168-
set_target_properties(Qt::Widgets PROPERTIES INTERFACE_LINK_LIBRARIES Qt5::Widgets)
169-
else()
170-
add_library(Qt::Widgets ALIAS Qt5::Widgets)
171-
endif()
155+
# Create alias targets for compatibility with newer Qt versions
156+
add_library(Qt::Widgets ALIAS Qt5::Widgets)
172157
else()
173158
# Qt-5.15 and Qt-6 provide these version-less commands
174159
qt_wrap_ui(UI_SRCS emv-viewer-mainwindow.ui)

0 commit comments

Comments
 (0)