vcpkg теперь кроссплатформенный
Conan был убог. Эту штуку ждёт та же участь. По крайней мере, пока сборку кода на C/C++ не стандартизируют.
Судя по комментам, vcpkg ещё более убог. Даже фиксированную версию нельзя задать. До cargo как до небес.

Ну вот, очередной apt/dnf/.
В отличии от перечисленных, он работает не только на отдельных Linux-овых дистрибутивах.
Впрочем, на этом все хорошее в vcpkg, имхо, заканчивается.
Явшоке, микрософт пишет «we are committed to bringing you the most productive development tools and services to build your apps across all platforms» — куда мир катился и докатился?

Даже фиксированную версию нельзя задать.
А можно цитату на ээтот счет? По-моему, они мимкрируют под dpkg, там фиксированную версию задать можно.

Ну там-то да, я тоже не нашел. и в исходниках разрешения зависимостей вроде нет. Но тогда это какая-то совсем уж убогая поделка.
P.S. они походу даже разбиение длинных строк зависимостей не осилили. Ынтерпрайз епт.
Лолшто? Нет версионности?

Нет версионности зависимостей.
Зачем пробовать этот крап, когда всё есть в нативном репозитории, свежее, совместимое и установленное по предсказуемым путям? Пусть вместе с conan’ом, buckaroo, biicode (и что там ещё наублюдили и ещё не сдохло) отправляется на винфак, где конечно в отсутствие пакетного менеджера без этих костылей не обойтись.
Ты сейчас хочешь сказать, что пакетный менеджер в твоём дистрибутиве может без рутовых прав организовать мне песочницу под каждый проект, где можно поставить любую версию любой библиотеки, не поломав при этом ничего?
Такое, вроде, только Nix и подобные могут.

Ты сейчас хочешь сказать, что пакетный менеджер в твоём дистрибутиве
У dpkg есть опция —root=DIRECTORY у RPM (ЕМНИП) тоже. Отседова и плясать. Правда придется обмазаться обертками (помимо apt/dnf/. ).
Ты сам-то пробовал вот этим пользоваться?

Microsoft, позорный и тупой, как всегда.

По крайней мере, пока сборку кода на C/C++ не стандартизируют.
Че там еще стандартизовывать, все и так одинаково плохо.
а, этот очередной npm-подобный (что само по себе оскорбление) кусок оверинжинеринга с lock-файлами, чтобы хранить недетерминированное решение NP-полной задачи там, где она вообще не должна ставиться.
Слава богам, хотя бы в Go начали понимать, насколько это убого.
Вот так открытие.
Кстати, а MinGW с его кучей пакетов — это ли не то, с чем пытается конкурировать этот vcpkg? Я под оффтоп часто юзаю именно MinGW когда надо тучу опенсорсных либ прилепить, которых я нацеплял под линь. На 99% всегда всё есть в репах мингвшных.

Я очень давно не имею дело с вендой, но на LOR говорят, что в MinGW используется порт pacman (ага, того самого, из Arch).

Нет, vcpkg собирает пакеты из исходников. Даже жалкое подобие use-флагов есть.
Да лааадно. Несколько разных вариантов Make, самописные скрипты для сборки, meson, qmake, cmake, анал карнавал, вот это всё вместо одного стандартного простого в использовании инструмента. Сравни это с cargo у rust или cabal у haskell.
Хотя даже этот зоопарк не является самым большим препятствием для появления пакетного менеджера для C/C++. Самая большая проблема — толпа программистов на этих языках, у которых при попытке осилить что-то, что появилось после окаменения мамонтовых фекалий, начинает по швам трещать черепная коробка. На этом форуме есть несколько отличных примеров подобных личностей.

Несколько разных вариантов Make, самописные скрипты для сборки, meson, qmake, cmake, анал карнавал, вот это всё
и есть стандартизованная сборка кода на C/C++. Молись, чтобы не стандартизовали еще столько же бессвязного лепета.
Это который в свое время в одиночку популяризовал nix, потому что проще собрать маленькую ОС, чем удовлетворить зависимости через cabal?
Задница со сборкой везде, от Python до Clojure. В С/C++ это задница бабуина в цыганском наряде, ожидаемо яркая, пестрая, непредсказуемая и разномастная.

