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
7cc0ebb4
Unverified
Commit
7cc0ebb4
authored
Jul 27, 2021
by
Henry Schreiner
Committed by
GitHub
Jul 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: the CMake config in Python package had a hard coded path (#3144)
parent
a0b97596
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
CMakeLists.txt
+6
-0
tests/extra_python_package/test_files.py
+12
-2
tools/pybind11Config.cmake.in
+2
-1
No files found.
CMakeLists.txt
View file @
7cc0ebb4
...
@@ -203,6 +203,12 @@ if(PYBIND11_INSTALL)
...
@@ -203,6 +203,12 @@ if(PYBIND11_INSTALL)
"
${
CMAKE_INSTALL_DATAROOTDIR
}
/cmake/
${
PROJECT_NAME
}
"
"
${
CMAKE_INSTALL_DATAROOTDIR
}
/cmake/
${
PROJECT_NAME
}
"
CACHE STRING
"install path for pybind11Config.cmake"
)
CACHE STRING
"install path for pybind11Config.cmake"
)
if
(
IS_ABSOLUTE
"
${
CMAKE_INSTALL_INCLUDEDIR
}
"
)
set
(
pybind11_INCLUDEDIR
"
${
CMAKE_INSTALL_FULL_INCLUDEDIR
}
"
)
else
()
set
(
pybind11_INCLUDEDIR
"
\$
\{PACKAGE_PREFIX_DIR\}/
${
CMAKE_INSTALL_INCLUDEDIR
}
"
)
endif
()
configure_package_config_file
(
configure_package_config_file
(
tools/
${
PROJECT_NAME
}
Config.cmake.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake"
tools/
${
PROJECT_NAME
}
Config.cmake.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PROJECT_NAME
}
Config.cmake"
INSTALL_DESTINATION
${
PYBIND11_CMAKECONFIG_INSTALL_DIR
}
)
INSTALL_DESTINATION
${
PYBIND11_CMAKECONFIG_INSTALL_DIR
}
)
...
...
tests/extra_python_package/test_files.py
View file @
7cc0ebb4
...
@@ -138,6 +138,16 @@ def test_build_sdist(monkeypatch, tmpdir):
...
@@ -138,6 +138,16 @@ def test_build_sdist(monkeypatch, tmpdir):
)
as
f
:
)
as
f
:
pyproject_toml
=
f
.
read
()
pyproject_toml
=
f
.
read
()
with
contextlib
.
closing
(
tar
.
extractfile
(
tar
.
getmember
(
start
+
"pybind11/share/cmake/pybind11/pybind11Config.cmake"
)
)
)
as
f
:
contents
=
f
.
read
()
.
decode
(
"utf8"
)
assert
'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")'
in
contents
files
=
{
"pybind11/{}"
.
format
(
n
)
for
n
in
all_files
}
files
=
{
"pybind11/{}"
.
format
(
n
)
for
n
in
all_files
}
files
|=
sdist_files
files
|=
sdist_files
files
|=
{
"pybind11{}"
.
format
(
n
)
for
n
in
local_sdist_files
}
files
|=
{
"pybind11{}"
.
format
(
n
)
for
n
in
local_sdist_files
}
...
@@ -151,11 +161,11 @@ def test_build_sdist(monkeypatch, tmpdir):
...
@@ -151,11 +161,11 @@ def test_build_sdist(monkeypatch, tmpdir):
.
substitute
(
version
=
version
,
extra_cmd
=
""
)
.
substitute
(
version
=
version
,
extra_cmd
=
""
)
.
encode
()
.
encode
()
)
)
assert
setup_py
==
contents
assert
setup_py
==
contents
with
open
(
os
.
path
.
join
(
MAIN_DIR
,
"tools"
,
"pyproject.toml"
),
"rb"
)
as
f
:
with
open
(
os
.
path
.
join
(
MAIN_DIR
,
"tools"
,
"pyproject.toml"
),
"rb"
)
as
f
:
contents
=
f
.
read
()
contents
=
f
.
read
()
assert
pyproject_toml
==
contents
assert
pyproject_toml
==
contents
def
test_build_global_dist
(
monkeypatch
,
tmpdir
):
def
test_build_global_dist
(
monkeypatch
,
tmpdir
):
...
...
tools/pybind11Config.cmake.in
View file @
7cc0ebb4
...
@@ -201,7 +201,8 @@ Using ``find_package`` with version info is not recommended except for release v
...
@@ -201,7 +201,8 @@ Using ``find_package`` with version info is not recommended except for release v
@PACKAGE_INIT@
@PACKAGE_INIT@
# Location of pybind11/pybind11.h
# Location of pybind11/pybind11.h
set(pybind11_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
# This will be relative unless explicitly set as absolute
set(pybind11_INCLUDE_DIR "@pybind11_INCLUDEDIR@")
set(pybind11_LIBRARY "")
set(pybind11_LIBRARY "")
set(pybind11_DEFINITIONS USING_pybind11)
set(pybind11_DEFINITIONS USING_pybind11)
...
...
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