-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (54 loc) · 1.55 KB
/
CMakeLists.txt
File metadata and controls
62 lines (54 loc) · 1.55 KB
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
60
61
62
cmake_minimum_required(VERSION 3.20)
project(BlackHoleSimulator VERSION 1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Find packages
find_package(OpenGL REQUIRED)
# Include directories
include_directories(${CMAKE_SOURCE_DIR}/include)
# Source files
set(SOURCES
src/main.cpp
src/RayTracer.cpp
src/Renderer.cpp
src/Physics.cpp
src/PhysicsFactory.cpp
src/KerrPhysics.cpp
src/Shader.cpp
src/LightSystem.cpp
src/RelativisticJets.cpp
src/BlackHoleSonification.cpp
src/MelodiousCalculator.cpp
src/PerformanceLogger.cpp
)
# Create executable
add_executable(${PROJECT_NAME} ${SOURCES})
# Link libraries - macOS specific
if(APPLE)
target_link_libraries(${PROJECT_NAME}
OpenGL::GL
"-framework Cocoa"
"-framework IOKit"
"-framework CoreVideo"
"-framework CoreAudio"
"-framework AudioUnit"
)
target_compile_definitions(${PROJECT_NAME} PRIVATE GL_SILENCE_DEPRECATION)
# Download and build GLFW from source for M4 Max compatibility
include(FetchContent)
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.3.8
)
FetchContent_MakeAvailable(glfw)
target_link_libraries(${PROJECT_NAME} glfw)
else()
# Linux/Windows
find_package(glfw3 REQUIRED)
target_link_libraries(${PROJECT_NAME} OpenGL::GL glfw)
endif()
# Compiler flags for optimization
if(CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${PROJECT_NAME} PRIVATE -O3 -march=native -ffast-math)
endif()