[pybind11] Build against python3 library inside vcpkg, add find_acquire_program(PYTHON3)

This commit is contained in:
Robert Schumacher 2017-06-13 23:43:15 -07:00
parent 77a45ad175
commit 50fca8f92a
2 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,4 @@
Source: pybind11
Version: 2.1.0
Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.
Version: 2.1.0-1
Description: pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.
Build-Depends: python3

View File

@ -1,17 +1,32 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/pybind11-2.1.0)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/pybind/pybind11/archive/v2.1.0.tar.gz"
FILENAME "pybind11-2.1.0.tar.gz"
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pybind/pybind11
REF v2.1.0
SHA512 2f74dcd2b82d8e41da7db36351284fe04511038bec66bdde820da9c0fce92f6d2c5aeb2e48264058a91a775a1a6a99bc757d26ebf001de3df4183d700d46efa1
HEAD_REF master
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYPATH ${PYTHON3} PATH)
set(ENV{PATH} "$ENV{PATH};${PYPATH}")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS -DPYBIND11_TEST=OFF
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DPYBIND11_TEST=OFF
-DPYTHONLIBS_FOUND=ON
-DPYTHON_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include
-DPYTHON_MODULE_EXTENSION=.dll
OPTIONS_RELEASE
-DPYTHON_IS_DEBUG=OFF
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python36.lib
OPTIONS_DEBUG
-DPYTHON_IS_DEBUG=ON
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python36_d.lib
)
vcpkg_install_cmake()