Commit 0b7d321f authored by Adrian Page's avatar Adrian Page

Move the GLEW check higher up so we can use it anywhere.


svn path=/trunk/koffice/; revision=651812
parent 237d8e02
project(krita)
macro_optional_find_package(Kunittest)
include(CheckFunctionExists)
if (SHOULD_BUILD_KRITA)
if(NOT HAVE_OPENGL)
message(STATUS " * krita will not be able to use OpenGL for")
message(STATUS " hardware accelerated rendering.")
endif(NOT HAVE_OPENGL)
macro_optional_find_package(Kunittest)
include(CheckFunctionExists)
macro_optional_find_package(GLEW)
macro_bool_to_01(GLEW_FOUND HAVE_GLEW)
configure_file(config-glew.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-glew.h )
if(HAVE_OPENGL)
if(HAVE_GLEW)
message(STATUS "GLEW found!")
else(HAVE_GLEW)
message(STATUS "GLEW NOT found - krita will not be able to use OpenGL shaders")
endif(HAVE_GLEW)
else(HAVE_OPENGL)
message(STATUS "OpenGL NOT found - krita will not be able to use OpenGL for")
message(STATUS "hardware accelerated rendering.")
endif(HAVE_OPENGL)
# if(X11_Xinput_FOUND)
# set(HAVE_XINPUTEXT 1)
......@@ -27,11 +37,11 @@ if (SHOULD_BUILD_KRITA)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-krita.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-krita.h)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
endif(OPENEXR_FOUND)
set(LINK_OPENEXR_LIB)
if(OPENEXR_FOUND)
include_directories(${OPENEXR_INCLUDE_DIR})
set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
endif(OPENEXR_FOUND)
set(KRITA_INCLUDES
......@@ -59,6 +69,9 @@ if (SHOULD_BUILD_KRITA)
if(HAVE_OPENGL)
include_directories(${OPENGL_INCLUDE_DIR})
if(HAVE_GLEW)
include_directories(${GLEW_INCLUDE_DIR})
endif(HAVE_GLEW)
endif(HAVE_OPENGL)
if(HAVE_XINPUTEXT)
......
/* config-glew.h. Generated by cmake from config-glew.h.cmake */
/* Define if you have GLEW, the OpenGL Extension Wrangler Library */
#cmakedefine HAVE_GLEW 1
......@@ -15,15 +15,13 @@ add_subdirectory( bracketing2hdr )
add_subdirectory( together )
add_subdirectory( scripting )
macro_optional_find_package(GLEW)
macro_optional_find_package(GLUT)
if(HAVE_OPENGL)
IF(GLEW_FOUND)
IF(HAVE_GLEW)
if (GLUT_FOUND)
message(STATUS "GLEW found!")
add_subdirectory( glsl )
endif(GLUT_FOUND)
ELSE(GLEW_FOUND)
ELSE(HAVE_GLEW)
message(STATUS "Could not find the glew library. The shader filter plugin will not be built.")
ENDIF(GLEW_FOUND)
ENDIF(HAVE_GLEW)
endif(HAVE_OPENGL)
......@@ -138,10 +138,10 @@ kde4_add_library(kritaui SHARED ${kritaui_LIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/
target_link_libraries(kritaui ${KDE4_KDE3SUPPORT_LIBS} kritaimage kofficeui kopainter ${PNG_LIBRARIES})
if(HAVE_OPENGL)
target_link_libraries(kritaui
${OPENGL_LIBRARIES}
${QT_QTOPENGL_LIBRARY}
)
target_link_libraries(kritaui ${OPENGL_LIBRARIES} ${QT_QTOPENGL_LIBRARY})
if(HAVE_GLEW)
target_link_libraries(kritaui ${GLEW_LIBRARIES})
endif(HAVE_GLEW)
endif(HAVE_OPENGL)
if(HAVE_XINPUTEXT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment