From cecf9f5efdf0d4935a99ad12634b7d98fb27760a Mon Sep 17 00:00:00 2001 From: Pavel V Date: Thu, 12 Jan 2023 12:08:54 +0300 Subject: [PATCH] cmake --- CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ec62402 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.16.3) + +project(imgui-cmake LANGUAGES C CXX) + + +# https://github.com/Pesc0/imgui-cmake +######### IMGUI ####################### + + +set(IMGUI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/imgui) +add_library(IMGUI STATIC) + +target_sources( IMGUI + PRIVATE + ${IMGUI_DIR}/imgui_demo.cpp + ${IMGUI_DIR}/imgui_draw.cpp + ${IMGUI_DIR}/imgui_tables.cpp + ${IMGUI_DIR}/imgui_widgets.cpp + ${IMGUI_DIR}/imgui.cpp + + PRIVATE + ${IMGUI_DIR}/backends/imgui_impl_opengl3.cpp + ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp +# ${IMGUI_DIR}/backends/imgui_impl_sdl.cpp + ) + +target_include_directories( IMGUI + PUBLIC ${IMGUI_DIR} + PUBLIC ${IMGUI_DIR}/backends + ) + +target_link_libraries(IMGUI PUBLIC ${CMAKE_DL_LIBS}) + + +####################################################### + +find_package(glfw3) + +add_executable(cloudlife) +target_sources(cloudlife PUBLIC main.cpp imgui_elements.cpp) +target_link_libraries(cloudlife IMGUI glfw GL) +set_target_properties(cloudlife PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})