akwk/zadanie-2_new/CMakeLists.txt

39 lines
1.1 KiB
CMake
Raw Normal View History

2024-06-06 23:28:15 +02:00
cmake_minimum_required(VERSION 3.26)
2024-06-14 01:00:37 +02:00
project(zadanie-2)
2024-06-06 23:28:15 +02:00
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
2024-06-14 01:00:37 +02:00
add_executable(zadanie-2 main.cpp shader.h shader.cpp ${IMGUI_SOURCES})
2024-06-06 23:28:15 +02:00
# Link libraries
2024-06-14 01:00:37 +02:00
target_link_libraries(zadanie-2 OpenGL::GL glfw glm::glm)
2024-06-06 23:28:15 +02:00
# Link GLEW library directly
2024-06-14 01:00:37 +02:00
target_link_libraries(zadanie-2 /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.dylib)