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

Infinite recursion for VCPKG in nested pmm projects #58

Open
perara opened this issue May 10, 2022 · 1 comment
Open

Infinite recursion for VCPKG in nested pmm projects #58

perara opened this issue May 10, 2022 · 1 comment

Comments

@perara
Copy link

perara commented May 10, 2022

First of all, this is an excellent manager for easing up the setup time for new projects. Thanks a million!
As i've continued on using this, I've encounted a bug for when I have two dependencies that uses PMM.
The first library executes fine, while the second library gets the following error:

CMake Error at /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:722 (set):
  Maximum recursion depth of 1000 exceeded
Call Stack (most recent call first):
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)
  /home/per/.local/share/pmm/2.0.0/vcpkg-2022.03.10/scripts/buildsystems/vcpkg.cmake:800 (_find_package)

I've tracked this down to the following line: https://github.com/vector-of-bool/pmm/blob/develop/pmm/vcpkg.cmake#L265
I've tried to remove the line, which seemingly fixes it. And also, removed the PARENT_SCOPE flag works.
However, I have no idea on what this is actually doing, so I dont dare to propose this as an fix.

Is this possibly something you could provide a fix for?

Thanks!

@perara
Copy link
Author

perara commented May 10, 2022

macro(pmm)
    unset(_PMM_INCLUDE)
    _pmm_project_fn(${ARGV})
    foreach(inc IN LISTS _PMM_INCLUDE)
        if(NOT DEFINED VCPKG_INSTALLED_DIR)
            include(${inc})
        endif()


    endforeach()
endmacro()

Wrapped in a check if VCPKG was already defined before including the vcpkg.cmake. Probably shitty way of doing this, but it did work...

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

No branches or pull requests

1 participant