summaryrefslogtreecommitdiffstats
path: root/Tests/ExportImport
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-11-01 12:12:05 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2019-12-10 22:56:48 (GMT)
commit2467a2b3184595a87e93db510408fc14ddbaf3b9 (patch)
tree37e35f4a3c821634cc18c6cd8df8acf2391d4f5c /Tests/ExportImport
parentf62c674202045f877eaed9da0f9cbe2046452b40 (diff)
downloadCMake-2467a2b3184595a87e93db510408fc14ddbaf3b9.zip
CMake-2467a2b3184595a87e93db510408fc14ddbaf3b9.tar.gz
CMake-2467a2b3184595a87e93db510408fc14ddbaf3b9.tar.bz2
CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) support
Diffstat (limited to 'Tests/ExportImport')
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt7
-rw-r--r--Tests/ExportImport/InitialCache.cmake.in1
3 files changed, 20 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 9d8a248..4d411a9 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -646,6 +646,18 @@ if(CMAKE_GENERATOR MATCHES "Make|Ninja")
export(TARGETS testLinkDepends NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake)
endif()
+#------------------------------------------------------------------------------
+# test export of CUDA language
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+ add_library(cudaInterfaceLib INTERFACE)
+ target_compile_features(cudaInterfaceLib INTERFACE $<BUILD_INTERFACE:cuda_std_11> $<INSTALL_INTERFACE:cuda_std_14>)
+
+ install(TARGETS cudaInterfaceLib
+ EXPORT RequiredExp DESTINATION lib)
+ export(TARGETS cudaInterfaceLib NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake)
+endif()
+
# Test the presence of targets named the same as languages.
# IMPORTED_LINK_INTERFACE_LANGUAGES entries should not be targets.
add_library(C INTERFACE)
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index b5df961..c5304da 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -499,3 +499,10 @@ if(CMAKE_GENERATOR MATCHES "Make|Ninja")
checkForProperty(bld_testLinkDepends "INTERFACE_LINK_DEPENDS" "BUILD_LINK_DEPENDS")
checkForProperty(Req::testLinkDepends "INTERFACE_LINK_DEPENDS" "${CMAKE_INSTALL_PREFIX}/INSTALL_LINK_DEPENDS")
endif()
+
+#------------------------------------------------------------------------------
+# test import of CUDA language level
+if(CMake_TEST_CUDA)
+ checkForProperty(bld_cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_11")
+ checkForProperty(Req::cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_14")
+endif()
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index f600d90..44cd179 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -14,3 +14,4 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRI
set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix")
set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH")
set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS")
+set(CMake_TEST_CUDA "@CMake_TEST_CUDA@" CACHE BOOL "CMake_TEST_CUDA")