Skip to content

Commit

Permalink
cmake: bump minimum required version to 3.17
Browse files Browse the repository at this point in the history
also set cmake_policy version to 3.17...3.19 enabling all policies
present in CMake up until 3.19.
CMake 3.19 contains the newest policy we require (CMP0109) which makes
find_program() only check for executability but not readability which
allows to find sudo.
  • Loading branch information
arogge committed Nov 9, 2022
1 parent 4f18cc6 commit c24d6f7
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 38 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.17)
cmake_policy(VERSION 3.17...3.19)

project(bareos NONE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
1 change: 0 additions & 1 deletion contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
cmake_minimum_required(VERSION 3.0)
project(bareos-contrib)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
Expand Down
10 changes: 0 additions & 10 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.12)
project(bareos C CXX)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand All @@ -28,14 +26,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
)
endif()

cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0079 NEW)

if(POLICY CMP0109)
cmake_policy(SET CMP0109 NEW)
endif(POLICY CMP0109)

# disable in-source builds
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed.")
Expand Down
2 changes: 1 addition & 1 deletion core/platforms/packaging/bareos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ BuildRequires: git-core

Source0: %{name}-%{version}.tar.gz

BuildRequires: cmake >= 3.12
BuildRequires: cmake >= 3.17
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: make
Expand Down
3 changes: 1 addition & 2 deletions core/src/droplet/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2020-2020 Bareos GmbH & Co. KG
# Copyright (C) 2020-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -21,7 +21,6 @@ message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "Try to configure LibDroplet")
list(APPEND CMAKE_MESSAGE_INDENT " ")

cmake_minimum_required(VERSION 3.0)
project(droplet C)

set(default_build_type "Debug")
Expand Down
2 changes: 0 additions & 2 deletions core/src/droplet/libdroplet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.0)

add_library(
droplet STATIC
src/conn.c
Expand Down
1 change: 0 additions & 1 deletion core/src/fastlz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
cmake_minimum_required(VERSION 3.0)
project(bareosfastlz LANGUAGES C)

add_library(
Expand Down
3 changes: 0 additions & 3 deletions core/src/qt-tray-monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.0)
# (for AUTOUIC)

if(HAVE_WIN32)
add_definitions(-D_STAT_DEFINED=1)
endif()
Expand Down
3 changes: 1 addition & 2 deletions core/src/vmware/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2017-2020 Bareos GmbH & Co. KG
# Copyright (C) 2017-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -19,6 +19,5 @@
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.0)
add_subdirectory(vadp_dumper)
add_subdirectory(vmware_cbt_tool)
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Build-Depends: acl-dev,
apache2 | httpd,
bc,
chrpath,
cmake (>= 3.12.0) | cmake-mozilla,
cmake (>= 3.17.0) | cmake-mozilla,
debhelper (>= 7.0.50~),
dpkg-dev (>= 1.13.19),
libacl1-dev,
Expand Down
2 changes: 1 addition & 1 deletion debian/control.src
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Build-Depends: acl-dev,
apache2 | httpd,
bc,
chrpath,
cmake (>= 3.12.0) | cmake-mozilla,
cmake (>= 3.17.0) | cmake-mozilla,
debhelper (>= 7.0.50~),
dpkg-dev (>= 1.13.19),
libacl1-dev,
Expand Down
2 changes: 0 additions & 2 deletions docs/manuals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

cmake_minimum_required(VERSION 3.0)

project(bareos-docs NONE)

set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
Expand Down
5 changes: 3 additions & 2 deletions get_version.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2019-2019 Bareos GmbH & Co. KG
# Copyright (C) 2019-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or modify it under
# the terms of version three of the GNU Affero General Public License as
Expand All @@ -15,7 +15,8 @@
# with this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.17)
cmake_policy(VERSION 3.17...3.19)

if(NOT DEFINED VERSION_STRING)
set(CMAKE_MODULE_PATH
Expand Down
1 change: 0 additions & 1 deletion systemtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")

cmake_minimum_required(VERSION 3.3)
project(bareos-systemtests)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down
4 changes: 0 additions & 4 deletions systemtests/cmake/BareosSystemtestFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

cmake_policy(SET CMP0057 NEW) # IF(.. IN_LIST ..)
cmake_policy(SET CMP0053 NEW)
cmake_policy(SET CMP0064 NEW) # IF(TEST ...)

macro(create_systemtests_directory)
configurefilestosystemtest("systemtests" "data" "*.tgz" COPYONLY "")
configurefilestosystemtest("systemtests" "data" "*.gz" COPYONLY "")
Expand Down
3 changes: 1 addition & 2 deletions webui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2018-2021 Bareos GmbH & Co. KG
# Copyright (C) 2018-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand All @@ -17,7 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
message("Entering ${CMAKE_CURRENT_SOURCE_DIR}")
cmake_minimum_required(VERSION 3.0)
project(bareos-webui)

include(GNUInstallDirs)
Expand Down
5 changes: 3 additions & 2 deletions write_version_files.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2019-2021 Bareos GmbH & Co. KG
# Copyright (C) 2019-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or modify it under
# the terms of version three of the GNU Affero General Public License as
Expand All @@ -15,7 +15,8 @@
# with this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.17)
cmake_policy(VERSION 3.17...3.19)

set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_LIST_DIR}/cmake" "${CMAKE_CURRENT_LIST_DIR}/core/cmake"
Expand Down

0 comments on commit c24d6f7

Please sign in to comment.