diff --git a/CMakeLists.txt b/CMakeLists.txt index aa442ea2c..f0b8f75bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 2.8) +option(GLES "Set to ON if targeting OpenGL ES" ${GLES}) +option(GL "Set to ON if targeting Desktop OpenGL" ${GL}) + project(emulationstation-all) #------------------------------------------------------------------------------- @@ -11,33 +14,30 @@ LIST(APPEND CMAKE_MODULE_PATH #------------------------------------------------------------------------------- #set up OpenGL system variable -set(GLSystem "Desktop OpenGL" CACHE STRING "The OpenGL system to be used") -set_property(CACHE GLSystem PROPERTY STRINGS "Desktop OpenGL" "OpenGL ES") - +if(GLES) + set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used") +elseif(GL) + set(GLSystem "Desktop OpenGL" CACHE STRING "The OpenGL system to be used") #------------------------------------------------------------------------------- #check if we're running on Raspberry Pi -MESSAGE("Looking for bcm_host.h") -if(EXISTS "/opt/vc/include/bcm_host.h") +elseif(EXISTS "/opt/vc/include/bcm_host.h") MESSAGE("bcm_host.h found") set(BCMHOST found) - set(GLSystem "OpenGL ES") -else() - MESSAGE("bcm_host.h not found") -endif() - + set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used") #------------------------------------------------------------------------------- #check if we're running on olinuxino / odroid / etc -MESSAGE("Looking for libMali.so") -if(EXISTS "/usr/lib/libMali.so" OR - EXISTS "/usr/lib/arm-linux-gnueabihf/libMali.so" OR - EXISTS "/usr/lib/aarch64-linux-gnu/libMali.so" OR - EXISTS "/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" OR - EXISTS "/usr/lib/arm-linux-gnueabihf/libmali.so") +elseif(EXISTS "/usr/lib/libMali.so" OR + EXISTS "/usr/lib/arm-linux-gnueabihf/libMali.so" OR + EXISTS "/usr/lib/aarch64-linux-gnu/libMali.so" OR + EXISTS "/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" OR + EXISTS "/usr/lib/arm-linux-gnueabihf/libmali.so") MESSAGE("libMali.so found") - set(GLSystem "OpenGL ES") + set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used") else() - MESSAGE("libMali.so not found") -endif() + set(GLSystem "Desktop OpenGL" CACHE STRING "The OpenGL system to be used") +endif(GLES) + +set_property(CACHE GLSystem PROPERTY STRINGS "Desktop OpenGL" "OpenGL ES") #finding necessary packages #-------------------------------------------------------------------------------