From 8398c6ebb5ece55d1a84efd1c7d098ecaa2b23e0 Mon Sep 17 00:00:00 2001 From: Vectozavr <60608292+vectozavr@users.noreply.github.com> Date: Sat, 30 Oct 2021 19:23:47 +0700 Subject: [PATCH] Huge refactoring v3 --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6446980..54d783a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,8 +112,8 @@ endif() target_link_libraries(shooter sfml-audio sfml-network sfml-graphics sfml-window sfml-system) -# OpenGL part for MacOS -if (APPLE OR UNIX) +# OpenGL part +if (APPLE) set(GLEW_H /usr/local/Cellar/glew/2.1.0/include/GL) set(GLFW_H /usr/local/Cellar/glfw/3.2.1/include/GLFW) include_directories(${GLEW_H} ${GLFW_H}) @@ -124,4 +124,10 @@ if (APPLE OR UNIX) target_link_libraries(shooter "-framework OpenGL") target_link_libraries(shooter "-framework GLUT") +elseif(UNIX) + find_package(OpenGL REQUIRED) + find_package(GLUT REQUIRED) + + target_link_libraries(shooter ${OPENGL_LIBRARIES}) + target_link_libraries(shooter ${GLUT_LIBRARY}) endif()