Created
January 10, 2016 20:35
-
-
Save icedraco/3ae34b1917cd4e036b54 to your computer and use it in GitHub Desktop.
Example cmake configuration file for working with OpenGL on JetBrains CLion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: IF THIS FAILS, YOU MAY HAVE TO | |
# sudo apt-get install libxmu-dev libxi-dev | |
# http://ubuntuforums.org/showthread.php?t=1703770 | |
cmake_minimum_required(VERSION 3.3) | |
project(ass4) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
#--- Find GLUT | |
find_package(GLUT REQUIRED) | |
include_directories(${GLUT_INCLUDE_DIRS}) | |
link_directories(${GLUT_LIBRARY_DIRS}) | |
add_definitions(${GLUT_DEFINITIONS}) | |
if(NOT GLUT_FOUND) | |
message(ERROR " GLUT not found!") | |
endif(NOT GLUT_FOUND) | |
#--- Find OpenGL | |
find_package(OpenGL REQUIRED) | |
include_directories(${OpenGL_INCLUDE_DIRS}) | |
link_directories(${OpenGL_LIBRARY_DIRS}) | |
add_definitions(${OpenGL_DEFINITIONS}) | |
if(NOT OPENGL_FOUND) | |
message(ERROR " OPENGL not found!") | |
endif(NOT OPENGL_FOUND) | |
#--- GL includes | |
include_directories( | |
"/usr/include/GL" | |
) | |
#--- Source files | |
set(SOURCE_FILES | |
ColorProperties.h | |
ColorTable.h | |
ColorTableParser.cpp | |
ColorTableParser.h | |
Face.h | |
Group.h | |
main.cpp | |
Object.cpp | |
Object.h | |
ObjectPainter.cpp | |
ObjectPainter.h | |
ObjExporter.cpp | |
ObjExporter.h | |
ObjParser.cpp | |
ObjParser.h | |
PaintCommand.cpp | |
PaintCommand.h | |
Point.h | |
RgbColor.h | |
Side.h | |
Vector.h | |
Vector3f.h | |
Vertex.h) | |
add_executable(ass4 ${SOURCE_FILES}) | |
target_link_libraries(ass4 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment