diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index 1586c3c..65c665a 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -1,25 +1,28 @@ cmake_minimum_required (VERSION 3.8) +project("Computergraphik") + if (CMAKE_COMPILER_IS_GNU) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") endif() +set(OpenGL_GL_PREFERENCE "GLVND") + find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) +# Use legacy include_directories because we want to link this against each target. +include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}) + add_executable (hello_world helloWorld.c) -target_include_directories(hello_world PRIVATE ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}) target_link_libraries(hello_world ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) add_executable (culling template_culling.c) -target_include_directories(culling PRIVATE ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}) target_link_libraries(culling ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) add_executable (koordinatensystem template_koordinatensystemUndPunkte.c) -target_include_directories(koordinatensystem PRIVATE ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}) target_link_libraries(koordinatensystem ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) target_link_libraries(koordinatensystem m) # Math library add_executable (mesh template_meshVisualisierung.c) -target_include_directories(mesh PRIVATE ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}) target_link_libraries(mesh ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})