Work on getting the OpenGL/Qt5 support working with new header-only library.
This commit is contained in:
@ -24,29 +24,38 @@ PROJECT(BasicExample)
|
||||
#Projects source files
|
||||
SET(SRC_FILES
|
||||
main.cpp
|
||||
OpenGLWidget.cpp
|
||||
../common/OpenGLWidget.cpp
|
||||
)
|
||||
|
||||
#Projects headers files
|
||||
SET(INC_FILES
|
||||
OpenGLWidget.h
|
||||
../common/OpenGLWidget.h
|
||||
)
|
||||
|
||||
add_definitions(-DGLEW_STATIC)
|
||||
|
||||
#"Sources" and "Headers" are the group names in Visual Studio.
|
||||
#They may have other uses too...
|
||||
SOURCE_GROUP("Sources" FILES ${SRC_FILES})
|
||||
SOURCE_GROUP("Headers" FILES ${INC_FILES})
|
||||
|
||||
FIND_PACKAGE(OpenGL REQUIRED)
|
||||
|
||||
#Tell CMake the paths for OpenGL and for PolyVox (which is just relative to our current location)
|
||||
INCLUDE_DIRECTORIES(${PolyVoxHeaders_SOURCE_DIR})
|
||||
LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR})
|
||||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${PolyVoxHeaders_SOURCE_DIR} ${GLEW_SOURCE_DIR})
|
||||
|
||||
#This will include the shader files inside the compiled binary
|
||||
QT5_ADD_RESOURCES(COMMON_RESOURCES_RCC ../common/example.qrc)
|
||||
|
||||
# Put the resources in a seperate folder in Visual Studio
|
||||
SOURCE_GROUP("Resource Files" FILES ../common/example.qrc ${COMMON_RESOURCES_RCC})
|
||||
|
||||
#Build
|
||||
ADD_EXECUTABLE(BasicExample ${SRC_FILES})
|
||||
ADD_EXECUTABLE(BasicExample ${SRC_FILES} ${COMMON_RESOURCES_RCC})
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127")
|
||||
SET_TARGET_PROPERTIES(BasicExample PROPERTIES COMPILE_FLAGS "/W4 /wd4127") #All warnings
|
||||
ENDIF(MSVC)
|
||||
TARGET_LINK_LIBRARIES(BasicExample Qt5::OpenGL ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} PolyVoxCore)
|
||||
TARGET_LINK_LIBRARIES(BasicExample glew Qt5::OpenGL ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
|
||||
SET_PROPERTY(TARGET BasicExample PROPERTY FOLDER "Examples")
|
||||
|
||||
#Install - Only install the example in Windows
|
||||
|
Reference in New Issue
Block a user