Created
February 9, 2019 22:11
-
-
Save candh/d2917113e1086b4f5a97cf99767d3480 to your computer and use it in GitHub Desktop.
CMakeList for OpenGL. Tested on macOS only. Seems Finicky
This file contains 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
cmake_minimum_required(VERSION 3.6) | |
project(Testing C) | |
find_package(OpenGL REQUIRED) | |
find_package(GLUT REQUIRED) | |
if (OPENGL_FOUND) | |
message("opengl found") | |
message("include dir: ${OPENGL_INCLUDE_DIR}") | |
message("link libraries: ${OPENGL_gl_LIBRARY}") | |
lse (OPENGL_FOUND) | |
message("opengl not found") | |
endif() | |
set(SOURCE_FILES main.c) | |
add_executable(test ${SOURCE_FILES}) | |
include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS}) | |
# target_link_libraries(test ${OPENGL_glu_LIBRARY}) | |
# target_link_libraries(test ${OPENGL_gl_LIBRARY}) | |
target_link_libraries(test ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment