mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
This makes them compatible with `VS_PACKAGE_REFERENCES` and, in particular, fixes nuget package references in combination with install targets. Fixes: #20764
14 lines
512 B
CMake
14 lines
512 B
CMake
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)
|