From d8ac84382fa93dcb4b2742374bf4b686b3c507a1 Mon Sep 17 00:00:00 2001 From: henczati Date: Mon, 17 Dec 2018 23:16:01 +0100 Subject: [PATCH] Added find_package for OpenGL in CMake (#771) --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8e1b3ee..8d6ede91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -386,6 +386,8 @@ if (UNIX OR APPLE) # 3D if (WITH_3D_RENDERER) + # OpenGL + find_package(OpenGL REQUIRED) # GLUT find_package(GLUT REQUIRED) endif (WITH_3D_RENDERER) @@ -404,7 +406,7 @@ if (UNIX OR APPLE) if (WITH_3D_ADAM_MODEL) if (NOT WITH_3D_RENDERER) message(FATAL_ERROR "WITH_3D_RENDERER is required if WITH_3D_ADAM_MODEL is enabled.") - endif (WITH_3D_RENDERER) + endif (NOT WITH_3D_RENDERER) find_package(PkgConfig) pkg_check_modules(EIGEN3 REQUIRED eigen3) # Others: sudo apt-get install libglm-dev @@ -816,7 +818,7 @@ if (WITH_3D_ADAM_MODEL) include_directories(${EIGEN3_INCLUDE_DIRS}) include_directories(${IGL_INCLUDE_DIRS}) include_directories(${LIBIGL_INCLUDE_DIRS}) - include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}) + include_directories(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}) endif (WITH_3D_ADAM_MODEL) # Windows includes if (WIN32) @@ -861,7 +863,7 @@ if (WITH_3D_ADAM_MODEL) ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${GLEW_LIBRARY} ${FREE_IMAGE_LIBRARY}) endif (WITH_3D_ADAM_MODEL) if (WITH_3D_RENDERER) - set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GLUT_LIBRARY}) + set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) endif (WITH_3D_RENDERER) if (WITH_CERES) set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${CERES_LIBRARIES})