简体   繁体   English

依赖于 CMake 中的 Visual Studio 项目

[英]Depend on a Visual Studio project in CMake

My project is using CMake and I want to depend on another project (a library) which is only available as a Visual Studio project (no CMakeLists.txt).我的项目正在使用 CMake,我想依赖另一个项目(库),它只能作为 Visual Studio 项目(没有 CMakeLists.txt)。 While I could add the dependency by hand after generating my project, I was looking for a way do that in my CMakeLists.txt so I don't have to do it every time?虽然我可以在生成我的项目后手动添加依赖项,但我正在寻找一种在我的 CMakeLists.txt 中执行此操作的方法,所以我不必每次都这样做?

I know I could also just build the library and link the result, but I would prefer to avoid that so that the resulting Visual Studio project will easily work for all architectures.我知道我也可以只构建库并链接结果,但我宁愿避免这种情况,以便生成的 Visual Studio 项目可以轻松地适用于所有体系结构。

(I'm fine with having Visual Studio as the only working Generator) (我可以将 Visual Studio 作为唯一的工作生成器)

I found the solution: include_external_msproject我找到了解决方案: include_external_msproject

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在cmake / Visual Studio项目中调试/运行可执行文件 - Debugging/Running executables in cmake/Visual Studio project CMake与Visual Studio - CMake with Visual Studio 在 Visual Studio 的 C++ 项目中使用 NetCDF(通过 vcpkg 安装)和 CMake 时无法解析的外部符号 - Unresolved External Symbols When Using NetCDF (Installed via vcpkg) with CMake in a C++ Project on Visual Studio “访问冲突写入位置”使用Visual Studio调试Windows ARM64的cmake项目 - "Access violation writing location" using Visual Studio to debug cmake project for Windows ARM64 #包括<python.h> CMake 项目 Visual Studio 2019 windows 10</python.h> - #include <Python.h> CMake project Visual Studio 2019 windows 10 Visual Studio无法调试CMake项目-失败,显示“无法启动程序…” - Visual Studio Can't debug CMake project - fails with “Unable to start program…” 需要在带有 Visual Studio 的 Windows 上使用 Xerces-C++ 3 的示例 CMake 项目 - Need sample CMake project that uses Xerces-C++ 3 on Windows with Visual Studio 编译程序取决于 <windows.h> 没有Visual Studio - Compile Programs Depend on <windows.h> Without Visual Studio 在 Visual Studio 项目中链接 Tensforflow - Linking Tensforflow in Visual Studio project 在Visual Studio 2010中未加载项目 - Project Not Loading in Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM