Cmake and GLEW library
I'm trying to compile a simple project on QT Creator. I decided to use
Cmake, so I have the following CMakeLists.txt
project(testopengl)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
#==========================================================
# FIND GLUT
#==========================================================
find_package(GLUT REQUIRED)
include_directories(${GLUT_INCLUDE_DIRS})
link_directories(${GLUT_LIBRARY_DIRS})
add_definitions(${GLUT_DEFINITIONS})
if(NOT GLUT_FOUND)
message(ERROR " GLUT not found!")
endif(NOT GLUT_FOUND)
#==========================================================
# FIND 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)
#==========================================================
#==========================================================
# FIND GLEW
#==========================================================
find_package(GlEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
add_definitions(${GLEW_DEFINITIONS})
if(NOT GLEW_FOUND)
message(ERROR " GLEW not found!")
endif(NOT GLEW_FOUND)
#==========================================================
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}
${GLEW_LIBRARY})
But I obtained this output:
Could not find a package configuration file provided by "GlEW" with any of
the following names:
GlEWConfig.cmake
glew-config.cmake
O I tried compiling a previuos "running" project without GLEW functions,
so I added them to the project, and also added the flag -lGLEW but it
could not compile
"cmd": [ "g++ \"$file\" -o \"$file_base_name\" -lGLU -lGL -lglut &&
./\"$file_base_name\""],
I was using the last one on "sublime", then I added GLEW
"cmd": [ "g++ \"$file\" -o \"$file_base_name\" -lGLU -lGL -lglut -lGLEW &&
./\"$file_base_name\""],
So I decided to install GLEW from the official page:
http://glew.sourceforge.net/
I did:
sudo make
sudo make install
I tried the last two "solutions" they still not working.
What can I do?
No comments:
Post a Comment