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
6a1734af
Commit
6a1734af
authored
Oct 09, 2016
by
Wenzel Jakob
Browse files
minor cmake cleanups
parent
c3d8b8cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
CMakeLists.txt
CMakeLists.txt
+1
-0
tests/CMakeLists.txt
tests/CMakeLists.txt
+3
-8
No files found.
CMakeLists.txt
View file @
6a1734af
...
@@ -25,6 +25,7 @@ set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling
...
@@ -25,6 +25,7 @@ set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling
list
(
APPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_LIST_DIR
}
/tools"
)
list
(
APPEND CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_LIST_DIR
}
/tools"
)
set
(
Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7
)
set
(
Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6 3.7
)
find_package
(
PythonLibsNew
${
PYBIND11_PYTHON_VERSION
}
REQUIRED
)
find_package
(
PythonLibsNew
${
PYBIND11_PYTHON_VERSION
}
REQUIRED
)
message
(
${
PYTHONLIBS_FOUND
}
)
include
(
CheckCXXCompilerFlag
)
include
(
CheckCXXCompilerFlag
)
...
...
tests/CMakeLists.txt
View file @
6a1734af
...
@@ -76,17 +76,12 @@ if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
...
@@ -76,17 +76,12 @@ if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
endif
()
endif
()
# Make sure pytest is found or produce a fatal error
# Make sure pytest is found or produce a fatal error
macro
(
pybind11_execute_python
)
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
-m
${
ARGN
}
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE pybind11_execute_python_error
)
endmacro
()
if
(
NOT PYBIND11_PYTEST_FOUND
)
if
(
NOT PYBIND11_PYTEST_FOUND
)
pybind11_execute_python
(
pytest --version --noconftest
)
execute_process
(
COMMAND
${
PYTHON_EXECUTABLE
}
-m pytest --version --noconftest OUTPUT_QUIET ERROR_QUIET
if
(
pybind11_execute_python_error
)
RESULT_VARIABLE PYBIND11_EXEC_PYTHON_ERR
)
if
(
PYBIND11_EXEC_PYTHON_ERR
)
message
(
FATAL_ERROR
"Running the tests requires pytest. Please install it manually (try:
${
PYTHON_EXECUTABLE
}
-m pip install pytest)"
)
message
(
FATAL_ERROR
"Running the tests requires pytest. Please install it manually (try:
${
PYTHON_EXECUTABLE
}
-m pip install pytest)"
)
endif
()
endif
()
set
(
PYBIND11_PYTEST_FOUND TRUE CACHE INTERNAL
""
)
set
(
PYBIND11_PYTEST_FOUND TRUE CACHE INTERNAL
""
)
endif
()
endif
()
...
...
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