пакетный менеджер, хвала богам, несколько ортогонален системе сборки.
и есть стандартизованная сборка кода на C/C++. Молись, чтобы не стандартизовали еще столько же бессвязного лепета.
Я этот комикс уже по URL узнаю. Тем не менее, хотелось бы иметь один инструмент. И поддержку модулей в самом языке, пожалуйста.
Это который в свое время в одиночку популяризовал nix, потому что проще собрать маленькую ОС, чем удовлетворить зависимости через cabal?
Nix стал популярен, потому что через него можно подтягивать и сторонние библиотеки. А проблему с зависимостями в итоге решили через Stack.
Задница со сборкой везде, от Python до Clojure. В С/C++ это задница бабуина в цыганском наряде, ожидаемо яркая, пестрая, непредсказуемая и разномастная.
Задницы разные бывают, чувак. В C/C++ — просто лютый треш, из-за которого билд-инженер — это отдельная должность.
пакетный менеджер, хвала богам, несколько ортогонален системе сборки.
rconde01 / vcpkg Goto Github PK
Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constantly evolving; your involvement is vital to its success!
For short description of available commands, run vcpkg help .
- Github: https://github.com/microsoft/vcpkg
- Slack: https://cpplang.now.sh/, the #vcpkg channel
- Docs: Documentation
- Windows 10, 8.1, 7, Linux, or MacOS
- Visual Studio 2015 Update 3 or newer (on Windows)
- Git
- Optional: CMake 3.12.4
Then, to hook up user-wide integration, run (note: requires admin on first use)
Install any packages with
The best way to use installed libraries with CMake is via the toolchain file scripts\buildsystems\vcpkg.cmake . To use this file, you simply need to add it onto your CMake command line as -DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake .
In Visual Studio, you can create a New Project (or open an existing one). All installed libraries are immediately ready to be #include ‘d and used in your project without additional configuration.
For more information, see our using a package example for the specifics. If your library is not present in vcpkg catalog, you can open an issue on the GitHub repo where the dev team and the community can see it and potentially create the port file for this library.
Additional notes on macOS and Linux support can be found in the official announcement.
vcpkg supports auto-completion of commands, package names, options etc in Powershell and bash. To enable tab-completion, use one of the following:
and restart your console.
Our docs are now also available online at ReadTheDocs: https://vcpkg.readthedocs.io/!
Vcpkg is built with your contributions. Here are some ways you can contribute:
-
in vcpkg or existing packages
Please refer to our Contribution guidelines for more details.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Code licensed under the MIT License.
vcpkg’s People
Contributors
Recommend Projects
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue.js
Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
TensorFlow
An Open Source Machine Learning Framework for Everyone
Django
The Web framework for perfectionists with deadlines.
Laravel
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML.
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
How to use vcpkg with VSCode and CMake

Open a PowerShell console (Win + x, then select Windows PowerShell) and move to a directory which will host the vcpkg directory.
Launch Windows PowerShell as Administrator (Win + x, then select Windows PowerShell (admin)) and reach the previous directory
Close the PowerShell Admin console and switch back to the non-admin console. Type the following lines to find and install sqlite package.
On a non-English configuration you may have to install the English package for Visual Studio. To do so, launch Visual Studio Installer. Check the language tab and add English. Once the English Pack is installed, restart the .\vcpkg install sqlite3:x64-windows command
Click on the image to display it full screen
- List which libs are installed: ./vcpkg list
- Update vcpkg. Reach vcpkg directory and type git pull and run again the bootstrapper ( .\bootstrap-vcpkg.bat )
- Remove vcpkg. From vcpkg directory, execute ./vcpkg integrate remove and then delete vcpkg directory.
- Learn more. Read the vcpkg documentation
Build a Debug version
Create a directory to host the application and launch VSCode from there.
In VSCode, make sure C/C++, CMake and CMake Tools extensions are installed. Open the Extensions pane (CTRL + SHIFT +x) and check what is missing. See below:

Copy ‘n paste the code below in a main.cpp file and save it.
Once this is done, modify the VSCode Settings.json. You will have to do it once. Indded this is how we let VS Code know about CMake.
Anyway, to edit, Settings.json, strike CTRL + comma
To switch in text mode, click the first of the 3 icons on the top right-hand side (the one looking like a file)

At the end of the last line add a « , » then add a line like this one. Obviously, the path to the vcpkg.cmake file needs to be customized according to your configuration.
Just to make sure, here is the content of my Settings.json as it is today.
CTRL + SHIFT + P and type CMake then select CMake Quick Start

When asked to select a target, pick Visual Studio Community 2019 Release – amd64 for example. Remember initially we installed sqlite3:x64-windows

Later, you will be asked for the name of the project (« TestSQL » in my case) and the kind of project (executable or lib). Here, select executable.
Here is the content of the generated CMakeLists.txt you will get
This should be simplified and modified as follow. Pay attention to the tabulation before the paths : c:/Users/phili/Documents/…
Later, if the project needs additional libraries, just add their names after sqlite3 and insert a space between them.
Everything seems to be configured. CTRL + SHIFT + P then type CMake and select CMake: Build. You can also strike F7 which is much faster.

If everything went well, you should have a Debug directory hosting a TestSQL.exe debug version.

It is time to Debug our code. Set a breakpoint on line 5 and then strike F5. When asked, select C++(Windows).

Later select cl.exe

Here is the content of the initial launch.json file you may get.
Now, here is the modified version where preLaunchTask is commented and where $
Press F5. If everything works as expected the program should stop on line 5. You should know what to do from this point 😁

Build a Release version
At the bottom of VSCode, click on CMake: [Debug]: Ready

And select Release in the popup list.

If you want to change the kit (Visual Studio 2019 Release – amd64 was our initial choice), at the bottom of the VS Code window, click on the status bar, and select another compiler kit. However, if you select Visual Studio 2019 Release – x86 for example, make sure that you have installed the corresponding lib using vcpkg. In our case, so far, we only have the x64 version of the lib and not the x86 version. You may also have to update the content of the CMakeLists.txt. Remember, so far, we wrote something like:
Anyway, press F7 to build the release version. At the end of the build, a Release directory with a brand new TestSQL.exe should be available.

On a french keyboard, strike CTRL + ù to open a new terminal and type the line below to run your application.
Conclusion
vcpkg is great. The integration in Visual Studio is even smoother than the one with VSCode. Whatever, vcpkg elegantly solve one of the most annoying developer’s tasks: getting libs and making sure they are quickly integrated with our compiling toolchain.
I hope this page will speed up your start with vcpkg and VSCode on Windows. Feel free to add comments to help me improve this article and help others.