diff options
author | Kinan Mahdi <kinan.mahdi@gmail.com> | 2020-06-03 22:20:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-05 12:01:59 (GMT) |
commit | 3fd07d30bfdb35fa1f807d58da7bcf18cfb037b2 (patch) | |
tree | 57d854ec0c63b42075ea342fd95fcef7bd799114 /Tests/RunCMake/VS10Project/VsPackageReferences.cmake | |
parent | 3414ee155e0423284a9171497d7724828fd324a5 (diff) | |
download | CMake-3fd07d30bfdb35fa1f807d58da7bcf18cfb037b2.zip CMake-3fd07d30bfdb35fa1f807d58da7bcf18cfb037b2.tar.gz CMake-3fd07d30bfdb35fa1f807d58da7bcf18cfb037b2.tar.bz2 |
VS: Enable DOTNET_TARGET_FRAMEWORK properties all target types
This makes them compatible with `VS_PACKAGE_REFERENCES` and, in
particular, fixes nuget package references in combination with install
targets.
Fixes: #20764
Diffstat (limited to 'Tests/RunCMake/VS10Project/VsPackageReferences.cmake')
-rw-r--r-- | Tests/RunCMake/VS10Project/VsPackageReferences.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences.cmake index 224ab18..30e8fd4 100644 --- a/Tests/RunCMake/VS10Project/VsPackageReferences.cmake +++ b/Tests/RunCMake/VS10Project/VsPackageReferences.cmake @@ -1,4 +1,13 @@ enable_language(CXX) +set(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2") + add_library(foo foo.cpp) set_property(TARGET foo PROPERTY VS_PACKAGE_REFERENCES "boost_1.7.0;SFML_2.2.0") + +# install and export the targets to test the correct behavior +# nuget restore will only work with an install target when the correct +# target framework version is set +set(INSTALL_CMAKE_DIR CMake) +install(TARGETS foo EXPORT foo_Export_Target) +install(EXPORT foo_Export_Target DESTINATION ${INSTALL_CMAKE_DIR} FILE fooConfig.cmake) |