Make sure Python is present before pulling in gtest.

The CMake build of gtest requires python. Make sure it's
on the system, and disable tests when it's not. Also note
the Python requirement in the prereqs section of README.md.

BUG=aomedia:604

Change-Id: Iafe4891eca121eb57548e14b08477dc3c8a9c9df
This commit is contained in:
Tom Finegan 2017-06-20 14:18:03 -07:00
Родитель a325233ab1
Коммит ff766cd2c8
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -10,6 +10,7 @@
4. For x86 targets, [yasm](http://yasm.tortall.net/), which is preferred, or a 4. For x86 targets, [yasm](http://yasm.tortall.net/), which is preferred, or a
recent version of [nasm](http://www.nasm.us/). recent version of [nasm](http://www.nasm.us/).
5. Building the documentation requires [doxygen](http://doxygen.org). 5. Building the documentation requires [doxygen](http://doxygen.org).
6. Building the unit tests requires [Python](https://www.python.org/).
### Basic build ### Basic build

Просмотреть файл

@ -11,6 +11,7 @@
if (NOT AOM_TEST_TEST_CMAKE_) if (NOT AOM_TEST_TEST_CMAKE_)
set(AOM_TEST_TEST_CMAKE_ 1) set(AOM_TEST_TEST_CMAKE_ 1)
include(FindPythonInterp)
include(ProcessorCount) include(ProcessorCount)
include("${AOM_ROOT}/test/test_data_util.cmake") include("${AOM_ROOT}/test/test_data_util.cmake")
@ -294,6 +295,12 @@ if (CONFIG_HIGHBITDEPTH)
endif () endif ()
if (CONFIG_UNIT_TESTS) if (CONFIG_UNIT_TESTS)
find_package(PythonInterp)
if (NOT PYTHONINTERP_FOUND)
message(WARNING "--- Unit tests disabled: Python not found.")
set(CONFIG_UNIT_TESTS 0)
endif ()
if (MSVC) if (MSVC)
# Force static run time to avoid collisions with googletest. # Force static run time to avoid collisions with googletest.
include("${AOM_ROOT}/build/cmake/msvc_runtime.cmake") include("${AOM_ROOT}/build/cmake/msvc_runtime.cmake")