出于某种原因,CMake 会生成一个错误的 makefile:
make[2]: *** No rule to make target `CMakeFiles//Users/wen/projects/Space Cubes/src/Debug.cpp.dir/depend'. Stop.
make[1]: *** [CMakeFiles/Users/wen/projects/Space Cubes/src/Debug.cpp.dir/all] Error 2
这里发生了什么,为什么它不能工作?我已经尝试过清除缓存。
CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(spacecubes)
if (APPLE)
FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
FIND_LIBRARY(GLUT_LIBRARY GLUT)
SET(EXTRA_LIBS ${OPENGL_LIBRARY} ${GLUT_LIBRARY})
else (APPLE)
target_link_libraries(${PROJECT} gl glu glut)
endif(APPLE)
file(GLOB_RECURSE src "src/*.cpp")
add_executable(${PROJECT} ${src})