Commit bb59ea00 authored by Johnny Jazeix's avatar Johnny Jazeix

Add vbo/glew support for cmake compilation.

Add windows icon for windows compilation.
parent 15ae9e0b
......@@ -13,7 +13,10 @@ SET(QT_USE_QTUITOOLS ON)
SET(QT_USE_QTOPENGL ON)
INCLUDE(${QT_USE_FILE})
FIND_PACKAGE(GLUT)
OPTION(VITE_ENABLE_VBO "Enable the support of VBO." OFF)
IF(VITE_ENABLE_VBO)
INCLUDE(cmake/FindGLEW.cmake)
ENDIF(VITE_ENABLE_VBO)
OPTION(VITE_ENABLE_OTF "Enable the support of OTF file format." OFF)
IF(VITE_ENABLE_OTF)
......
#
# Try to find GLEW library and include path.
# Once done this will define
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
IF (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY
NAMES GLEW glew
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The GLEW library")
ENDIF (WIN32)
IF (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ELSE (GLEW_INCLUDE_PATH)
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
ENDIF (GLEW_INCLUDE_PATH)
MARK_AS_ADVANCED( GLEW_FOUND )
\ No newline at end of file
......@@ -93,7 +93,6 @@ SET(VITE_HDRS
render/render_stats_opengl.hpp
render/render_stats_svg.hpp
render/Ruler.hpp
#render/vbo.hpp
# Interface headers
interface/resource.hpp
interface/parsing_thread.hpp
......@@ -172,7 +171,7 @@ SET(VITE_SRCS
render/render_stats_opengl.cpp
render/render_stats_svg.cpp
render/Ruler.cpp
#render/vbo.cpp
# Parser code files
parser/Definition.cpp
parser/Line.cpp
......@@ -199,6 +198,21 @@ SET(VITE_RCCS
interface/vite.qrc
)
IF(VITE_ENABLE_VBO)
ADD_DEFINITIONS(-DWITH_VBO)
SET(VITE_HDRS
${VITE_HDRS}
render/vbo.hpp
)
SET(VITE_SRCS
${VITE_SRCS}
render/vbo.cpp
)
ENDIF(VITE_ENABLE_VBO)
IF(VITE_ENABLE_OTF)
ADD_DEFINITIONS(-DWITH_OTF)
......@@ -250,6 +264,12 @@ TARGET_LINK_LIBRARIES(vite
# ${GLUT_LIBRARIES}
)
IF(VITE_ENABLE_VBO)
TARGET_LINK_LIBRARIES(vite
${GLEW_LIBRARY}
)
ENDIF(VITE_ENABLE_VBO)
IF(VITE_ENABLE_OTF)
TARGET_LINK_LIBRARIES(vite
${OTF_LIBRARY}
......
......@@ -224,3 +224,6 @@ SOURCES += common/Message.cpp \
RESOURCES += interface/vite.qrc
# Windows icon
RC_FILE = interface/windows_icon.rc
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