Skip to content

fix(SuperBuild): link nlohmann_json natvis file in the build tree - #1380

Merged
BenPinet merged 1 commit into
nextfrom
fix/natvis-build-tree
Oct 22, 2026
Merged

BenPinet merged 1 commit into
nextfrom
fix/natvis-build-tree

Conversation

@francoisbonneau

Copy link
Copy Markdown
Member

Problem

Since json became an OpenGeode third party (784a9f5), projects that use the OpenGeode superbuild tree (OpenGeode/build) as CMAKE_PREFIX_PATH fail to configure on Windows with MSVC:

CMake Error at .../OpenGeode/build/cmake/CppTargets.cmake:136 (target_link_libraries):
  Cannot find source file:
    .../OpenGeode/build/nlohmann_json.natvis

With MSVC, nlohmann_json installs nlohmann_json.natvis at the root of its install directory and its exported target references it ($<INSTALL_INTERFACE:nlohmann_json.natvis>); it has no option to disable this. OpenGeode installs the file in opengeode/install/, but the post_install target only links bin, lib, cmake, include and share into the build tree, so the file is missing there.

Fix

With MSVC, post_install also links nlohmann_json.natvis into the build tree. Nothing changes with other compilers. The condition is the compiler, not the generator: Visual Studio and Ninja generators are both affected.

Tests

  • Linux: superbuild configure unchanged.
  • Windows, MSVC 19.44 + Ninja: superbuild configure OK, the generated build.ninja contains the natvis link command.
  • Not yet run: a full Windows build of OpenGeode followed by OpenGeode-IO configured against OpenGeode/build.

🤖 Generated with Claude Code

With MSVC, nlohmann_json installs nlohmann_json.natvis at the root of its
install directory and its exported target references it. The superbuild only
links bin, lib, cmake, include and share into the build tree, so projects
using the build tree as CMAKE_PREFIX_PATH failed to configure on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cpp-Linter Report ✔️

No problems need attention.

Have any feedback or feature suggestions? Share it here.

@BenPinet
BenPinet merged commit dfe4f78 into next Oct 22, 2026
26 checks passed
@BenPinet
BenPinet deleted the fix/natvis-build-tree branch October 22, 2026 09:30
@geode-ci

geode-ci Bot commented Oct 22, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 19.1.1-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants