Freeglut-3.0.0 is build with cmake (MinGW makefiles) and mingw and then successfully installed with mingw32-make install
to C:/Program Files (x86)/freeglut
.
My CMakeLists.txt
is:
cmake_minimum_required(VERSION 3.7)
project(math_tests)
set(TESTS_SOURCES tests.cpp gl_core_3_3.c)
set(CMAKE_CXX_STANDARD 11)
# GLUT
find_package(GLUT REQUIRED)
include_directories(${GLUT_INCLUDE_DIR})
if(NOT GLUT_FOUND)
message(ERROR "GLUT not found!")
endif(NOT GLUT_FOUND)
# OpenGL
find_package(OpenGL REQUIRED)
include_directories(${OpenGL_INCLUDE_DIRS})
link_directories(${OpenGL_LIBRARY_DIRS})
add_definitions(${OpenGL_DEFINITIONS})
if(NOT OPENGL_FOUND)
message(ERROR "OPENGL not found!")
endif(NOT OPENGL_FOUND)
add_executable(tests ${TESTS_SOURCES})
target_link_libraries(tests math ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
Now CMake prints error: Could NOT find GLUT (missing: GLUT_glut_LIBRARY).
I can't figure out what I am doing wrong.
if (WIN32)
statement. – Achromatous