Improve CMake file and FindOpenGLES script

CMake should now add proper library files and paths to the build files.
FindOpenGLES.cmake should now hopefully find GLES on Raspberry Pi.
This commit is contained in:
Bim Overbohm 2013-05-16 12:04:02 +02:00
parent fb1e2d8595
commit 1d9cee83a5
3 changed files with 28 additions and 16 deletions

7
.gitignore vendored
View file

@ -18,4 +18,9 @@
emulationstation
#build directory
EmulationStation_vs2010
EmulationStation_vs2010
build
Debug
Release
MinSizeRel
RelWithDebInfo

View file

@ -24,12 +24,11 @@ IF (WIN32)
ELSE (CYGWIN)
IF(BORLAND)
IF(MSVC)
#The user hast to provide this atm. GLES can be emulated via Desktop OpenGL
#using the ANGLE project found at: http://code.google.com/p/angleproject/
SET (OPENGLES_gl_LIBRARY import32 CACHE STRING "OpenGL ES 1.x library for win32")
ELSE(BORLAND)
#MS compiler - todo - fix the following line:
SET (OPENGLES_gl_LIBRARY ${OGRE_SOURCE_DIR}/Dependencies/lib/release/libgles_cm.lib CACHE STRING "OpenGL ES 1.x library for win32")
ENDIF(BORLAND)
ENDIF(MSVC)
ENDIF (CYGWIN)
@ -47,6 +46,7 @@ ELSE (WIN32)
/usr/openwin/share/include
/opt/graphics/OpenGL/include /usr/X11R6/include
/usr/include
/opt/vc/include
)
FIND_LIBRARY(OPENGLES_gl_LIBRARY
@ -55,6 +55,7 @@ ELSE (WIN32)
/usr/openwin/lib
/usr/shlib /usr/X11R6/lib
/usr/lib
/opt/vc/lib
)
# On Unix OpenGL most certainly always requires X11.

View file

@ -164,19 +164,29 @@ endif()
#-------------------------------------------------------------------------------
#define libraries and directories
if(DEFINED BCMHOST)
link_directories(
${Boost_LIBRARY_DIRS}
"/opt/vc/lib"
)
else()
link_directories(
${Boost_LIBRARY_DIRS}
)
endif()
set(ES_LIBRARIES
freetype
freeimage
SDL
boost_filesystem
boost_system
${Boost_LIBRARIES}
${FREETYPE_LIBRARIES}
${FreeImage_LIBRARIES}
${SDL_LIBRARY}
${SDLMAIN_LIBRARY}
)
if(DEFINED BCMHOST)
LIST(APPEND ES_LIBRARIES
bcm_host
EGL
GLESv1_CM
)
else()
if(${GLSystem} MATCHES "Desktop OpenGL")
@ -190,10 +200,6 @@ else()
endif()
endif()
if(DEFINED BCMHOST)
LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} "/opt/vc/lib")
endif()
#-------------------------------------------------------------------------------
#set up build directories
set(dir ${CMAKE_CURRENT_SOURCE_DIR})