X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=CMakeLists.txt;h=d4f11ad8c96d27d04dec864bfa9c5f821baebe5e;hp=10961587b04c6fd91f4f3bc7348923e6a0be0a33;hb=78f3329f3481c13886be0189c58b98ee29a4c484;hpb=283dea13d9305a10cc309eb7b524b514012f4be7 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1096158..d4f11ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 2.8) - +INCLUDE (FindPythonInterp) # Use clang on MacOSX. gcc doesn't support __thread key, and Apple has # abandoned it for clang. This must be done before the project is defined. @@ -21,6 +21,7 @@ if (NOT EXISTS ${APITRACE_EXECUTABLE}) message (WARNING "Please specify path to apitrace executable via APITRACE_EXECUTABLE") endif () +include (FindPythonInterp) include (FindPkgConfig) set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) @@ -47,6 +48,19 @@ elseif (PKG_CONFIG_FOUND) pkg_check_modules (GLESV2 glesv2) endif () +# Check for the presence of several python packages, which are needed to build +# generated tests. +execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c "import PIL" + OUTPUT_QUIET + ERROR_QUIET + RESULT_VARIABLE IMPORT_PIL_RESULT) +if (IMPORT_PIL_RESULT EQUAL 0) + set (PIL_FOUND 1) +else () + message (STATUS "python PIL module not found") +endif () + if (UNIX) link_libraries(m) endif (UNIX) @@ -95,12 +109,13 @@ add_subdirectory (traces) # portable across all platforms. However, these tests all rely on # doing image comparisons and the current implementation of the # "apitrace dump-images" command relies on direct invocation of the -# glretrace command. +# glreplay command. # # Someday, we should have more unified commands for replaying traces, # dumping images, etc. At that point these cli tests should be usable # with all targets so that we can drop the "if (OPENGL_FOUND)" # condition here. -if (OPENGL_FOUND) +if (OPENGL_FOUND AND PIL_FOUND) add_subdirectory (cli) + add_subdirectory (trim_stress) endif ()