Skip to content

Commit

Permalink
Use imnodes as a cmake sub project, remove hacky workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Apr 19, 2023
1 parent 25387c9 commit bec6a35
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions NoiseTool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,22 @@ CPMAddPackage(
"BUILD_STATIC ON"
"MAGNUM_WITH_IMGUI ON"
)

# Use modules from magnum-integration since it has everything we need
set(CMAKE_MODULE_PATH "${magnum-integration_SOURCE_DIR}/modules" ${CMAKE_MODULE_PATH})

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

CPMAddPackage(
NAME imnodes
GITHUB_REPOSITORY Auburn/imnodes
GIT_TAG 26cc4165e7a0aad94f9db693521164851316bd8e
GIT_TAG 1aa48f4af2a4f9f1b9a6ed53fe858ed76646b233
GIT_SUBMODULES ".github"
EXCLUDE_FROM_ALL YES
DOWNLOAD_ONLY YES
OPTIONS
"IMNODES_IMGUI_TARGET_NAME MagnumIntegration::ImGui"
)

CPMAddPackage(
Expand All @@ -78,13 +86,6 @@ CPMAddPackage(
EXCLUDE_FROM_ALL YES
)

# Use modules from magnum-integration since it has everything we need
set(CMAKE_MODULE_PATH "${magnum-integration_SOURCE_DIR}/modules" ${CMAKE_MODULE_PATH})

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

# Ensure FastNoise.dll is built into the same dir as NoiseTool.exe
set_target_properties(FastNoise
PROPERTIES
Expand All @@ -104,21 +105,17 @@ add_executable(NoiseTool
"FastNoiseNodeEditor.cpp"
"MeshNoisePreview.cpp"
"NoiseTexture.cpp"
"${imnodes_SOURCE_DIR}/imnodes.cpp"
${NoiseTool_RESOURCES}
)

# Include imnodes in NoiseTool project since setting up separate cmake library with imgui dependancy was causing issues
target_include_directories(NoiseTool PRIVATE
"${imnodes_SOURCE_DIR}")

target_link_libraries(NoiseTool PRIVATE
FastNoise
Magnum::Application
Magnum::Shaders
Magnum::SceneGraph
MagnumIntegration::ImGui
ImGui::SourcesMiscCpp
imnodes
robin_hood
)

Expand Down

0 comments on commit bec6a35

Please sign in to comment.