summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-09-16 12:16:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-09-16 12:16:54 (GMT)
commit1b91aaecd8ab707e1f245bc911baebd55637881a (patch)
tree5278baf7e69de4e030c9acc95d81e7a05fb23f03 /Tests
parent86d0d78f2e6d39d22878b2a15f66ec854ed06848 (diff)
parentb6ac10394b88b476f069ba75426c1556ab8bfe00 (diff)
downloadCMake-1b91aaecd8ab707e1f245bc911baebd55637881a.zip
CMake-1b91aaecd8ab707e1f245bc911baebd55637881a.tar.gz
CMake-1b91aaecd8ab707e1f245bc911baebd55637881a.tar.bz2
Merge topic 'vs2022'
b6ac10394b VS: Update Visual Studio 17 2022 generator for Preview 4 f200f4d5a7 VS: Fix managed C++ project generation for VS 2022 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6524
Diffstat (limited to 'Tests')
-rw-r--r--Tests/VSWindowsFormsResx/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt
index 43c4833..b9b2163 100644
--- a/Tests/VSWindowsFormsResx/CMakeLists.txt
+++ b/Tests/VSWindowsFormsResx/CMakeLists.txt
@@ -33,6 +33,12 @@ set(TARGET_RESX
set(TARGET_LIBRARIES ${SYSLIBS})
add_executable(${PROJECT_NAME} ${TARGET_SRC} ${TARGET_H} ${TARGET_RESX})
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 1[0-6]")
+ # VS 17 2022 and above require a global mark on managed assemblies.
+ # CMake adds this automatically when using COMMON_LANGUAGE_RUNTIME,
+ # but this test covers direct use of /clr.
+ set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_ManagedAssembly "true")
+endif()
# Note: The property VS_GLOBAL_KEYWORD must be set.
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_KEYWORD "ManagedCProj")