Skip to content

Commit 41e4c81

Browse files
authored
ci: enable CMake policies up to 3.24 (#9912)
The main motivation is to improve the customer experience with CMake under Windows. Until CMake 3.15 switching the MSVC runtime was a bit of a pain. We used `cmake_minimum_required(VERSION 3.10)` which has two effects: - It requires CMake to be >= 3.10 - It guarantees the CMake 3.10 behavior, even if you use 3.15 or 3.24 We do not want the 3.10 behavior on Windows, it requires too many steps to switch the MSVC runtime library.
1 parent e552dc9 commit 41e4c81

File tree

96 files changed

+96
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+96
-100
lines changed

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414
# limitations under the License.
1515
# ~~~
1616

17-
cmake_minimum_required(VERSION 3.10)
17+
cmake_minimum_required(VERSION 3.10...3.24)
1818

1919
# Define the project name and where to report bugs.
2020
set(PACKAGE_BUGREPORT "https://github.com/googleapis/google-cloud-cpp/issues")
2121

22-
# Enable support for SelectMSVCRuntime
23-
if (NOT (CMAKE_VERSION VERSION_LESS 3.15))
24-
cmake_policy(SET CMP0091 NEW)
25-
endif ()
2622
project(
2723
google-cloud-cpp
2824
VERSION 2.3.0

ci/verify_current_targets/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
# ~~~
1616

17-
cmake_minimum_required(VERSION 3.10)
17+
cmake_minimum_required(VERSION 3.10...3.24)
1818
project(verify-exported-targets CXX)
1919

2020
# We list the common libraries first because we want to load their packages

cmake/CompileProtos.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ function (google_cloud_cpp_load_protodeps var file)
272272
set(targets_to_omit
273273
"google-cloud-cpp::cloud_orgpolicy_v1_orgpolicy_protos"
274274
"google-cloud-cpp::cloud_oslogin_common_common_protos"
275+
"google-cloud-cpp::cloud_recommender_v1_recommender_protos"
275276
"google-cloud-cpp::identity_accesscontextmanager_type_type_protos")
276277
# Replace "google-cloud-cpp::$1" with "google-cloud-cpp:$2" in deps.
277278
set(target_substitutions
278279
"grafeas_v1_grafeas_protos\;grafeas_protos"
279280
"identity_accesscontextmanager_v1_accesscontextmanager_protos\;accesscontextmanager_protos"
280281
"cloud_osconfig_v1_osconfig_protos\;osconfig_protos"
281-
"cloud_recommender_v1_recommender_protos\;recommender_protos"
282282
"devtools_source_v1_source_protos\;devtools_source_v1_source_context_protos"
283283
)
284284

generator/internal/scaffold_generator.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ void GenerateQuickstartCMake(
849849
# This file shows how to use the $title$ C++ client library from a larger
850850
# CMake project.
851851
852-
cmake_minimum_required(VERSION 3.10)
852+
cmake_minimum_required(VERSION 3.10...3.24)
853853
project(google-cloud-cpp-$library$-quickstart CXX)
854854
855855
find_package(google_cloud_cpp_$library$ REQUIRED)

google/cloud/accessapproval/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Access Approval API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-accessapproval-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_accessapproval REQUIRED)

google/cloud/accesscontextmanager/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Access Context Manager API C++ client library
1616
# from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-accesscontextmanager-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_accesscontextmanager REQUIRED)

google/cloud/apigateway/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the API Gateway API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-apigateway-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_apigateway REQUIRED)

google/cloud/apigeeconnect/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Apigee Connect API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-apigeeconnect-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_apigeeconnect REQUIRED)

google/cloud/apikeys/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the API Keys API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-apikeys-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_apikeys REQUIRED)

google/cloud/appengine/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the App Engine Admin API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-appengine-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_appengine REQUIRED)

google/cloud/artifactregistry/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Artifact Registry API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-artifactregistry-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_artifactregistry REQUIRED)

google/cloud/asset/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Asset API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-asset-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_asset REQUIRED)

