适用于 C++ 的 Windows 包管理器图书馆
我一直致力于各种开源项目,其中涉及以下 C++ 库(及其他库):
- MuPDF
- Boost
- FreeType
- GTKmm
- hummus PDF 库
- LibTiff
- LibXML2
- Wt xpdf
- xpdf
- Poppler
- ZLib
配置这些库通常需要很长时间,当将它们设置在干净的机器上。有没有办法自动获取 Windows 机器上的所有依赖项?
我发现的最接近的是 CMake,它会检查以确保在生成项目文件之前安装/提取了依赖项。但我还没有找到任何适用于 Windows 的东西,可以解析依赖项列表,然后下载+安装所需的版本。
请推荐一个带有最新 C++ 库的 Windows 包管理器。
I've been working on various open-source projects, which involve the following C++ libraries (& others):
- MuPDF
- Boost
- FreeType
- GTKmm
- hummus PDF libraries
- LibTiff
- LibXML2
- Wt xpdf
- xpdf
- Poppler
- ZLib
It often takes a long time to configure these libraries, when setting them up on a clean machine. Is there a way to automate the grabbing of all dependencies on a windows machine?
The closest I've found is CMake, which checks to make sure you have the dependencies installed/extracted before generating your project files. But I haven't found anything for Windows which can parse the list of dependencies and then download+install the required versions.
Please recommend a package manager for Windows with up-to-date C++ libraries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Vcpkg 是一个 Microsoft 开源项目,可帮助您在 Windows 上获取 C 和 C++ 库。
Vcpkg, a Microsoft open source project, helps you get C and C++ libraries on Windows.
当您已经使用 CMake 设置项目时,请查看 Hunter 包管理器。它会自动下载并构建您的依赖项,只需几行额外的 cmake 代码。 Hunter 基于 cmake 导出和导入目标。
例如,如果您想在基于 cmake 的项目中使用 GoogleTest 库,您可以将以下行添加到您的根 CMakeLists.txt
并非您列出的所有库都可以作为“hunter-packages”使用,但该项目是开源的,因此您可以为您的依赖项创建猎人包并将它们提交到项目中。 这里是已经作为猎人包提供的库的列表。
这并不能立即解决您的所有问题,因为您必须为您的依赖项创建猎人包。但现有的框架已经做了很多工作,最好使用它,而不是半途而废的自制解决方案。
Take a look at the Hunter package manager when you already use CMake to setup your project. It automatically downloads and builds your dependencies whith only a few lines of extra cmake code. Hunter is based on cmake export and import targets.
For example if you want to use the GoogleTest library in your cmake based project you would add the following lines to your root CMakeLists.txt
Not all the libraries you list are available as "hunter-packages" but the project is open source so you can create hunter-packages for your dependencies and commit them to the project. Here is a list of libraries that are already available as hunter packages.
This will not solve all your problems out of the box because you have to create hunter-packages for your dependencies. But the existing framework already does a lot of the work and it is better to use that instead of having a half-assed selfmade solution.
Biicode 是一个新的 C++ 依赖管理器。它还具有您列出的一些库。 Biicode 会自动扫描您的源文件中的依赖项、下载并构建它们。请参阅此处,了解包含 Freeglut 的非常酷的示例。
Biicode is a new dependency manager for C++. It also has a few libraries that you listed. Biicode automatically scans your source files for dependencies, downloads and builds them. See here for a very cool example that includes Freeglut.
我发现了什么:
最接近我正在寻找的东西:
不幸的是它没有任何我在其存储库中需要的库。
因此,我最终从 KDE4windows 项目 获取大部分库,并自定义构建其余的库。
What I've found:
Closest thing to what I'm looking for:
Unfortunately it doesn't have any of the libraries I require in its repository.
So I ended getting most of the libraries from the KDE4windows project and custom building the rest.
Npackd 是 Windows 的包管理器。有一个默认的 C++ 库存储库,还有一个第三方Visual Studio 2010 的存储库 64位库。 Boost 和 zlib 已经在默认存储库中。如果您决定使用 Npackd,则可以提出问题,如果你需要其他库。
Npackd is a package manager for Windows. There is a default repository for C++ libraries and also a third party repository for Visual Studio 2010 64 bit libraries. Boost and zlib are already in the default repository. If you decide to use Npackd, you could file an issue if you need other libraries.
Windows 没有包管理器。访问图书馆网站并下载 Windows 版本(如果有)。
有一些替代方案,但并非没有缺点:
对于任何与 Visual Studio 或 MinGW-w64 相关的东西,没有包管理器或稍微等效的东西。
Windows does not have a package manager. Go to the libraries' website and download the Windows builds if they provide any.
There are some alternatives, but not without drawbacks:
There is no package manager or slightly equivalent thing for anything Visual Studio or MinGW-w64 related.
Windows 上没有包管理。在 Windows 上,开发人员通常使用成熟的一切开发环境,并自行生成带有所有依赖项的整体应用程序。
There is no package management on Windows. On Windows developers typically use full-blown everything-and-the-kitchen-sink development environments and produce monolithic applications themselves, shipped with all dependencies.