[Mesa-dev] [PATCH] cmake: add build system to some of the egl demos

kristof.ralovich at gmail.com kristof.ralovich at gmail.com
Thu Jan 6 11:58:40 PST 2011


On 2011-01-04, José Fonseca <jfonseca at 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.ralovich at gmail.com wrote:
>
>
>
>
>>
>> From da2803a63896362940f0d36cb6412ae46cfd345a Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?RALOVICH,=20Krist=C3=B3f?= <tade60 at 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)
>>
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cmake-add-build-system-to-some-of-the-egl-demos.patch
Type: text/x-patch
Size: 2653 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110106/b0c0d343/attachment-0001.bin>


More information about the mesa-dev mailing list