summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2013-10-31 10:21:18 -0700
committerChad Versace <chad.versace@linux.intel.com>2013-10-31 10:43:34 -0700
commit72ff251ee320a0e1bfbeb0e3d3e3c72a514394f2 (patch)
treed042d7a6916da7d6abbea13ca98766beed373af7 /CMakeLists.txt
parente117ead5a8d38d939019f4d749f90d71a9ee19a6 (diff)
cmake: Fail if PIGLIT_BUILD_GLES${N}_TESTS but cannot find EGL
If the user requests to build GLES tests but cmake fails to find the EGL library, then configuration succeeded. Not until much later did faiure occur, during linking the GLES tests. Instead, cmake should fail early, during configuration not linking.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f452f8b95..142d7bfb7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -295,6 +295,21 @@ if(OPENGL_egl_LIBRARY)
add_definitions(-DPIGLIT_HAS_EGL)
endif()
+if(PIGLIT_BUILD_GLES1_TESTS AND NOT OPENGL_egl_LIBRARY)
+ message(FATAL_ERROR "Option PIGLIT_BUILD_GLES1_TESTS requires EGL. "
+ "Failed to find EGL library.")
+endif()
+
+if(PIGLIT_BUILD_GLES2_TESTS AND NOT OPENGL_egl_LIBRARY)
+ message(FATAL_ERROR "Option PIGLIT_BUILD_GLES2_TESTS requires EGL. "
+ "Failed to find EGL library.")
+endif()
+
+if(PIGLIT_BUILD_GLES3_TESTS AND NOT OPENGL_egl_LIBRARY)
+ message(FATAL_ERROR "Option PIGLIT_BUILD_GLES3_TESTS requires EGL. "
+ "Failed to find EGL library.")
+endif()
+
find_library(OPENGL_gles1_LIBRARY NAMES GLESv1_CM)
find_library(OPENGL_gles2_LIBRARY NAMES GLESv2)