How does one link against CUDA "compatibility libs"

I am using CMake v3.18.0rc2 to build a CUDA program that uses CUDA 11, on Scientific Linux 7 (a CentOS-7 relative). The drivers for CUDA 11 are not available on CentOS-7 (they are for CentOS-8), so I have been advised to link against the “compatibility libraries” in /usr/local/cuda-11.0/compat. I have not been able to find documentation on how to do this using CMake.

The CMakeLists.txt fragment responsible for generating this executable is:

cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(cudaCuhre LANGUAGES CUDA CXX)
enable_testing()
find_package(MPI REQUIRED)
find_package(OpenMP REQUIRED)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

add_executable(test_cuhre_convergence test_cuhre_convergence.cu)
set_property(TARGET test_cuhre_convergence PROPERTY CUDA_ARCHITECTURES 70-real)
#target_compile_options(test_cuhre_convergence PRIVATE "-arch=sm_70")
set_target_properties(test_cuhre_convergence PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(test_cuhre_convergence util ${MPI_CXX_LIBRARIES} ${OpenMP_CXX_LIBRARIES} testmain)
target_include_directories(test_cuhre_convergence PRIVATE
  ${CMAKE_SOURCE_DIR}
  ${CMAKE_SOURCE_DIR}/externals
)
add_test(test_cuhre_convergence test_cuhre_convergence)

This generates a makefile that builds an executable, but the executable is not linked to the compatibility libraries mentioned, and so the executable fails at runtime with a complaint:

CUDA driver version is insufficient for CUDA runtime version

CMake extracts the cuda runtime and driver information from the compiler when it builds a test executable.

It would best to post the compile and link line(s) of your project. I expect that the compiler you are using is not picking up the correct compat libraries.

A suggestion from someone at Nvidia solved the problem: it is nothing to do with CMake.
Putting the directory /usr/local/cuda-11.0/compat before /usr/local/cuda-11.1/lib64 in LD_LIBRARY_PATH fixes the problem.