From ecaf1062cbd25fbc9e2b12c0af16b532351fb3f1 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 16 Apr 2021 13:45:54 -0500 Subject: [PATCH 1/2] Update to CPM with fix for FETCHCONTENT_BASE_DIR --- cpp/cmake/thirdparty/CUSPATIAL_GetCPM.cmake | 23 +++++++-------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/cpp/cmake/thirdparty/CUSPATIAL_GetCPM.cmake b/cpp/cmake/thirdparty/CUSPATIAL_GetCPM.cmake index d78f62359..8927f3733 100644 --- a/cpp/cmake/thirdparty/CUSPATIAL_GetCPM.cmake +++ b/cpp/cmake/thirdparty/CUSPATIAL_GetCPM.cmake @@ -1,6 +1,8 @@ -set(CPM_DOWNLOAD_VERSION 3b404296b539e596f39421c4e92bc803b299d964) # v0.27.5 +set(CPM_DOWNLOAD_VERSION 7644c3a40fc7889f8dee53ce21e85dc390b883dc) # v0.32.1 if(CPM_SOURCE_CACHE) + # Expand relative path. This is important if the provided path contains a tilde (~) + get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") elseif(DEFINED ENV{CPM_SOURCE_CACHE}) set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") @@ -9,28 +11,17 @@ else() endif() if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) - message(STATUS "CUSPATIAL: Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") + message(VERBOSE "CUSPATIAL: Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") file( DOWNLOAD - https://raw.githubusercontent.com/TheLartians/CPM.cmake/${CPM_DOWNLOAD_VERSION}/cmake/CPM.cmake + https://raw.githubusercontent.com/cpm-cmake/CPM.cmake/${CPM_DOWNLOAD_VERSION}/cmake/CPM.cmake ${CPM_DOWNLOAD_LOCATION}) endif() include(${CPM_DOWNLOAD_LOCATION}) -function(cuspatial_save_if_enabled var) - if(CUSPATIAL_${var}) - unset(${var} PARENT_SCOPE) - unset(${var} CACHE) - endif() -endfunction() - -function(cuspatial_restore_if_enabled var) - if(CUSPATIAL_${var}) - set(${var} ON CACHE INTERNAL "" FORCE) - endif() -endfunction() - +# If a target is installed, found by the `find_package` step of CPMFindPackage, +# and marked as IMPORTED, make it globally accessible to consumers of our libs. function(fix_cmake_global_defaults target) if(TARGET ${target}) get_target_property(_is_imported ${target} IMPORTED) From f4f4fc9f6018249b45104bf12b164a59f6d67bd7 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 16 Apr 2021 14:23:45 -0500 Subject: [PATCH 2/2] remove dead code --- cpp/cmake/thirdparty/CUSPATIAL_GetCUDF.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cpp/cmake/thirdparty/CUSPATIAL_GetCUDF.cmake b/cpp/cmake/thirdparty/CUSPATIAL_GetCUDF.cmake index 07be7aea6..20862bf48 100644 --- a/cpp/cmake/thirdparty/CUSPATIAL_GetCUDF.cmake +++ b/cpp/cmake/thirdparty/CUSPATIAL_GetCUDF.cmake @@ -20,8 +20,6 @@ function(find_and_configure_cudf VERSION) return() endif() - cuspatial_save_if_enabled(BUILD_TESTS) - cuspatial_save_if_enabled(BUILD_BENCHMARKS) CPMFindPackage(NAME cudf VERSION ${VERSION} GIT_REPOSITORY https://github.com/rapidsai/cudf.git @@ -31,8 +29,6 @@ function(find_and_configure_cudf VERSION) OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" FIND_PACKAGE_ARGUMENTS "COMPONENTS testing") - cuspatial_restore_if_enabled(BUILD_TESTS) - cuspatial_restore_if_enabled(BUILD_BENCHMARKS) # Make sure consumers of cuspatial can see cudf::cudf fix_cmake_global_defaults(cudf::cudf)