From 78604f4e78e3cfc6cbff895a96d739f3cb9610ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Dec 2013 16:24:40 +0100 Subject: [PATCH] Mac buildfix (the zlib include path made it include the system glew) --- CMakeLists.txt | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b47454290f..721e2041aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,6 +288,20 @@ if(WIN32) target_link_libraries(Common winmm) endif() +if(NOT USING_GLES2) + include_directories(${OPENGL_INCLUDE_DIR}) + + add_definitions(-DGLEW_STATIC) + add_library(glew STATIC + native/ext/glew/GL/glew.h + native/ext/glew/GL/glxew.h + native/ext/glew/GL/wglew.h + native/ext/glew/glew.c) + target_link_libraries(glew ${OPENGL_LIBRARIES}) + include_directories(native/ext/glew) + set(GLEW_LIBRARIES glew) +endif() + find_package(ZLIB) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIR}) @@ -348,20 +362,6 @@ add_library(rg_etc1 STATIC native/ext/rg_etc1/rg_etc1.h) include_directories(native/ext/rg_etc1) -if(NOT USING_GLES2) - include_directories(${OPENGL_INCLUDE_DIR}) - - add_definitions(-DGLEW_STATIC) - add_library(glew STATIC - native/ext/glew/GL/glew.h - native/ext/glew/GL/glxew.h - native/ext/glew/GL/wglew.h - native/ext/glew/glew.c) - target_link_libraries(glew ${OPENGL_LIBRARIES}) - include_directories(native/ext/glew) - set(GLEW_LIBRARIES glew) -endif() - add_library(stb_image STATIC native/ext/stb_image/stb_image.c native/ext/stb_image/stb_image.h) @@ -1331,7 +1331,9 @@ if(APPLE) # These can be fast even for debug. set_target_properties(snappy PROPERTIES COMPILE_FLAGS "-O3") - set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O3") + if(NOT ZLIB_FOUND) + set_target_properties(zlib PROPERTIES COMPILE_FLAGS "-O3") + endif() endif() if(APPLE AND NOT IOS)