我正在尝试使用CMake编译我的openGL项目,但出现“无法为目标指定链接库...”错误。
到目前为止,这是我的CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.9)
project(colors)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories(include ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS})
file(GLOB SOURCES "src/*.cpp")
add_executable(colorExec ${SOURCES})
target_link_libraries(colors ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )