Skip to content

Commit

Permalink
cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
yekm committed Jan 12, 2023
1 parent 30163ba commit cecf9f5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})

0 comments on commit cecf9f5

Please sign in to comment.