CMake和MsVS-NuGet [英] CMake and MsVS-NuGet
问题描述
我目前正在开发一个桌面应用程序,使用C ++ REST SDK(代号为Casablanca),Qt5和其他一些库。
I'm currently developing a desktop application, using the C++ REST SDK (codename Casablanca), Qt5 and some other libraries.
CMake。
如何获取CMake安装NuGet包?
How to get CMake to install NuGet Packages?
我现在必须手动安装,如果我重新运行CMake,这不是一个真正的选项。
I now have to install it each time manually, if I rerun CMake, which isn't really an option.
推荐答案
NuGet的命令行参考位于 http://docs.nuget.org/docs/reference/command-line-reference
The command line reference of NuGet is located at http://docs.nuget.org/docs/reference/command-line-reference
您可以使用 nuget install
或 nuget restore
命令安装软件包。 nuget更新
更新已安装的软件包( restore
必须运行beforhand)。
You can install packages using the nuget install
or nuget restore
command. nuget update
updates the installed packages (restore
must be run beforhand).
您可以使用以下命令指示cmake在每次构建之前运行NuGet:
You can instruct cmake to run NuGet before every build by using:
add_custom_command(TARGET ${PROJECT_NAME}
PRE_BUILD
COMMAND nuget restore ${CMAKE_BINARY_DIR}\yourSolution.sln
)
$ b b
或在配置时使用 execute_process
。
您可以使用<$ c准备nuget配置文件$ c> configure_file 或直接使用适当的 nuget install
命令。
You can prepare the nuget config file using configure_file
or use appropriate nuget install
commands directly.
这篇关于CMake和MsVS-NuGet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!