Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.15)
project(Atoms VERSION 1.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# required packages
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_executable(atom_2d src/wave_atom_2d.cpp)
target_link_libraries(atom_2d
OpenGL::GL
GLEW::GLEW
glfw
glm::glm
)

add_executable(atom_realtime src/atom_realtime.cpp)
target_link_libraries(atom_realtime
OpenGL::GL
GLEW::GLEW
glfw
glm::glm
)

add_executable(atom_raytracer src/atom_raytracer.cpp)
target_link_libraries(atom_raytracer
OpenGL::GL
GLEW::GLEW
glfw
glm::glm
)

add_executable(atom src/atom.cpp)
target_link_libraries(atom
OpenGL::GL
GLEW::GLEW
glfw
glm::glm
)

message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Output directory: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,24 @@ What the model does:

### Alternative: Debian/Ubuntu apt workaround

If you don't want to use vcpkg, or you just need a quick way to install the native development packages on Debian/Ubuntu, install these packages and then run the normal CMake steps above:
If you don't want to use vcpkg, or you just need a quick way to install the native development packages on Debian/Ubuntu, install these packages and build:

```bash
sudo apt update
sudo apt install build-essential cmake \
libglew-dev libglfw3-dev libglm-dev libgl1-mesa-dev
```
This provides the GLEW, GLFW, GLM and OpenGL libraries so `find_package(...)` calls in `CMakeLists.txt` can locate the libraries without vcpkg.

Then run:
```
cmake -B build -S .
cmake --build build

# run executables (located in build/bin/) e.g.:
./build/bin/atom_realtime
```

This provides the GLEW, GLFW, GLM and OpenGL development files so `find_package(...)` calls in `CMakeLists.txt` can locate the libraries. After installing, run the `cmake -B build -S .` and `cmake --build build` commands as shown in the Build Instructions.

## **How the code works:**
the 2D bohr model works is in atom.cpp, the raytracer and realtime models are right beside
Expand Down