On 2011-01-04, José Fonseca <jfons...@vmware.com> wrote: > Kristof, > > It looks good overall with the exception that the build will fail if the > EGL library is not available. > > Please guard the egl subdirectories and/or targets with > > if (EGL_egl_LIBRARY) > ... > endif (EGL_egl_LIBRARY) > > and make sure that when EGL library is not available the build will > still succeed. > > Jose >
Jose, thanks for the feedback. Updated patch is attached. Thanks, Kristof > > On Mon, 2011-01-03 at 13:15 -0800, kristof.ralov...@gmail.com wrote: > > > > >> >> From da2803a63896362940f0d36cb6412ae46cfd345a Mon Sep 17 00:00:00 2001 >> From: =?UTF-8?q?RALOVICH,=20Krist=C3=B3f?= <tad...@freemail.hu> >> Date: Mon, 3 Jan 2011 22:13:51 +0100 >> Subject: [PATCH] cmake: add build system to some of the egl demos >> >> --- >> CMakeLists.txt | 2 ++ >> src/CMakeLists.txt | 2 ++ >> src/egl/CMakeLists.txt | 2 ++ >> src/egl/eglut/CMakeLists.txt | 7 +++++++ >> src/egl/opengl/CMakeLists.txt | 15 +++++++++++++++ >> 5 files changed, 28 insertions(+), 0 deletions(-) >> create mode 100644 src/egl/CMakeLists.txt >> create mode 100644 src/egl/eglut/CMakeLists.txt >> create mode 100644 src/egl/opengl/CMakeLists.txt >> >> diff --git a/CMakeLists.txt b/CMakeLists.txt >> index cd84233..7b5dcf9 100644 >> --- a/CMakeLists.txt >> +++ b/CMakeLists.txt >> @@ -6,6 +6,8 @@ find_package (OpenGL REQUIRED) >> find_package (GLUT REQUIRED) >> find_package (X11) >> >> +find_library(EGL_egl_LIBRARY EGL /usr/lib) >> + >> find_library (GLEW_glew_LIBRARY GLEW >> /usr/lib >> ) >> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt >> index fa377d1..7f874a3 100644 >> --- a/src/CMakeLists.txt >> +++ b/src/CMakeLists.txt >> @@ -14,6 +14,8 @@ add_subdirectory (vp) >> add_subdirectory (vpglsl) >> add_subdirectory (gs) >> >> +add_subdirectory(egl) >> + >> if (X11_FOUND) >> add_subdirectory (xdemos) >> endif (X11_FOUND) >> diff --git a/src/egl/CMakeLists.txt b/src/egl/CMakeLists.txt >> new file mode 100644 >> index 0000000..0318575 >> --- /dev/null >> +++ b/src/egl/CMakeLists.txt >> @@ -0,0 +1,2 @@ >> +add_subdirectory(eglut) >> +add_subdirectory(opengl) >> \ No newline at end of file >> diff --git a/src/egl/eglut/CMakeLists.txt >> b/src/egl/eglut/CMakeLists.txt >> new file mode 100644 >> index 0000000..76d48df >> --- /dev/null >> +++ b/src/egl/eglut/CMakeLists.txt >> @@ -0,0 +1,7 @@ >> +if(X11_FOUND) >> + add_library(eglut_x11 eglut.h eglut.c eglutint.h eglut_x11.c) >> + target_link_libraries(eglut_x11 ${OPENGL_gl_LIBRARY}) >> +endif(X11_FOUND) >> + >> +add_library(eglut_screen eglut.h eglut.c eglutint.h eglut_screen.c) >> +target_link_libraries(eglut_screen ${OPENGL_gl_LIBRARY}) >> diff --git a/src/egl/opengl/CMakeLists.txt >> b/src/egl/opengl/CMakeLists.txt >> new file mode 100644 >> index 0000000..ede9ec3 >> --- /dev/null >> +++ b/src/egl/opengl/CMakeLists.txt >> @@ -0,0 +1,15 @@ >> +include_directories(${EGL_INCLUDE_DIR} >> + ../eglut >> + ) >> + >> +add_executable(eglinfo eglinfo.c) >> +target_link_libraries(eglinfo ${EGL_egl_LIBRARY}) >> + >> +add_executable(eglgears_screen eglgears.c) >> +target_link_libraries(eglgears_screen ${EGL_egl_LIBRARY} >> eglut_screen) >> + >> +if(X11_FOUND) >> + add_executable(eglgears_x11 eglgears.c) >> + target_link_libraries(eglgears_x11 ${EGL_egl_LIBRARY} eglut_x11) >> +endif(X11_FOUND) >> + >> -- >> 1.7.1 >> >> >> >> >> >> >> >> Python File (no >> console) >> attachment >> (ATT00001..txt) >> >> > >
From 4b090b6fe6f9c3e4234a57446386a127d89fc50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?RALOVICH,=20Krist=C3=B3f?= <tad...@freemail.hu> Date: Thu, 6 Jan 2011 20:56:41 +0100 Subject: [PATCH] cmake: add build system to some of the egl demos --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 4 ++++ src/egl/CMakeLists.txt | 2 ++ src/egl/eglut/CMakeLists.txt | 7 +++++++ src/egl/opengl/CMakeLists.txt | 15 +++++++++++++++ 5 files changed, 30 insertions(+), 0 deletions(-) create mode 100644 src/egl/CMakeLists.txt create mode 100644 src/egl/eglut/CMakeLists.txt create mode 100644 src/egl/opengl/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index cd84233..7b5dcf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ find_package (OpenGL REQUIRED) find_package (GLUT REQUIRED) find_package (X11) +find_library(EGL_egl_LIBRARY EGL /usr/lib) + find_library (GLEW_glew_LIBRARY GLEW /usr/lib ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fa377d1..ac745f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,10 @@ add_subdirectory (vp) add_subdirectory (vpglsl) add_subdirectory (gs) +if(EGL_egl_LIBRARY) + add_subdirectory(egl) +endif(EGL_egl_LIBRARY) + if (X11_FOUND) add_subdirectory (xdemos) endif (X11_FOUND) diff --git a/src/egl/CMakeLists.txt b/src/egl/CMakeLists.txt new file mode 100644 index 0000000..0318575 --- /dev/null +++ b/src/egl/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(eglut) +add_subdirectory(opengl) \ No newline at end of file diff --git a/src/egl/eglut/CMakeLists.txt b/src/egl/eglut/CMakeLists.txt new file mode 100644 index 0000000..76d48df --- /dev/null +++ b/src/egl/eglut/CMakeLists.txt @@ -0,0 +1,7 @@ +if(X11_FOUND) + add_library(eglut_x11 eglut.h eglut.c eglutint.h eglut_x11.c) + target_link_libraries(eglut_x11 ${OPENGL_gl_LIBRARY}) +endif(X11_FOUND) + +add_library(eglut_screen eglut.h eglut.c eglutint.h eglut_screen.c) +target_link_libraries(eglut_screen ${OPENGL_gl_LIBRARY}) diff --git a/src/egl/opengl/CMakeLists.txt b/src/egl/opengl/CMakeLists.txt new file mode 100644 index 0000000..ede9ec3 --- /dev/null +++ b/src/egl/opengl/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${EGL_INCLUDE_DIR} + ../eglut + ) + +add_executable(eglinfo eglinfo.c) +target_link_libraries(eglinfo ${EGL_egl_LIBRARY}) + +add_executable(eglgears_screen eglgears.c) +target_link_libraries(eglgears_screen ${EGL_egl_LIBRARY} eglut_screen) + +if(X11_FOUND) + add_executable(eglgears_x11 eglgears.c) + target_link_libraries(eglgears_x11 ${EGL_egl_LIBRARY} eglut_x11) +endif(X11_FOUND) + -- 1.7.1
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev