diff --git a/CMakeLists.txt b/CMakeLists.txt index 6faec16..a8f8c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,15 +5,13 @@ project(OpengGL_Example) set(CMAKE_CXX_STANDARD 17) set(CMAKE_VERBOSE_MAKEFILE ON) -add_executable(opengl_example main.cpp) +set( NAME_SRC + main.cpp +) + +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +add_executable( opengl_example ${NAME_SRC} ${NAME_HEADERS} ) # Set executable dependency libraries # Equivalent to pass flags -lGL, -lGLU and -lglut -target_link_libraries(opengl_example GL GLU glut) - -# Add target to run executable -add_custom_target(run-ex1 - COMMAND opengl_example - DEPENDS opengl_example - WORKING_DIRECTORY ${CMAKE_PROJECT_DIR} -) \ No newline at end of file +target_link_libraries(opengl_example GL GLU glut) \ No newline at end of file diff --git a/README.md b/README.md index f5fee56..33e1da4 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,5 @@ bash compile.sh Run the binary. ```bash -./build/opengl_example +./build/bin/opengl_example ```