Skip to content

Instantly share code, notes, and snippets.

@toughrogrammer
Created October 24, 2014 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toughrogrammer/125ea571450861562809 to your computer and use it in GitHub Desktop.
Save toughrogrammer/125ea571450861562809 to your computer and use it in GitHub Desktop.
cmakelists for opengl, glut on mac(practical)
cmake_minimum_required(VERSION 2.8.4)
project(helloworld)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#########################################################
# Include Files
#########################################################
set(SOURCE_FILES main.cpp Cool.cpp)
add_executable(helloworld ${SOURCE_FILES})
IF (APPLE)
include_directories (/System/Library/Frameworks)
find_library (GLUT_LIBRARY GLUT)
find_library (OpenGL_LIBRARY OpenGL)
mark_as_advanced (GLUT_LIBRARY
OpenGL_LIBRARY)
set (EXTRA_LIBS ${GLUT_LIBRARY} ${OpenGL_LIBRARY})
ENDIF (APPLE)
target_link_libraries(helloworld ${EXTRA_LIBS})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment