Update README instructions
+ Fix incorrect library name for `algorithms/trees/BST` example + Update root CMakeLists.txt for major directories to set binary path + Add instructions to install CMake LTS with pip
This commit is contained in:
@@ -17,5 +17,7 @@ project(
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
add_subdirectory(opengl-cmake)
|
||||
add_subdirectory(sdl-cmake)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Graphics
|
||||
|
||||
Example graphics programming projects written in C++
|
||||
Example graphics programming projects written in C++.
|
||||
For a more complete example of a graphics application, see [shaunrd0/qtk](https://gitlab.com/shaunrd0/qtk)
|
||||
|
||||
```
|
||||
klips/cpp/graphics
|
||||
@@ -10,3 +11,21 @@ klips/cpp/graphics
|
||||
├── sdl-cmake # Barebones sdl application written in C++ built with cmake
|
||||
└── sdl # Barebones sdl application written in C++ built with gcc
|
||||
```
|
||||
|
||||
Install dependencies for these examples with the following command
|
||||
|
||||
```bash
|
||||
sudo apt install libsdl2-dev freeglut3-dev
|
||||
```
|
||||
|
||||
Then we can build the examples that have `CMakeLists.txt` configured.
|
||||
If the example does not use CMake, the commands to build and run are found within the header comments of the main source file.
|
||||
|
||||
```bash
|
||||
cd /path/to/klips/cpp/graphics/
|
||||
mkdir build && cd build
|
||||
cmake .. && cmake --build .
|
||||
ls bin/
|
||||
|
||||
opengl-test sdl-test
|
||||
```
|
||||
|
||||
@@ -24,7 +24,6 @@ if (OPENGL_FOUND)
|
||||
# Link opengl-test executable to OpenGL
|
||||
target_include_directories(lib-opengl-test PUBLIC ${OPENGL_INCLUDE_DIR})
|
||||
target_link_libraries(lib-opengl-test PUBLIC ${OPENGL_LIBRARIES})
|
||||
|
||||
else()
|
||||
message(
|
||||
"Error: CMake was unable to find the OpenGL package\n"
|
||||
@@ -38,7 +37,6 @@ if (GLUT_FOUND)
|
||||
# Link lib-opengl-test executable to GLUT
|
||||
target_include_directories(lib-opengl-test PUBLIC ${GLUT_INCLUDE_DIR})
|
||||
target_link_libraries(lib-opengl-test PUBLIC ${GLUT_LIBRARIES})
|
||||
|
||||
else()
|
||||
message(
|
||||
"Error: CMake was unable to find the GLUT package\n"
|
||||
|
||||
Reference in New Issue
Block a user