diff options
-rw-r--r-- | Help/release/3.19.rst | 2 | ||||
-rw-r--r-- | Modules/CPack.cmake | 44 | ||||
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 2 | ||||
-rw-r--r-- | Modules/FindBoost.cmake | 10 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 4 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 4 |
6 files changed, 45 insertions, 21 deletions
diff --git a/Help/release/3.19.rst b/Help/release/3.19.rst index 6e46452..7f6e44c 100644 --- a/Help/release/3.19.rst +++ b/Help/release/3.19.rst @@ -51,6 +51,8 @@ Languages - separable compilation (:prop_tgt:`CUDA_SEPARABLE_COMPILATION`), and - finding scattered toolkit installations when cross-compiling. +* ``CUDA`` language support now works on QNX. + File-Based API -------------- diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 8a0ef30..7529a1f 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -357,7 +357,7 @@ The following variables are for advanced uses of CPack: .. variable:: CPACK_INSTALL_SCRIPTS Extra CMake scripts executed by CPack during its local staging - installation, which is done right before packaging the files. + installation. They are executed before installing the files to be packaged. The scripts are not called by a standalone install (e.g.: ``make install``). For every script, the following variables will be set: :variable:`CMAKE_CURRENT_SOURCE_DIR`, :variable:`CMAKE_CURRENT_BINARY_DIR` @@ -366,6 +366,33 @@ The following variables are for advanced uses of CPack: an alternative variable for historical reasons, but its value is ignored if ``CMAKE_INSTALL_SCRIPTS`` is set and a warning will be issued. + See also :variable:`CPACK_PRE_BUILD_SCRIPTS` and + :variable:`CPACK_POST_BUILD_SCRIPTS` which can be used to specify scripts + to be executed later in the packaging process. + +.. variable:: CPACK_PRE_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has installed the files to + be packaged into a staging directory and before producing the package(s) + from those files. See also :variable:`CPACK_INSTALL_SCRIPTS` and + :variable:`CPACK_POST_BUILD_SCRIPTS`. + +.. variable:: CPACK_POST_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has produced the resultant + packages and before copying them back to the build directory. + See also :variable:`CPACK_INSTALL_SCRIPTS`, + :variable:`CPACK_PRE_BUILD_SCRIPTS` and :variable:`CPACK_PACKAGE_FILES`. + +.. variable:: CPACK_PACKAGE_FILES + + List of package files created in the staging directory, with each file + provided as a full absolute path. This variable is populated by CPack + just before invoking the post-build scripts listed in + :variable:`CPACK_POST_BUILD_SCRIPTS`. It is the preferred way for the + post-build scripts to know the set of package files to operate on. + Projects should not try to set this variable themselves. + .. variable:: CPACK_INSTALLED_DIRECTORIES Extra directories to install. @@ -390,21 +417,6 @@ The following variables are for advanced uses of CPack: select the CPack generator(s) to be used when building the ``package`` target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option. -.. variable:: CPACK_PRE_BUILD_SCRIPTS - - List of CMake scripts to execute after CPack has installed the files to - be packed into a staging directory and before producing the result - packages. - -.. variable:: CPACK_POST_BUILD_SCRIPTS - - List of CMake scripts to execute after CPack has produced the result - packages and before copying them back to a build directory. - -.. variable:: CPACK_PACKAGE_FILES - - List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``. - #]=======================================================================] # Define this var in order to avoid (or warn) concerning multiple inclusion diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake index 1a724a0..95a51f6 100644 --- a/Modules/Compiler/NVIDIA-CUDA.cmake +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -64,7 +64,7 @@ set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static") set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart") set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "") -if(UNIX) +if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl") endif() diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 77868f4..00e4ff1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -450,13 +450,19 @@ if (NOT Boost_NO_BOOST_CMAKE) # Do the same find_package call but look specifically for the CMake version. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no # need to delegate them to this find_package call. - cmake_policy(PUSH) if(BOOST_ROOT AND NOT Boost_ROOT) + # Honor BOOST_ROOT by setting Boost_ROOT with CMP0074 NEW behavior. + cmake_policy(PUSH) cmake_policy(SET CMP0074 NEW) set(Boost_ROOT "${BOOST_ROOT}") + set(_Boost_ROOT_FOR_CONFIG 1) endif() find_package(Boost QUIET NO_MODULE ${_boost_FIND_PACKAGE_ARGS}) - cmake_policy(POP) + if(_Boost_ROOT_FOR_CONFIG) + unset(_Boost_ROOT_FOR_CONFIG) + unset(Boost_ROOT) + cmake_policy(POP) + endif() if (DEFINED Boost_DIR) mark_as_advanced(Boost_DIR) endif () diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index a93d4fd..f04f571 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -732,6 +732,8 @@ if(CMAKE_CROSSCOMPILING) # Support for aarch64 cross compilation if (ANDROID_ARCH_NAME STREQUAL "arm64") set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") + elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(CUDA_TOOLKIT_TARGET_NAME "aarch64-qnx") else() set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") endif (ANDROID_ARCH_NAME STREQUAL "arm64") @@ -902,7 +904,7 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME) find_package(Threads REQUIRED) set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) - if(NOT APPLE) + if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) #On Linux, you must link against librt when using the static cuda runtime. find_library(CUDA_rt_LIBRARY rt) if (NOT CUDA_rt_LIBRARY) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index b4599a3..b3c8569 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -678,6 +678,8 @@ if(CMAKE_CROSSCOMPILING) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") if(ANDROID_ARCH_NAME STREQUAL "arm64") set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi") + elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(CUDAToolkit_TARGET_NAME "aarch64-qnx") else() set(CUDAToolkit_TARGET_NAME "aarch64-linux") endif(ANDROID_ARCH_NAME STREQUAL "arm64") @@ -860,7 +862,7 @@ if(CUDAToolkit_FOUND) target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS}) endif() - if(UNIX AND NOT APPLE) + if(UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX")) # On Linux, you must link against librt when using the static cuda runtime. find_library(CUDAToolkit_rt_LIBRARY rt) mark_as_advanced(CUDAToolkit_rt_LIBRARY) |