-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
vcpkg integration induces Infinite CMake recursion when compiling #16454
Comments
I comment out Please make sure your vcpkg is latest. |
With version 18 of cmake there is no error in the cmake. I have built the binaries in windows and Linux successfully several times. Sadly It builds without vcpckg integration disabled and loops with it.
Terry
On 1 Mar 2021, at 06:52, Jack·Boos·Yu <[email protected]> wrote:
1> CMake Error at extern/CMakeLists.txt:16 (FetchContent_MakeAvailable):
1> Unknown CMake command "FetchContent_MakeAvailable".
I comment out add_subdirectory(extern) and re-configured, no error occurred.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#16454 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABQWN6ZGNIT5JN53VHV5OBLTBM2QRANCNFSM4YKOFO6A>.
|
Confirmed with Visual Studio 2019. |
This seems to be related to this message on the CMake mailing list. I was able to make the wrapping of if(NOT ${Z_VCPKG_ADD_EXECUTABLE_WRAPPED_ONCE})
function(add_executable)
...
endfunction()
set_property(GLOBAL PROPERTY Z_VCPKG_ADD_EXECUTABLE_WRAPPED_ONCE ON)
endif()
if(NOT ${Z_VCPKG_ADD_LIBRARY_WRAPPED_ONCE})
function(add_library)
...
endfunction()
set_property(GLOBAL PROPERTY Z_VCPKG_ADD_LIBRARY_WRAPPED_ONCE ON)
endif() I'm still pretty green with CMake, but that worked for me. EDIT: include_guard(GLOBAL) |
The example uses a subproject. Basically this is valid CMake. Normal variables set in the subdir/subproject won't be visible to the parent scope. What is unusual in the example project is that Taking this together, order matters: In the example, many variables aren't yet initialized when hitting So first I would advice to avoid Second, vcpkg needs to generally guard against redefining
|
Is there a possibility to add a |
I have a very simple cross-platform cmake C++ project and I am editing it in visual studio 2019. Creating the CMake cache works perfectly if I remove the vcpkg integration; but fails with a loop of 1000 times if I include the vcpkg integration. I downloaded the current version of vcpkg from GitHub to check that the issue had not been fixed.
I include zipped up the CMake code tree and the very simple code.
There is one CMake included external package simdjson which builds successfully.
quicktrack_tree.zip
googling vcpkg Infinite CMake recursion when compiling yields many other cases of this problem
with vcpkg integrate remove:
with vcpkg integrate install:
The text was updated successfully, but these errors were encountered: