[Piglit] [PATCH 4/4] cmake: Use pkg-config to find EGL
Chad Versace
chad.versace at linux.intel.com
Thu Oct 17 00:30:13 CEST 2013
Windows doesn't have pkg-config. So, if Piglit ever wants to support the
EGL tests on Windows, we will need to create a wrapper that calls into
pkg_check_modules() or find_package() based on OS.
Should fix Ian's build failure with egl-terminate-then-unbind-context.c.
CC: Ian Romanick <idr at freedesktop.org>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
CMakeLists.txt | 8 ++------
tests/egl/CMakeLists.gl.txt | 2 +-
tests/egl/spec/egl-1.4/CMakeLists.gles2.txt | 2 +-
tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt | 2 +-
tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt | 2 +-
tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt | 2 +-
tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt | 2 +-
tests/util/CMakeLists.txt | 2 +-
8 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dfdfb27..6ba4f08 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,13 +135,9 @@ IF(PIGLIT_BUILD_GLX_TESTS)
ENDIF()
if(PIGLIT_BUILD_EGL_TESTS)
- FIND_LIBRARY(OPENGL_egl_LIBRARY
- REQUIRED
- NAMES EGL
- PATHS /usr/lib
- )
-
+ pkg_check_modules(EGL REQUIRED egl)
add_definitions(-DPIGLIT_HAS_EGL)
+ include_directories(${EGL_INCLUDE_DIRS})
endif()
# Check for presence of Python 2.6 or greater.
diff --git a/tests/egl/CMakeLists.gl.txt b/tests/egl/CMakeLists.gl.txt
index 03b2ae0..4a2a57c 100644
--- a/tests/egl/CMakeLists.gl.txt
+++ b/tests/egl/CMakeLists.gl.txt
@@ -6,9 +6,9 @@ include_directories(
link_libraries (
piglitutil_${piglit_target_api}
+ ${EGL_LDFLAGS}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
- ${OPENGL_egl_LIBRARY}
)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
diff --git a/tests/egl/spec/egl-1.4/CMakeLists.gles2.txt b/tests/egl/spec/egl-1.4/CMakeLists.gles2.txt
index b6bb1e8..a6985eb 100644
--- a/tests/egl/spec/egl-1.4/CMakeLists.gles2.txt
+++ b/tests/egl/spec/egl-1.4/CMakeLists.gles2.txt
@@ -1,6 +1,6 @@
link_libraries(
piglitutil_${piglit_target_api}
- ${OPENGL_egl_LIBRARY}
+ ${EGL_LDFLAGS}
)
piglit_add_executable(egl-terminate-then-unbind-context egl-terminate-then-unbind-context.c)
diff --git a/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt b/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
index 0abd764..84f8b51 100644
--- a/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
+++ b/tests/egl/spec/egl_khr_create_context/CMakeLists.gl.txt
@@ -6,8 +6,8 @@ include_directories(
)
link_libraries (
+ ${EGL_LDFLAGS}
${OPENGL_gl_LIBRARY}
- ${OPENGL_egl_LIBRARY}
)
piglit_add_executable (egl-create-context-default-major-version-gl default-major-version-gl.c common.c)
diff --git a/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
index 80e6380..dde8960 100644
--- a/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
+++ b/tests/egl/spec/egl_khr_create_context/CMakeLists.gles2.txt
@@ -7,10 +7,10 @@ include_directories(
link_libraries (
piglitutil_${piglit_target_api}
+ ${EGL_LDFLAGS}
${OPENGL_gles1_LIBRARY}
${OPENGL_gles2_LIBRARY}
${OPENGL_gl_LIBRARY}
- ${OPENGL_egl_LIBRARY}
)
# Tests that use ES 1.
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
index b60e507..fa96303 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
@@ -5,8 +5,8 @@ include_directories(
)
link_libraries(
+ ${EGL_LDFLAGS}
${OPENGL_gles1_LIBRARY}
- ${OPENGL_egl_LIBRARY}
piglitutil_gles1
)
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
index f8ebd21..80f1c83 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
@@ -5,7 +5,7 @@ include_directories(
)
link_libraries(
- ${OPENGL_egl_LIBRARY}
+ ${EGL_LDFLAGS}
piglitutil_gles2
)
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 1c5d853..f5a8081 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -92,7 +92,7 @@ if(PIGLIT_BUILD_EGL_TESTS)
)
set(UTIL_GL_LIBS
${UTIL_GL_LIBS}
- ${OPENGL_egl_LIBRARY}
+ ${EGL_LDFLAGS}
)
endif()
--
1.8.3.1
More information about the Piglit
mailing list