From b01b2c8467042d4313d916208c26a7b382292a52 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 24 Oct 2016 21:00:23 -0700 Subject: [EXAMPLES.md] Switch base example to Sqlite. This demonstrates cmake's integration better with find_package(), as well as keeps the initial user impression very sleek with short build times. --- docs/EXAMPLES.md | 81 ++++++++++++++++++++++++-------------------------------- 1 file changed, 35 insertions(+), 46 deletions(-) (limited to 'docs') diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index d991d87f9..7862ba354 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -6,7 +6,7 @@ Vcpkg helps you get C and C++ libraries on Windows. For short description of available commands, run `vcpkg help`. ## Table of Contents -- Example 1: Using the C++ REST SDK +- Example 1: Using Sqlite - Step 1: Build - Step 2: Use - Option A: VS Project (User-wide integration) @@ -17,49 +17,35 @@ For short description of available commands, run `vcpkg help`. - Example 3: Patching libpng to work for uwp-x86 -## Example 1: C++ REST SDK +## Example 1: Using Sqlite ### Step 1: Build -First, we need to know what name C++ REST SDK goes by in the ports tree. To do that, we'll run the `search` command and inspect the output: +First, we need to know what name [Sqlite](https://sqlite.org) goes by in the ports tree. To do that, we'll run the `search` command and inspect the output: ``` -PS D:\src\vcpkg> .\vcpkg search -boost 1.60 Peer-reviewed portable C++ source libraries -cpprestsdk 2.8 C++11 JSON, REST, and OAuth library The C++ RES... -curl 7.48.0 A library for transferring data with URLs -expat 2.1.1 XML parser library written in C -freetype 2.6.3 A library to render fonts. -glew 1.13.0 The OpenGL Extension Wrangler Library (GLEW) is a... -glfw3 3.1.2 GLFW is a free, Open Source, multi-platform libra... -libjpeg-turbo 1.4.90-1 libjpeg-turbo is a JPEG image codec that uses SIM... -libpng 1.6.24-1 libpng is a library implementing an interface for... -libuv 1.9.1 libuv is a multi-platform support library with a ... -libwebsockets 2.0.0 Libwebsockets is a lightweight pure C library bui... -mpg123 1.23.3 mpg123 is a real time MPEG 1.0/2.0/2.5 audio play... -openal-soft 1.17.2 OpenAL Soft is an LGPL-licensed, cross-platform, ... -opencv 3.1.0 computer vision library -opengl 10.0.10240.0 Open Graphics Library (OpenGL)[3][4][5] is a cros... -openssl 1.0.2h OpenSSL is an open source project that provides a... -range-v3 0.0.0-1 Range library for C++11/14/17. -rapidjson 1.0.2-1 A fast JSON parser/generator for C++ with both SA... -sdl2 2.0.4 Simple DirectMedia Layer is a cross-platform deve... -sqlite3 3120200 SQLite is a software library that implements a se... -tiff 4.0.6 A library that supports the manipulation of TIFF ... -tinyxml2 3.0.0 A simple, small, efficient, C++ XML parser -zlib 1.2.8 A compression library +PS D:\src\vcpkg> .\vcpkg search sqlite +libodb-sqlite 2.4.0 Sqlite support for the ODB ORM library +sqlite3 3.15.0 SQLite is a software library that implements a se... + +If your library is not listed, please open an issue at: + https://github.com/Microsoft/vcpkg/issues ``` -Looking at the list, we can see that the port is named "cpprestsdk". +Looking at the list, we can see that the port is named "sqlite3". You can also run the `search` command without arguments to see the full list of packages. -Installing is then as simple as using the `install` command. Since we haven't built this library before, we'll first see an error message indicating that the control file failed to load, then the port will automatically begin building (and install when completed). +Installing is then as simple as using the `install` command. ``` -PS D:\src\vcpkg> .\vcpkg install cpprestsdk +PS D:\src\vcpkg> .\vcpkg install sqlite3 -- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-windows -- DOWNLOADS=D:/src/vcpkg/downloads --- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/cpprestsdk_x86-windows --- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/cpprestsdk --- CURRENT_PORT_DIR=D:/src/vcpkg/ports/cpprestsdk/. --- Cloning done --- Adding worktree and patching done +-- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/sqlite3_x86-windows +-- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/sqlite3 +-- CURRENT_PORT_DIR=D:/src/vcpkg/ports/sqlite3/. +-- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... +-- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... OK +-- Testing integrity of downloaded file... +-- Testing integrity of downloaded file... OK +-- Extracting source D:/src/vcpkg/downloads/sqlite-amalgamation-3150000.zip +-- Extracting done -- Configuring x86-windows-rel -- Configuring x86-windows-rel done -- Configuring x86-windows-dbg @@ -72,14 +58,16 @@ PS D:\src\vcpkg> .\vcpkg install cpprestsdk -- Package x86-windows-rel done -- Package x86-windows-dbg -- Package x86-windows-dbg done -Package cpprestsdk:x86-windows is installed +-- Performing post-build validation +-- Performing post-build validation done +Package sqlite3:x86-windows is installed ``` -In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory (in this case, `packages\cpprestsdk_x86-windows`). This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. +In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory -- in this case, `packages\sqlite3_x86-windows`. This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. We can check that cpprestsdk was successfully installed for x86 windows desktop by running the `list` command. ``` PS D:\src\vcpkg> .\vcpkg list -cpprestsdk:x86-windows 2.8 A modern C++11 library to connect with web servic... +sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... ``` To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. @@ -105,6 +93,8 @@ Installing new libraries will make them instantly available. ``` *Note: You will need to restart Visual Studio or perform a Build to update intellisense with the changes.* +You can now simply use File -> New Project in Visual Studio 2015 or Visual Studio "15" Preview and the library will be automatically available. For Sqlite, you can try out their [C/C++ sample](https://sqlite.org/quickstart.html). + To remove the integration for your user, you can use `vcpkg integrate remove`. @@ -118,22 +108,19 @@ Let's first make a simple CMake project with a main file. cmake_minimum_required(VERSION 3.0) project(test) -find_library(CPPREST_LIBRARY cpprest_2_8) -find_path(CPPREST_INCLUDE_DIR cpprest/version.h) +find_package(Sqlite3 REQUIRED) -include_directories(${CPPREST_INCLUDE_DIR}) -link_libraries(${CPPREST_LIBRARY}) +link_libraries(sqlite3) add_executable(main main.cpp) ``` ```cpp // main.cpp -#include +#include #include int main() { - auto v = web::json::value::parse(U("[1,2,3,4]")); - printf("Success\n"); + printf("%s\n", sqlite3_libversion()); return 0; } ``` @@ -153,9 +140,11 @@ Build succeeded. Time Elapsed 00:00:02.38 PS D:\src\cmake-test\build> .\Debug\main.exe -Success +3.15.0 ``` +*Note: The correct sqlite3.dll is automatically copied to the output folder when building for x86-windows. You will need to distribute this along with your application.* + #### Option C: Other buildsystems -- cgit v1.2.3 From d68abcd321e7cabe3c25a72a90a3c8db6c079e6d Mon Sep 17 00:00:00 2001 From: Christian Ullrich Date: Tue, 20 Dec 2016 09:21:15 +0100 Subject: Mention blank-property trap in FAQ. --- docs/FAQ.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs') diff --git a/docs/FAQ.md b/docs/FAQ.md index 7bc57f605..0a82d320e 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -61,6 +61,9 @@ In a corporate scenario, we currently recommend building the libraries once and ## What Visual C++ toolsets are supported? We plan to only support Visual Studio 2015 and above. +## Why does Visual Studio not use my libraries with user-wide integration enabled? +Enabling user-wide integration (`vcpkg integrate install`) changes the default for some project properties. In particular, "C/C++/General/Additional Include Directories" and "Linker/General/Additional Library Directories" are normally blank *without* user-wide integration. *With* integration, a blank value means that the augmented default supplied by vcpkg is overridden, and headers/libraries will not be found. To reinstate the default, set the properties to inherit from parent. + ## Can I acquire my package's sources by Git url+tag? Yes, however we prefer compressed archives of the specific release/commit since the internal downloads and build trees are meant to be read only. Github provides archives for every commit, tag, and branch, so it's always possible to perform this substitution for repositories hosted there. -- cgit v1.2.3 From d4c63a8a5c9744a1a0bd14b14075b4f4664032bc Mon Sep 17 00:00:00 2001 From: Olaf van der Spek Date: Thu, 19 Jan 2017 14:36:45 +0100 Subject: Replace cpprest by sqlite3 --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 7862ba354..6302dab07 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -64,7 +64,7 @@ Package sqlite3:x86-windows is installed ``` In addition to installing, `vcpkg` caches a pristine copy of the built library inside the `packages\` directory -- in this case, `packages\sqlite3_x86-windows`. This allows you to quickly uninstall and reinstall the library in the future using the `remove` and `install` commands. -We can check that cpprestsdk was successfully installed for x86 windows desktop by running the `list` command. +We can check that sqlite3 was successfully installed for x86 windows desktop by running the `list` command. ``` PS D:\src\vcpkg> .\vcpkg list sqlite3:x86-windows 3.15.0 SQLite is a software library that implements a se... @@ -72,7 +72,7 @@ sqlite3:x86-windows 3.15.0 SQLite is a software library that i To install for other architectures and platforms such as Universal Windows Platform or x64 Desktop, you can suffix the package name with `:`. ``` -PS D:\src\vcpkg> .\vcpkg install cpprestsdk:x86-uwp zlib:x64-windows +PS D:\src\vcpkg> .\vcpkg install sqlite3:x86-uwp zlib:x64-windows ``` See `vcpkg help triplet` for all supported targets. -- cgit v1.2.3 From 942ce23ca866e4f4982469453755656681e9109c Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 19 Jan 2017 16:12:07 -0800 Subject: [PRIVACY] fix typo in privacy document. Fixes #566. --- docs/PRIVACY.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md index f50c2938f..ad345c809 100644 --- a/docs/PRIVACY.md +++ b/docs/PRIVACY.md @@ -5,14 +5,14 @@ ## Do you collect telemetry data? What is it used for? We do collect telemetry data from usage of "vcpkg.exe". We explicitly ONLY collect information from invocations of the tool itself; we do NOT add any tracking information into the produced libraries. -We use this information to understand the usage the issue and what we can do to improve the tool. +We use this information to understand usage issues and to guide tool improvements. ## What telemetry is collected? We collect the command line used, the time of invocation, and how long the command took. Some commands also add additional calculated information (such as the full set of libraries to install). We generate a completely random UUID on first use and attach it to each event. For this preview, we do not offer a mechanism to disable this data collection since it is critical for improving the product. In the full release, you will be able to opt-out with a simple configuration. For more information about how Microsoft protects your privacy, see https://privacy.microsoft.com/en-us/privacy. -Here is an example of an event for the command line "vcpkg install zlib": +Here is an example of an event for the command line `vcpkg install zlib`: ``` [{ "ver": 1, @@ -40,7 +40,7 @@ Here is an example of an event for the command line "vcpkg install zlib": } }] ``` -In the source code (included in every release), you can search for calls to the functions "TrackProperty" and "TrackMetric" to see every specific data point we collect. +In the source code (included in `toolsrc\`), you can search for calls to the functions `TrackProperty()` and `TrackMetric()` to see every specific data point we collect. ## Is the data stored on my system? -- cgit v1.2.3 From 8d5cbff2954a425731057a206a8e769a5bc53e16 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 7 Feb 2017 15:04:07 -0800 Subject: [examples] Add the manual-link directories to the Examples documentation --- docs/EXAMPLES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/EXAMPLES.md b/docs/EXAMPLES.md index 6302dab07..cc100c4ca 100644 --- a/docs/EXAMPLES.md +++ b/docs/EXAMPLES.md @@ -150,9 +150,9 @@ PS D:\src\cmake-test\build> .\Debug\main.exe Libraries are installed into the `installed\` subfolder, partitioned by architecture (e.g. x86-windows): * The header files are installed to `installed\x86-windows\include` -* Release `.lib` files are installed to `installed\x86-windows\lib` +* Release `.lib` files are installed to `installed\x86-windows\lib` or `installed\x86-windows\lib\manual-link` * Release `.dll` files are installed to `installed\x86-windows\bin` -* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` +* Debug `.lib` files are installed to `installed\x86-windows\debug\lib` or `installed\x86-windows\debug\lib\manual-link` * Debug `.dll` files are installed to `installed\x86-windows\debug\bin` See your build system specific documentation for how to use prebuilt binaries. -- cgit v1.2.3