Fix test_cmake_build failure with bare python exe name (fix #783)

Besides appearing in the CMake GUI, the `:FILENAME` specifier changes
behavior as well:

cmake -DPYTHON_EXECUTABLE=python ..  # FAIL, can't find python
cmake -DPYTHON_EXECUTABLE=/path/to/python ..  # OK
cmake -DPYTHON_EXECUTABLE:FILENAME=python ..  # OK
cmake -DPYTHON_EXECUTABLE:FILENAME=/path/to/python ..  # OK
This commit is contained in:
Dean Moldovan 2017-04-06 22:41:24 +02:00
parent 087b8d84e9
commit 555dc4f07a

View File

@ -197,7 +197,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.1)
set(build_options "-DCMAKE_PREFIX_PATH=${PROJECT_BINARY_DIR}/mock_install"
"-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
"-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
"-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
"-DPYBIND11_CPP_STANDARD=${PYBIND11_CPP_STANDARD}")
if(NOT ARG_INSTALL)
list(APPEND build_options "-DPYBIND11_PROJECT_DIR=${PROJECT_SOURCE_DIR}")