仅通过命令行在Windows上运行CMake生成的INSTALL.vcxproj吗? [英] Run a CMake-generated INSTALL.vcxproj on Windows via command line only?

查看:795
本文介绍了仅通过命令行在Windows上运行CMake生成的INSTALL.vcxproj吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++程序,试图在AppVeyor上构建和部署(因此,我没有可用的GUI工具).我项目的依赖项均使用CMake作为其构建系统,而CMake(默认情况下)在Windows上生成Visual Studio项目文件.

I have a C++ program that I'm trying to build and deploy on AppVeyor (thus, I have no GUI tools available). The dependencies of my project each use CMake for their build systems, and CMake (by default) generates Visual Studio project files on Windows.

其中一个生成的项目文件名为INSTALL.vcxproj,它大概将依赖项安装在或多或少的标准位置. 如何仅使用命令行执行INSTALL.vcxproj的构建过程?

One of the generated project files is named INSTALL.vcxproj, which presumably installs the dependency somewhere more or less standard. How can I execute the build process of INSTALL.vcxproj using only the command line?

注意::我还没有嫁给Visual Studio项目文件.如果只使用另一个生成器更方便,那也可以(如果您可以向我解释如何使用).

Note: I am not married to Visual Studio project files. If it's more convenient to just use another generator, that's fine too (if you can explain to me how).

推荐答案

要调用特定目标的构建,请使用

To invoke the building of a specific target, use the --target option of cmake --build, i.e. in your case the command will look like cmake --build (YOUR_BUILD_FOLDER) --config Release --target install. Of course you need to set up your compiler environment using vcvarsall.bat. You can use this command with other generators as well (note, that --config option is for multi-configuration tools only, MSVS is one of them).

这篇关于仅通过命令行在Windows上运行CMake生成的INSTALL.vcxproj吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