2013-09-07 11:24:32 -06:00
|
|
|
include(FindPkgConfig OPTIONAL)
|
|
|
|
|
|
|
|
# This is a hack to deal with Ubuntu's mess.
|
|
|
|
# Ubuntu's version of glew is 1.8, but they have patched in most of glew 1.9.
|
|
|
|
# So Ubuntu's version works for dolphin.
|
|
|
|
macro(test_glew)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${GLEW_INCLUDE_DIRS})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES GLEW)
|
|
|
|
check_cxx_source_runs("
|
|
|
|
#include <GL/glew.h>
|
|
|
|
int main()
|
|
|
|
{
|
2013-12-27 14:37:31 -07:00
|
|
|
#ifdef GLEW_ARB_buffer_storage
|
2013-09-07 11:24:32 -06:00
|
|
|
return 0;
|
|
|
|
#else
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
}"
|
2013-12-27 14:37:31 -07:00
|
|
|
GLEW_HAS_1_10_METHODS)
|
|
|
|
|
2013-09-07 11:24:32 -06:00
|
|
|
endmacro()
|
|
|
|
|
|
|
|
if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
|
2013-09-09 15:48:14 -06:00
|
|
|
pkg_search_module(GLEW glew>=1.8)
|
2013-09-07 11:24:32 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(GLEW_FOUND)
|
|
|
|
test_glew()
|
2013-12-27 14:37:31 -07:00
|
|
|
if (GLEW_HAS_1_10_METHODS)
|
2013-09-07 11:24:32 -06:00
|
|
|
include_directories(${GLEW_INCLUDE_DIRS})
|
|
|
|
message("GLEW found")
|
|
|
|
endif()
|
|
|
|
endif()
|