]> git.cworth.org Git - apitrace-tests/blobdiff - CMakeLists.txt
Be more lenient with shader matching.
[apitrace-tests] / CMakeLists.txt
index 7c55f765740d27d08ab1ca961a23338755977aff..d9398c079f384add4d58697773c5e4412484ceba 100644 (file)
@@ -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)
@@ -101,7 +115,7 @@ add_subdirectory (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 ()