-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (48 loc) · 1.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Minimum CMake version
cmake_minimum_required(VERSION 3.10)
# Project name and version
project(physics-sim VERSION 0.0)
# C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Create compile commands for clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Add external dependencies
find_package(glfw3 3.3 REQUIRED)
# Output directories for compiled binaries and libraries
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Configure shaders path
configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h @ONLY)
# Include directories
include_directories(include)
include_directories(${CMAKE_BINARY_DIR}) # Config for defines
# Graphics/Rendering Sources
file (GLOB_RECURSE GRAPHICS_SRC
src/graphics/*.cpp
src/external/glad.c
)
### Orbital Sim Build
# Get source files
file (GLOB ORBITAL_SRC
src/orbital-sim/*.cpp
)
# Add executable target
add_executable(orbital_simulator ${ORBITAL_SRC} ${GRAPHICS_SRC})
# Link libraries
target_link_libraries(orbital_simulator glfw)
# Set compile options
target_compile_options(orbital_simulator PRIVATE -Wall -Wextra)
###
### Collision Sim Build
# Get source files
file (GLOB COLLISION_SRC
src/collision-sim/*.cpp
)
# Add executable target
add_executable(collision_simulator ${COLLISION_SRC} ${GRAPHICS_SRC})
# Link libraries
target_link_libraries(collision_simulator glfw)
# Set compile options
target_compile_options(collision_simulator PRIVATE -Wall -Wextra)
###