Skip to content

Instantly share code, notes, and snippets.

@nebgnahz
Created July 26, 2016 22:40
Show Gist options
  • Save nebgnahz/b10dc964b7541f125696a2ea79350333 to your computer and use it in GitHub Desktop.
Save nebgnahz/b10dc964b7541f125696a2ea79350333 to your computer and use it in GitHub Desktop.
Simple CMakeLists of using IMGUI on Mac OS (with GLFW)
cmake_minimum_required(VERSION 3.0.0)
set(PROJECT project-name)
project(${PROJECT})
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_demo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_draw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/imgui_impl_glfw.cpp
)
if(APPLE)
find_library(COCOA_LIBRARY Cocoa)
find_library(OPENGL_LIBRARY OpenGL)
find_library(IOKIT_LIBRARY IOKit)
find_library(COREVIDEO_LIBRARY CoreVideo)
set(EXTRA_LIBS
${COCOA_LIBRARY}
${OPENGL_LIBRARY}
${IOKIT_LIBRARY}
${COREVIDEO_LIBRARY}
-lglfw3
gif
)
endif(APPLE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(${PROJECT} ${SOURCES})
target_link_libraries(${PROJECT} ${EXTRA_LIBS})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment