Skip to content

Commit 34f9a1b

Browse files
authored
Merge pull request #84 from dzenanz/master
COMP: fix CMake configure error when Python is not found
2 parents e5f6d08 + 5e3f64b commit 34f9a1b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ endif()
1919

2020
if(BUILD_DOCUMENTATION)
2121
find_package(PythonInterp REQUIRED)
22-
23-
# Set here the proper version of Python required to be able to build
24-
# tarballs for each example
25-
set(PYTHON_REQUIRED_VERSION 2.7)
26-
if(${PYTHON_VERSION_STRING} VERSION_LESS ${PYTHON_REQUIRED_VERSION})
27-
message(SEND_ERROR "Building the documentation requires Python >= ${PYTHON_REQUIRED_VERSION}")
22+
if(NOT PYTHONINTERP_FOUND)
23+
message(SEND_ERROR "Building the documentation requires Python")
24+
else()
25+
# Set here the proper version of Python required to be able to build
26+
# tarballs for each example
27+
set(PYTHON_REQUIRED_VERSION 2.7)
28+
if(${PYTHON_VERSION_STRING} VERSION_LESS ${PYTHON_REQUIRED_VERSION})
29+
message(SEND_ERROR "Building the documentation requires Python >= ${PYTHON_REQUIRED_VERSION}")
30+
endif()
2831
endif()
2932
endif()
3033

0 commit comments

Comments
 (0)