Author: Andreas Beckmann <anbe@debian.org>
Description: install *.cmake to CMAKE_INSTALL_DATADIR
Bug: https://github.com/NVIDIA/thrust/issues/1838

--- a/cmake/CubInstallRules.cmake
+++ b/cmake/CubInstallRules.cmake
@@ -4,7 +4,7 @@ if (CUB_IN_THRUST)
   return()
 endif()
 
-# Bring in CMAKE_INSTALL_LIBDIR
+# Bring in CMAKE_INSTALL_DATADIR
 include(GNUInstallDirs)
 
 # CUB is a header library; no need to build anything before installing:
@@ -17,12 +17,12 @@ install(DIRECTORY "${CUB_SOURCE_DIR}/cub
 )
 
 install(DIRECTORY "${CUB_SOURCE_DIR}/cub/cmake/"
-  DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cub"
+  DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/cub"
   PATTERN *.cmake.in EXCLUDE
 )
 # Need to configure a file to store the infix specified in
 # CMAKE_INSTALL_INCLUDEDIR since it can be defined by the user
-set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/cub")
+set(install_location "${CMAKE_INSTALL_DATADIR}/cmake/cub")
 configure_file("${CUB_SOURCE_DIR}/cub/cmake/cub-header-search.cmake.in"
   "${CUB_BINARY_DIR}/cub/cmake/cub-header-search.cmake"
   @ONLY)
