Skip to content

fix(cmake): cvcConfig must find_dependency(assimp) when assimp is linked - #168

Merged
transfix merged 1 commit into
masterfrom
fix/cvcconfig-find-assimp
Aug 4, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/cvcconfig-find-assimp

Conversation

@transfix

@transfix transfix commented Aug 4, 2026

Copy link
Copy Markdown
Owner

When CVC_ENABLE_ASSIMP is on, cvcTargets.cmake puts assimp::assimp into cvc::cvc's INTERFACE_LINK_LIBRARIES — but cvcConfig.cmake never told consumers to resolve it. The first downstream find_package(cvc) then dies:

CMake Error at .../cvcTargets.cmake:61 (set_target_properties):
  The link interface of target "cvc::cvc" contains:
    assimp::assimp
  but the target was not found.

How it surfaced

The release/ubuntu-22.04 leg of publish-cvcpkg (dry run). libcvc itself configured, built and packed fine — the failures were the family steps:

 7 Build & install:                    success
 8 Pack archive:                       success
11 Build, pack & publish cvcgl:        failure
12 Build, pack & publish pycvc:        failure
13 Build, pack & publish pycvc-gl:     failure

Each of those is a separate CMake project doing find_package(cvc) against the staged install, so each hit the unresolvable imported target.

Fix

cvcConfig.cmake.in already uses exactly this guarded-find_dependency pattern for OPENMP, IMAGEMAGICK, FFTW and CUDA. assimp was simply missed when the model loader landed (#158).

Scope is correct (worth stating, since option() creates a cache variable that a later set() only shadows in directory scope): the template is configured from src/cvc/CMakeLists.txt:996 — the same directory that does set(CVC_ENABLE_ASSIMP OFF) at line 682 when assimp is absent. So @CVC_ENABLE_ASSIMP@ expands to the value actually used for the build, not the cached option default. Both branches behave:

assimp @CVC_ENABLE_ASSIMP@ result
found ON find_dependency(assimp) emitted — target resolves
missing OFF (line 682) omitted — matches a link interface with no assimp::assimp

Deliberately not QUIET/optional: if assimp is in the link interface, a consumer that cannot find it cannot link. Failing here names the actually-missing package instead of surfacing as a confusing missing-target error two levels down in generated code.

Note on the 22.04 pin

This leg passed on ubuntu-latest (24.04) on 2026-07-27 and fails on ubuntu-22.04 now, so #164's pin is what exposed it. I could not establish why 24.04 masked it — assimp 6.0.5+cvc.2 was published 21h before that run, so availability is not the difference — and I would rather say so than invent a reason. The omission is real and verifiable in the source either way, and this fix is correct independent of the mechanism.

This blocks the real publish: the release leg is what produces the replacement pycvc-gl bundle needed to retire the glibc-2.38 one, so I did not run a live publish.

When CVC_ENABLE_ASSIMP is on, cvcTargets.cmake puts assimp::assimp into
cvc::cvc's INTERFACE_LINK_LIBRARIES, but cvcConfig.cmake never told
consumers to resolve it. The first downstream find_package(cvc) then dies:

    CMake Error at .../cvcTargets.cmake:61 (set_target_properties):
      The link interface of target "cvc::cvc" contains:
        assimp::assimp
      but the target was not found.

which is what broke the cvcgl / pycvc / pycvc-gl steps of the release
publish leg while libcvc itself configured, built and packed fine.

cvcConfig.cmake.in already has exactly this guarded-find_dependency pattern
for OPENMP, IMAGEMAGICK, FFTW and CUDA; assimp was simply missed when the
loader landed (#158).

Scope is correct: the template is configured from src/cvc/CMakeLists.txt:996,
the same directory that does `set(CVC_ENABLE_ASSIMP OFF)` at line 682 when
assimp is absent, so @CVC_ENABLE_ASSIMP@ expands to the value actually used
for the build rather than the cached option default. Both branches behave:
assimp found -> find_dependency emitted; assimp missing -> omitted, matching
a link interface that has no assimp::assimp in it.

Not QUIET/optional on purpose. If assimp is in the link interface then a
consumer that cannot find it cannot link, so failing here names the actually
missing package instead of surfacing as a confusing missing-target error two
levels down in generated code.
@transfix
transfix force-pushed the fix/cvcconfig-find-assimp branch from 9f4108b to e95ebf9 Compare August 4, 2026 09:03
@transfix
transfix merged commit 4ae5395 into master Aug 4, 2026
6 of 7 checks passed
@transfix
transfix deleted the fix/cvcconfig-find-assimp branch August 4, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant