Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ports/pybind11/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: pybind11
Version: 2.4.3
Version: 2.4.3-1
Homepage: https://github.com/pybind/pybind11
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 (windows)
Build-Depends: python3[enable-shared]
46 changes: 35 additions & 11 deletions ports/pybind11/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(vcpkg_common_functions)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pybind/pybind11
Expand All @@ -9,29 +7,55 @@ vcpkg_from_github(
)

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path(${PYTHON3_DIR})

find_path(_PATH_INCLUDE
NAMES
Python.h
PATHS
"${CURRENT_INSTALLED_DIR}/include"
"${CURRENT_INSTALLED_DIR}/include/python3.7"
"${CURRENT_INSTALLED_DIR}/include/python3.7m"
)

find_library(_PATH_LIBRARY_DEBUG
NAMES
python3.7dm
python37_d
PATHS
"${CURRENT_INSTALLED_DIR}/debug/lib"
)

find_library(_PATH_LIBRARY_RELEASE
NAMES
python3.7m
python37
PATHS
"${CURRENT_INSTALLED_DIR}/lib"
)

get_filename_component(PYPATH ${PYTHON3} PATH)
set(ENV{PATH} "$ENV{PATH};${PYPATH}")
message(VERBOSE "_PATH_INCLUDE: ${_PATH_INCLUDE}")
message(VERBOSE "_PATH_LIBRARY_DEBUG: ${_PATH_LIBRARY_DEBUG}")
message(VERBOSE "_PATH_LIBRARY_RELEASE: ${_PATH_LIBRARY_RELEASE}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DPYBIND11_TEST=OFF
-DPYTHONLIBS_FOUND=ON
-DPYTHON_INCLUDE_DIRS=${CURRENT_INSTALLED_DIR}/include
-DPYTHON_MODULE_EXTENSION=.dll
-DPYTHON_VERSION:STRING=3.7
-DPYTHON_INCLUDE_DIR:PATH="${_PATH_INCLUDE}"
OPTIONS_RELEASE
-DPYTHON_IS_DEBUG=OFF
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/lib/python36.lib
-DPYTHON_LIBRARY:PATH="${_PATH_LIBRARY_RELEASE}"
OPTIONS_DEBUG
-DPYTHON_IS_DEBUG=ON
-DPYTHON_LIBRARIES=${CURRENT_INSTALLED_DIR}/debug/lib/python36_d.lib
-DPYTHON_LIBRARY:PATH="${_PATH_LIBRARY_DEBUG}"
)

vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/)

# copy license
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pybind11/copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)