akwk/zadanie-2_new/CMakeLists.txt
2024-06-14 01:00:37 +02:00

39 lines
1.1 KiB
CMake

cmake_minimum_required(VERSION 3.26)
project(zadanie-2)
set(CMAKE_CXX_STANDARD 11)
# Find necessary packages
find_package(OpenGL REQUIRED)
find_package(glfw3 REQUIRED)
find_package(glm REQUIRED)
# Include directories for the found packages
include_directories(${OPENGL_INCLUDE_DIRS} ${GLM_INCLUDE_DIRS} /usr/local/Cellar/glew/2.2.0_1/include)
# Ścieżka do katalogu z biblioteką imgui
set(IMGUI_DIR ${CMAKE_SOURCE_DIR}/libraries/imgui)
# Dodaj pliki źródłowe imgui do kompilacji
set(IMGUI_SOURCES
${IMGUI_DIR}/imgui.cpp
${IMGUI_DIR}/imgui_draw.cpp
${IMGUI_DIR}/imgui_widgets.cpp
${IMGUI_DIR}/imgui_tables.cpp
${IMGUI_DIR}/imgui_demo.cpp
${IMGUI_DIR}/imgui_impl_glfw.cpp
${IMGUI_DIR}/imgui_impl_opengl3.cpp
)
# Include directories for imgui
include_directories(${IMGUI_DIR})
# Add executable and link libraries
add_executable(zadanie-2 main.cpp shader.h shader.cpp ${IMGUI_SOURCES})
# Link libraries
target_link_libraries(zadanie-2 OpenGL::GL glfw glm::glm)
# Link GLEW library directly
target_link_libraries(zadanie-2 /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.dylib)