[Code] Update CMakeLists.txt

This commit is contained in:
Andre Meyering 2018-11-14 13:59:22 +01:00
parent 8d28fef13d
commit 21d5ac32b8

View file

@ -1,25 +1,28 @@
cmake_minimum_required (VERSION 3.8) cmake_minimum_required (VERSION 3.8)
project("Computergraphik")
if (CMAKE_COMPILER_IS_GNU) if (CMAKE_COMPILER_IS_GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
endif() endif()
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(GLUT 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) 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}) target_link_libraries(hello_world ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
add_executable (culling template_culling.c) 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}) target_link_libraries(culling ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
add_executable (koordinatensystem template_koordinatensystemUndPunkte.c) 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 ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
target_link_libraries(koordinatensystem m) # Math library target_link_libraries(koordinatensystem m) # Math library
add_executable (mesh template_meshVisualisierung.c) 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}) target_link_libraries(mesh ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})