1
以下是我的cmake文件,其中出現「無法找到GLUT(丟失:GLUT_glut_LIBRARY)」錯誤。我想我的目標鏈接庫存在問題。我究竟做錯了什麼?CMake目標鏈接庫「無法找到GLUT(丟失:GLUT_glut_LIBRARY)」
cmake_minimum_required(VERSION 2.6)
SET(MY_PROJECT_NAME Test_1)
SET(MY_SOURCE_FILES Task_1.cpp)
SET(GLUT_INCLUDE_DIR C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\GL)
SET(GLUT_LIBRARY C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\glut32.lib)
project(${MY_PROJECT_NAME})
# required libraries
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
# include directories
include_directories(
${GLUT_LIB_DIR}
${OPENGL_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
)
# source code files (sources *and* headers)
add_executable(${MY_PROJECT_NAME}
${MY_SOURCE_FILES}
)
# link against these libraries
target_link_libraries(${MY_PROJECT_NAME}
${GLUT_LIBRARY}
${OPENGL_LIBRARY}
)