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
a18c10f6
Unverified
Commit
a18c10f6
authored
Oct 27, 2023
by
Henry Schreiner
Committed by
GitHub
Oct 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cmake): make library component optional (#4805)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
parent
3aece819
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
tools/pybind11NewTools.cmake
+12
-2
No files found.
tools/pybind11NewTools.cmake
View file @
a18c10f6
...
@@ -32,12 +32,22 @@ if(NOT Python_FOUND AND NOT Python3_FOUND)
...
@@ -32,12 +32,22 @@ if(NOT Python_FOUND AND NOT Python3_FOUND)
set
(
Python_ROOT_DIR
"$ENV{pythonLocation}"
)
set
(
Python_ROOT_DIR
"$ENV{pythonLocation}"
)
endif
()
endif
()
find_package
(
Python 3.6 REQUIRED COMPONENTS Interpreter Development
${
_pybind11_quiet
}
)
# Development.Module support (required for manylinux) started in 3.18
if
(
CMAKE_VERSION VERSION_LESS 3.18
)
set
(
_pybind11_dev_component Development
)
else
()
set
(
_pybind11_dev_component Development.Module OPTIONAL_COMPONENTS Development.Embed
)
endif
()
find_package
(
Python 3.6 REQUIRED COMPONENTS Interpreter
${
_pybind11_dev_component
}
${
_pybind11_quiet
}
)
# If we are in submodule mode, export the Python targets to global targets.
# If we are in submodule mode, export the Python targets to global targets.
# If this behavior is not desired, FindPython _before_ pybind11.
# If this behavior is not desired, FindPython _before_ pybind11.
if
(
NOT is_config
)
if
(
NOT is_config
)
set_property
(
TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE
)
if
(
TARGET Python::Python
)
set_property
(
TARGET Python::Python PROPERTY IMPORTED_GLOBAL TRUE
)
endif
()
set_property
(
TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE
)
set_property
(
TARGET Python::Interpreter PROPERTY IMPORTED_GLOBAL TRUE
)
if
(
TARGET Python::Module
)
if
(
TARGET Python::Module
)
set_property
(
TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE
)
set_property
(
TARGET Python::Module PROPERTY IMPORTED_GLOBAL TRUE
)
...
...
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