Skip to content

Commit

Permalink
Fix CMake for ImGui misc cpp sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Aug 4, 2021
1 parent 20a7acd commit bd4ad9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions NoiseTool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ CPMAddPackage(
GITHUB_REPOSITORY ocornut/imgui
GIT_TAG 7bfc379a23e97b6777eb80aafb50a8e6248904cd
)
# Set dir for find_package(ImGui)
set(IMGUI_DIR ${imgui_SOURCE_DIR})

CPMAddPackage(
NAME magnum-integration
Expand All @@ -54,7 +56,6 @@ CPMAddPackage(
OPTIONS
"BUILD_STATIC ON"
"WITH_IMGUI ON"
"IMGUI_DIR ${imgui_SOURCE_DIR}"
)

CPMAddPackage(
Expand All @@ -68,6 +69,7 @@ set(CMAKE_MODULE_PATH "${magnum-integration_SOURCE_DIR}/modules" ${CMAKE_MODULE_

find_package(Magnum REQUIRED GL GlfwApplication)
find_package(MagnumIntegration REQUIRED ImGui)
find_package(ImGui REQUIRED SourcesMiscCpp)

# Bundle a better font
# Configure resource file for imgui source dir variable
Expand All @@ -80,7 +82,6 @@ add_executable(NoiseTool
"MeshNoisePreview.cpp"
"NoiseTexture.cpp"
"${imnodes_SOURCE_DIR}/imnodes.cpp"
"${imgui_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp"
${NoiseTool_RESOURCES}
)

Expand All @@ -93,6 +94,7 @@ target_link_libraries(NoiseTool PRIVATE
Magnum::Shaders
Magnum::SceneGraph
MagnumIntegration::ImGui
ImGui::SourcesMiscCpp
)

# Windows HiDPI support
Expand Down

0 comments on commit bd4ad9a

Please sign in to comment.