google/cloud/assuredworkloads/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Assured Workloads API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-assuredworkloads-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_assuredworkloads REQUIRED)

google/cloud/automl/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud AutoML API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-automl-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_automl REQUIRED)

google/cloud/baremetalsolution/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Bare Metal Solution API C++ client library from
1616
# a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-baremetalsolution-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_baremetalsolution REQUIRED)

google/cloud/batch/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Batch API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-batch-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_batch REQUIRED)

google/cloud/beyondcorp/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the BeyondCorp API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-beyondcorp-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_beyondcorp REQUIRED)

google/cloud/bigquery/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# A minimal CMakeList.txt showing how to use the Cloud BigQuery C++ client
1616
# library in CMake-based projects.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-bigquery-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_bigquery REQUIRED)

google/cloud/bigtable/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# A minimal CMakeList.txt showing how to use the Cloud Bigtable C++ client
1616
# library in CMake-based projects.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-bigtable-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_bigtable REQUIRED)

google/cloud/billing/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Billing Budget API C++ client library
1616
# from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-billing-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_billing REQUIRED)

google/cloud/binaryauthorization/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Binary Authorization API C++ client library
1616
# from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-binaryauthorization-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_binaryauthorization REQUIRED)

google/cloud/channel/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Channel API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-channel-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_channel REQUIRED)

google/cloud/cloudbuild/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Build API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-cloudbuild-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_cloudbuild REQUIRED)

google/cloud/composer/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Composer API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-composer-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_composer REQUIRED)

google/cloud/contactcenterinsights/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Contact Center AI Insights API C++ client
1616
# library from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-contactcenterinsights-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_contactcenterinsights REQUIRED)

google/cloud/container/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Kubernetes Engine API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-container-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_container REQUIRED)

google/cloud/containeranalysis/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Container Analysis API C++ client library from
1616
# a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-containeranalysis-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_containeranalysis REQUIRED)

google/cloud/datacatalog/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Google Cloud Data Catalog API C++ client
1616
# library from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-datacatalog-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_datacatalog REQUIRED)

google/cloud/datamigration/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Database Migration API C++ client library from
1616
# a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-datamigration-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_datamigration REQUIRED)

google/cloud/dataplex/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Dataplex API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-dataplex-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_dataplex REQUIRED)

google/cloud/dataproc/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Dataproc API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-dataproc-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_dataproc REQUIRED)

google/cloud/debugger/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Stackdriver Debugger API C++ client library
1616
# from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-debugger-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_debugger REQUIRED)

google/cloud/dialogflow_cx/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Dialogflow API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-dialogflow_cx-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_dialogflow_cx REQUIRED)

google/cloud/dialogflow_es/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Dialogflow API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-dialogflow_es-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_dialogflow_es REQUIRED)

google/cloud/dlp/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Data Loss Prevention (DLP) API C++ client
1616
# library from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-dlp-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_dlp REQUIRED)

google/cloud/documentai/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Document AI API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-documentai-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_documentai REQUIRED)

google/cloud/edgecontainer/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Distributed Cloud Edge Container API C++ client
1616
# library from a larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-edgecontainer-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_edgecontainer REQUIRED)

google/cloud/eventarc/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Eventarc API C++ client library from a larger
1616
# CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-eventarc-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_eventarc REQUIRED)

google/cloud/filestore/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Filestore API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-filestore-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_filestore REQUIRED)

google/cloud/functions/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Cloud Functions API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-functions-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_functions REQUIRED)

google/cloud/gameservices/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the Game Services API C++ client library from a
1616
# larger CMake project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-gameservices-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_gameservices REQUIRED)

google/cloud/gkehub/quickstart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# This file shows how to use the GKE Hub C++ client library from a larger CMake
1616
# project.
1717

18-
cmake_minimum_required(VERSION 3.10)
18+
cmake_minimum_required(VERSION 3.10...3.24)
1919
project(google-cloud-cpp-gkehub-quickstart CXX)
2020

2121
find_package(google_cloud_cpp_gkehub REQUIRED)

0 commit comments

Comments
 (0)