opengl-tutorials/ogl

Using cmake within build directory doesn't work

cvlvxi opened this issue · 2 comments

I was following:

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/

Specifically the linux section and was unable to cmake & build the project:

$ mkdir build
$ cd build
$ cmake ..
CMake Error at CMakeLists.txt:9 (message):
  Please select another Build Directory ! (and give it a clever name, like
  bin_Visual2012_64bits/)
-- Configuring incomplete, errors occurred!
See also "/home/beb/VCGS/glfw/ogl/CMakeFiles/CMakeOutput.log".
See also "/home/beb/VCGS/glfw/ogl/CMakeFiles/CMakeError.log".

Not sure if I'm doing this incorrectly or if the tutorial is out of date?

Please advise.

hi, this is how I solved it.

add
"set(PROJECT_SOURCE_DIR ${CMAKE_BINARY_DIR}/build/)"
after
"find_package(OpenGL REQUIRED)"
in the CMakeLists.txt.

ta