Skip to content

Commit

Permalink
Added imgui example to CMakeLists.txt [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Apr 22, 2017
1 parent 7f1849f commit dba54b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include_directories(external)
include_directories(external/glm)
include_directories(external/gli)
include_directories(external/assimp)
include_directories(external/imgui)
include_directories(base)

OPTION(USE_D2D_WSI "Build the project using Direct to Display swapchain" OFF)
Expand Down Expand Up @@ -80,11 +81,20 @@ file(GLOB SOURCE *.cpp base/*.cpp)
# Function for building single example
function(buildExample EXAMPLE_NAME)
file(GLOB SOURCE *.cpp base/*.cpp ${EXAMPLE_NAME}/*.cpp)
if(WIN32)
add_executable(${EXAMPLE_NAME} WIN32 ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE})
SET(MAIN_CPP ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE_NAME}/main.cpp)
SET(MAIN_CPP ${EXAMPLE_NAME}/main.cpp)
ENDIF()
# imgui example requires additional source files
IF(${EXAMPLE_NAME} STREQUAL "imgui")
file(GLOB ADD_SOURCE external/imgui/*.cpp)
SET(SOURCE ${SOURCE} ${ADD_SOURCE})
ENDIF()
if(WIN32)
add_executable(${EXAMPLE_NAME} WIN32 ${MAIN_CPP} ${SOURCE})
target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WINLIBS})
else(WIN32)
add_executable(${EXAMPLE_NAME} ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE})
add_executable(${EXAMPLE_NAME} ${MAIN_CPP} ${SOURCE})
target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif(WIN32)
endfunction(buildExample)
Expand Down Expand Up @@ -125,6 +135,7 @@ set(EXAMPLES
gears
geometryshader
hdr
imgui
indirectdraw
instancing
mesh
Expand Down
2 changes: 1 addition & 1 deletion imgui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct UISettings {
bool displayBackground = true;
bool animateLight = false;
float lightSpeed = 0.25f;
std::array<float, 50> frameTimes = { 0 };
std::array<float, 50> frameTimes{};
float frameTimeMin = 9999.0f, frameTimeMax = 0.0f;
float lightTimer = 0.0f;
} uiSettings;
Expand Down

0 comments on commit dba54b0

Please sign in to comment.