conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.13k stars 968 forks source link

[bug] Potential bug in CMakeDeps #14978

Closed rconde01 closed 11 months ago

rconde01 commented 11 months ago

Environment details

Steps to reproduce

See https://github.com/conan-io/conan-center-index/issues/20553

I really don't know if this is a CMakeDeps bug, but I know conan bugs and recipe bugs are treated differently so I wanted to ensure it was examined with this lens. If it really is a recipe bug, then just close this.

Logs

No response

memsharded commented 11 months ago

Hi @rconde01

I have had a look. It seems a recipe issue. The assimp build CMakeLists.txt is quite complicated, and it sets set(ZLIB_FOUND TRUE) in a couple of places. This avoids the transitive find_dependency() to execute (the minizip find_package() do not run the dependency to find ZLIB), and things fail.

I am further investigating why assimp has the ZLIB_FOUND to True in that point, still not clear...

memsharded commented 11 months ago

Changing one option to:

assimp/*:with_assbin_exporter=True

The related code seems to be (in project CMakeLists.txt):

  IF ( NOT ASSIMP_BUILD_ZLIB )
    if(ASSIMP_BUILD_ASSBIN_IMPORTER OR ASSIMP_BUILD_ASSBIN_EXPORTER OR ASSIMP_BUILD_ASSXML_EXPORTER OR
       ASSIMP_BUILD_BLEND_IMPORTER OR ASSIMP_BUILD_FBX_IMPORTER OR ASSIMP_BUILD_Q3BSP_IMPORTER OR
       ASSIMP_BUILD_X_IMPORTER OR ASSIMP_BUILD_XGL_IMPORTER)
        find_package(ZLIB REQUIRED)
    endif()
    set(ZLIB_FOUND TRUE)
  ENDIF()

This avoids the find_package() but still sets ZLIB_FOUND. That sounds quite buggy in the build system CMakeLists.txtç, and should be fixed in the recipe. I am closing this in favor of https://github.com/conan-io/conan-center-index/issues/20553