Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into dev/agruzde…
Browse files Browse the repository at this point in the history
…v/yato
  • Loading branch information
agruzdev committed Apr 30, 2018
2 parents 5897e96 + a9d989e commit c72e632
Show file tree
Hide file tree
Showing 57 changed files with 456 additions and 311 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
vcpkg

# Visual Studio 2015 cache/options directory
.vs/
Expand Down Expand Up @@ -299,4 +300,4 @@ triplets/*

############################################################
# vcpkg - End
############################################################
############################################################
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
# Vcpkg <a href="#">![](https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/8476/badge)</a>

## Overview
Vcpkg helps you get C and C++ libraries on Windows. This tool and ecosystem are currently in a preview state; your involvement is vital to its success.
Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are currently in a preview state; your involvement is vital to its success!

For short description of available commands, run `vcpkg help`.

## Quick Start
Prerequisites:
- Windows 10, 8.1, or 7
- Visual Studio 2017 or Visual Studio 2015 Update 3
- Windows 10, 8.1, 7, Linux, or MacOS
- Visual Studio 2017 or Visual Studio 2015 Update 3 (on Windows)
- Git
- *Optional: CMake 3.10.2*

Clone this repository, then run
To get started:
```
C:\src\vcpkg> .\bootstrap-vcpkg.bat
> git clone https://github.com/Microsoft/vcpkg
> cd vcpkg
PS> .\bootstrap-vcpkg.bat
Ubuntu:~/$ ./bootstrap-vcpkg.sh
```

Then, to hook up user-wide integration, run (note: requires admin on first use)
```
C:\src\vcpkg> .\vcpkg integrate install
PS> .\vcpkg integrate install
Ubuntu:~/$ ./vcpkg integrate install
```

Install any packages with
```
C:\src\vcpkg> .\vcpkg install sdl2 curl
PS> .\vcpkg install sdl2 curl
Ubuntu:~/$ ./vcpkg install sdl2 curl
```
Finally, create a New Project (or open an existing one) in Visual Studio 2017 or 2015. All installed libraries are immediately ready to be `#include`'d and used in your project.

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=D:\src\vcpkg\scripts\buildsystems\vcpkg.cmake`.
For more information, see our [using a package](docs/examples/using-sqlite.md) example for the specifics.
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](docs/examples/using-sqlite.md) example for the specifics.

Additional notes on macOS and Linux support can be found in the [official announcement](https://blogs.msdn.microsoft.com/vcblog/2018/04/24/announcing-a-single-c-library-manager-for-linux-macos-and-windows-vcpkg/).

## Tab-Completion / Auto-Completion
`Vcpkg` supports auto-completion of commands, package names, options etc. To enable tab-completion in Powershell, use
`vcpkg` supports auto-completion of commands, package names, options etc. To enable tab-completion in Powershell, use
```
.\vcpkg integrate powershell
```
Expand Down
4 changes: 3 additions & 1 deletion bootstrap-vcpkg.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/sh

vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P)
$vcpkgRootDir/scripts/bootstrap.sh
. $vcpkgRootDir/scripts/bootstrap.sh
6 changes: 1 addition & 5 deletions ports/azure-storage-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ vcpkg_from_github(
REF v3.2.1
SHA512 8d1e8de439e52f53eb28b77e8adf394468f4861c2c4c1f79ec1437c72e3fc0bc871e4e2662ee58090748915b0f12ce6736a7cc6ede619d332686b9fb6a026c9f
HEAD_REF master
)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/cmake.patch
${CMAKE_CURRENT_LIST_DIR}/static-builds.patch
Expand All @@ -35,7 +31,7 @@ vcpkg_install_cmake()
file(INSTALL
${SOURCE_PATH}/LICENSE.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/azure-storage-cpp RENAME copyright)
file(REMOVE_RECURSE
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include)

vcpkg_copy_pdbs()
Expand Down
3 changes: 2 additions & 1 deletion ports/bigint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(
BigInteger.cc
BigIntegerAlgorithms.cc
BigUnsignedInABase.cc
BigIntegerUtils.cc
BigIntegerUtils.cc
)

set(
Expand All @@ -24,6 +24,7 @@ set(
BigIntegerAlgorithms.hh
BigUnsignedInABase.hh
BigIntegerLibrary.hh
BigIntegerUtils.hh
)

add_library(bigint ${bigint_srcs})
Expand Down
2 changes: 1 addition & 1 deletion ports/bigint/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: bigint
Version: 2010.04.30-1
Version: 2010.04.30-2
Description: C++ Big Integer Library
7 changes: 5 additions & 2 deletions ports/clblas/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ vcpkg_from_github(
)

# v2.12 has a very old FindOpenCL.cmake using OPENCL_ vs. OpenCL_ var names
# conflicting with the built-in, more modern FindOpenCL.cmake
# conflicting with the built-in, more modern FindOpenCL.cmake
file(
REMOVE ${SOURCE_PATH}/src/FindOpenCL.cmake
)
Expand All @@ -32,7 +32,9 @@ vcpkg_configure_cmake(
)

vcpkg_install_cmake()

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(INSTALL
Expand All @@ -43,6 +45,7 @@ file(INSTALL
)

file(REMOVE
${CURRENT_PACKAGES_DIR}/debug/bin/clBLAS-tune.pdb
${CURRENT_PACKAGES_DIR}/debug/bin/clBLAS-tune.exe
${CURRENT_PACKAGES_DIR}/bin/clBLAS-tune.exe
${CURRENT_PACKAGES_DIR}/debug/bin/concrt140d.dll
Expand Down
4 changes: 0 additions & 4 deletions ports/folly/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ vcpkg_from_github(
REF v2018.04.16.00
SHA512 1f14da6eece3a490bd134a40550c2a3f78356789090e19933b8f10bc356837ee774a21e6f0b88c45831a968587049092b9d0d77617f040ab8e177de224400408
HEAD_REF master
)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/find-gflags.patch
)
Expand Down
2 changes: 1 addition & 1 deletion ports/gainput/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: gainput
Version: 1.0.0
Version: 1.0.0-1
Description: Gainput is a multiplatform C++ input library, supporting mouse, keyboard and controllers
30 changes: 20 additions & 10 deletions ports/http-parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required (VERSION 3.4)
project (http-parser)
cmake_minimum_required(VERSION 3.4)
project(http-parser C)

if (BUILD_SHARED_LIBS)
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if(BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release")
Expand All @@ -11,11 +11,21 @@ endif()

add_library(http_parser http_parser.c http_parser.h)

install(TARGETS http_parser
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
target_include_directories(http_parser PUBLIC $<INSTALL_INTERFACE:include>)

install(
TARGETS http_parser
EXPORT NODEJS_HTTP_PARSER_ALL_TARGETS
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)

install(
EXPORT NODEJS_HTTP_PARSER_ALL_TARGETS
NAMESPACE unofficial::http_parser::
FILE unofficial-http-parser-config.cmake
DESTINATION share/unofficial-http-parser
)

if (NOT SKIP_INSTALL_HEADERS)
install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
endif()
install(FILES http_parser.h DESTINATION include)
2 changes: 1 addition & 1 deletion ports/http-parser/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: http-parser
Version: 2.7.1-2
Version: 2.7.1-3
Description: HTTP Parser.
28 changes: 12 additions & 16 deletions ports/http-parser/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/http-parser-2.7.1)
vcpkg_download_distfile(ARCHIVE_FILE
URLS "https://github.com/nodejs/http-parser/archive/v2.7.1.zip"
FILENAME "http-parser-2.7.1.zip"
SHA512 9fb8b855ba7edb47628c91ac062d7ffce9c4bb8d6b8237d861d7926af989fb3e354c113821bdab1b8ac910f5f1064ca1339947aa20d56f6806b919b0cd6b6eae
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nodejs/http-parser
REF v2.7.1
SHA512 c0fe86455db1a563a5c668f118dfa9a27b9a637ee1c0e2f2f18a5b816352436ed90435ea978e3f3d85b037d3c630234e47d609dc3b7086b898286c4e54d9f031
HEAD_REF master
)
vcpkg_extract_source_archive(${ARCHIVE_FILE})

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
PREFER_NINJA
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/unofficial-http-parser" TARGET_PATH "share/unofficial-http-parser")

# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE-MIT DESTINATION ${CURRENT_PACKAGES_DIR}/share/http-parser)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/http-parser/LICENSE-MIT ${CURRENT_PACKAGES_DIR}/share/http-parser/copyright)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/http-parser/LICENSE-MIT ${CURRENT_PACKAGES_DIR}/share/http-parser/copyright)
2 changes: 1 addition & 1 deletion ports/ismrmrd/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: ismrmrd
Version: 1.3.2-1
Version: 1.3.2-2
Description: ISMRM Raw Data Format
Build-Depends: pugixml
2 changes: 1 addition & 1 deletion ports/ismrmrd/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ file(COPY ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_info.exe DESTINATION ${CURRENT_PAC
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/ismrmrd_info.exe)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/ismrmrd_info.exe)

file(COPY ${CURRENT_BUILDTREES_DIR}/src/ismrmrd-1.3.2/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ismrmrd)
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ismrmrd)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ismrmrd/LICENSE ${CURRENT_PACKAGES_DIR}/share/ismrmrd/copyright)

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/ismrmrd)
2 changes: 1 addition & 1 deletion ports/leveldb/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: leveldb
Version: 2017-10-25-8b1cd3753b184341e837b30383832645135d3d73-1
Version: 2017-10-25-8b1cd3753b184341e837b30383832645135d3d73-2
Description: LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
19 changes: 8 additions & 11 deletions ports/leveldb/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
include(vcpkg_common_functions)

set(VCPKG_LIBRARY_LINKAGE static)

set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/leveldb-8b1cd3753b184341e837b30383832645135d3d73)
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH "leveldb"
BRANCH "bitcoin-fork"
REPO "bitcoin-core/leveldb"
REF "8b1cd3753b184341e837b30383832645135d3d73"
OUT_SOURCE_PATH SOURCE_PATH
BRANCH "bitcoin-fork"
REPO "bitcoin-core/leveldb"
REF "8b1cd3753b184341e837b30383832645135d3d73"
SHA512 f5ad5fd21fb28ee052a4f3873abd58dab508c71621bcd482ab9e6ef4b57eca182c81502ddfe59736f5b2a54f2d05b397dd15982b3bd5d9039cd481eae3c7b958
)

message(STATUS "Patching")

vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/msvc_code_fix.diff)

message(STATUS "Building")

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

Expand Down
2 changes: 1 addition & 1 deletion ports/libqrencode/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libqrencode
Version: 4.0.0-1
Version: 4.0.0-2
Build-Depends: libpng, libiconv
Description: libqrencode - a fast and compact QR Code encoding library
2 changes: 1 addition & 1 deletion ports/libqrencode/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/qrencoded.dll)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(COPY ${CURRENT_BUILDTREES_DIR}/src/libqrencode-4.0.0/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libqrencode)
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libqrencode)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libqrencode/COPYING ${CURRENT_PACKAGES_DIR}/share/libqrencode/copyright)

vcpkg_copy_pdbs()
Expand Down
2 changes: 1 addition & 1 deletion ports/libxmlpp/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libxmlpp
Version: 2.40.1-1
Version: 2.40.1-2
Description: a C++ wrapper for the libxml XML parser library.
Build-Depends: libxml2, glibmm
Loading

0 comments on commit c72e632

Please sign in to comment.