Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
5c6bdb72
Unverified
Commit
5c6bdb72
authored
Jul 27, 2021
by
Henry Schreiner
Committed by
Henry Schreiner
Jul 28, 2021
Browse files
fix: the CMake config in Python package had a hard coded path (#3144)
parent
fd71bd48
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
CMakeLists.txt
CMakeLists.txt
+6
-0
tests/extra_python_package/test_files.py
tests/extra_python_package/test_files.py
+12
-2
tools/pybind11Config.cmake.in
tools/pybind11Config.cmake.in
+2
-1
No files found.
CMakeLists.txt
View file @
5c6bdb72
...
@@ -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 @
5c6bdb72
...
@@ -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
}
...
...
tools/pybind11Config.cmake.in
View file @
5c6bdb72
...
@@ -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