Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] transitive dependencies missing in cmake_find_package_multi if direct dependency recipe based on conan v2 and no components #11789

Closed
SpaceIm opened this issue Aug 5, 2022 · 1 comment
Assignees
Milestone

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Aug 5, 2022

Environment Details (include every applicable attribute)

  • Operating System+version: macOS Montery
  • Compiler+version: AppleClang 13
  • Conan version: 1.51.0
  • Python version: 3.9.13

Steps to reproduce (Include if Applicable)

  • Create a conan v2 recipe foo with:
    • CMakeToolchain, CMakeDeps, cmake_layout
    • at least one dependency bar
    • No components in package_info() (just one lib basically), and no explicit self.cpp_info.requires
  • In this recipe, create a test_package based on cmake_find_package_multi
  • call conan create . foo/version

You should see that config file of foo lacks bar injection.
If you use CMakeDeps in test_package instead of cmake_find_package_multi, you can see bar in foo config file.
If self.cpp_info.requires in foo recipe is explicitly populated with bar::bar, then foo config file generated by cmake_find_package_multi is fine.

see conan-io/conan-center-index#12063 (comment) or conan-io/conan-center-index#12030 (comment)

Logs (Executed commands with output) (Include/Attach if Applicable)

@lasote lasote self-assigned this Aug 8, 2022
@lasote lasote assigned franramirez688 and unassigned lasote Aug 8, 2022
@franramirez688 franramirez688 added this to the 1.51.1 milestone Aug 8, 2022
@franramirez688
Copy link
Contributor

Hi @SpaceIm

Thanks for the issue! This one would be already solved by #11790.
Now, the bar dependency appears as expected:

# Library dependencies
include(CMakeFindDependencyMacro)

if(NOT bar_FOUND)
    if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
        find_package(bar REQUIRED NO_MODULE)
    else()
        find_dependency(bar REQUIRED NO_MODULE)
    endif()
else()
    message(STATUS "Dependency bar already found")
endif()

This fix will be soon in 1.51.1.

SpaceIm added a commit to SpaceIm/conan-center-index that referenced this issue Aug 13, 2022
SpaceIm added a commit to SpaceIm/conan-center-index that referenced this issue Aug 14, 2022
SpaceIm added a commit to SpaceIm/conan-center-index that referenced this issue Aug 14, 2022
SpaceIm added a commit to SpaceIm/conan-center-index that referenced this issue Aug 14, 2022
conan-center-bot pushed a commit to conan-io/conan-center-index that referenced this issue Aug 23, 2022
* add test_v1_package

* some improvements:

- conan >=1.46.0 is required
- use GNUInstallDirs in custom CMakeLists
- isolate source code under src folder
- move custom cmake files under cmake folder instead of src folder
- install imports directly under bin folder instead of moving it after installation
- add VirtualBuildEnv since there are tool_requires
- reorder methos by order of execution

* add shared & fPIC options

* no need for CMAKE_SOURCE_DIR

* explicit cpp_info.requires

due to conan-io/conan#11789
fixed by conan-io/conan#11790

* remove shared option

* winflexbison for msvc only

* check compiler from build profile
conan-center-bot pushed a commit to conan-io/conan-center-index that referenced this issue Aug 24, 2022
* conan v2 support

* explicit cpp_info.requires

due to conan-io/conan#11789
fixed by conan-io/conan#11790

* use self.info.clear() instead of self.info.header_only()
valgur pushed a commit to valgur/conan-center-index that referenced this issue Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants