51 lines
1.5 KiB
CMake
51 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(observations-on-the-sublime-dynamics-of-eroding-matter)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Find SDL2
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
# GLM - direct path approach for macOS/Homebrew
|
|
set(GLM_INCLUDE_DIR "/opt/homebrew/include")
|
|
if(EXISTS "${GLM_INCLUDE_DIR}/glm/glm.hpp")
|
|
message(STATUS "Found GLM at: ${GLM_INCLUDE_DIR}")
|
|
else()
|
|
message(FATAL_ERROR "GLM not found at ${GLM_INCLUDE_DIR}/glm/glm.hpp")
|
|
endif()
|
|
|
|
# Collect all source files
|
|
set(SOURCES
|
|
src/main.cpp
|
|
src/core/Application.cpp
|
|
src/core/InputHandler.cpp
|
|
src/window/Window.cpp
|
|
src/renderer/Renderer.cpp
|
|
src/events/EventManager.cpp
|
|
src/particles/Particle.cpp
|
|
src/particles/ParticleManager.cpp
|
|
src/particles/ParticleSystem.cpp
|
|
src/particles/ParticleFactory.cpp
|
|
)
|
|
|
|
# Add executable
|
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
|
|
|
# Link SDL2
|
|
target_link_libraries(${PROJECT_NAME} SDL2::SDL2)
|
|
|
|
# GLM is header-only, no linking needed
|
|
# target_link_libraries(${PROJECT_NAME} ${GLM_LIBRARIES})
|
|
|
|
# Include directories for SDL2
|
|
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
|
|
|
|
# Include directories for GLM - set globally
|
|
include_directories(${GLM_INCLUDE_DIR})
|
|
|
|
# Alternative approach: also set via CMAKE_CXX_FLAGS as fallback
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${GLM_INCLUDE_DIR}")
|
|
|
|
# Set include directories for our source files
|
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|