Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
bbb89da1
Unverified
Commit
bbb89da1
authored
Aug 09, 2022
by
Henry Schreiner
Committed by
GitHub
Aug 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cmake): support vcpkg, try 2 (#4123)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
parent
5bdd3d59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
tools/pybind11Tools.cmake
+8
-4
No files found.
tools/pybind11Tools.cmake
View file @
bbb89da1
...
@@ -115,6 +115,7 @@ if(PYTHON_IS_DEBUG)
...
@@ -115,6 +115,7 @@ if(PYTHON_IS_DEBUG)
PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG
)
PROPERTY INTERFACE_COMPILE_DEFINITIONS Py_DEBUG
)
endif
()
endif
()
# The <3.11 code here does not support release/debug builds at the same time, like on vcpkg
if
(
CMAKE_VERSION VERSION_LESS 3.11
)
if
(
CMAKE_VERSION VERSION_LESS 3.11
)
set_property
(
set_property
(
TARGET pybind11::module
TARGET pybind11::module
...
@@ -130,16 +131,19 @@ if(CMAKE_VERSION VERSION_LESS 3.11)
...
@@ -130,16 +131,19 @@ if(CMAKE_VERSION VERSION_LESS 3.11)
APPEND
APPEND
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:
${
PYTHON_LIBRARIES
}
>
)
PROPERTY INTERFACE_LINK_LIBRARIES pybind11::pybind11 $<BUILD_INTERFACE:
${
PYTHON_LIBRARIES
}
>
)
else
()
else
()
# The IMPORTED INTERFACE library here is to ensure that "debug" and "release" get processed outside
# of a generator expression - https://gitlab.kitware.com/cmake/cmake/-/issues/18424, as they are
# target_link_library keywords rather than real libraries.
add_library
(
pybind11::_ClassicPythonLibraries IMPORTED INTERFACE
)
target_link_libraries
(
pybind11::_ClassicPythonLibraries INTERFACE
${
PYTHON_LIBRARIES
}
)
target_link_libraries
(
target_link_libraries
(
pybind11::module
pybind11::module
INTERFACE
INTERFACE
pybind11::python_link_helper
pybind11::python_link_helper
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:$<BUILD_INTERFACE:
${
PYTHON_LIBRARIES
}
>>"
"$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:Cygwin>>:pybind11::_ClassicPythonLibraries>"
)
)
target_link_libraries
(
pybind11::embed INTERFACE pybind11::pybind11
target_link_libraries
(
pybind11::embed INTERFACE pybind11::pybind11
$<BUILD_INTERFACE:
${
PYTHON_LIBRARIES
}
>
)
pybind11::_ClassicPythonLibraries
)
endif
()
endif
()
function
(
pybind11_extension name
)
function
(
pybind11_extension name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment