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
Weird issue with CPM_SOURCE_CACHE and FetchContent #281
Comments
My current guess is that there is no call to |
Hey, thanks for the issue! I agree that the problem seems to be caused by I think it might make sense for CPM.cmake to add another parameter that still allows caching while using |
For now I indeed disabled CPM caching, but I think this should be considered a bug (the behavior for cache vs no cache should be the same I think). Would it be possible to always use |
I agree that it would be nice to have However, I haven't yet checked if we are able to use |
…ge (#288) Add fetchcontent_dependency unit test: * This test should highlight the fact that cpm_add_subdirectory is always called, even when cpm_fetch_package isn't populating the dependency * NO_CACHE YES highlight a bug introduced in 32b063e where cpm_fetch_package was checking undefined ${lower_case_name}_POPULATED variable #287
It seems this bug gets to many people and probably should be considered as critical. I am one of them - just found the CPM (I think it's a brilliant idea) and tried to use it in my projects and my first probes gets me to this. I guess I may be one of many. Disabling the cache is not a good workaround as it removes 90% of this module benefits. |
@jm4R is still present in the current Version? |
@DNKpp yes, but I am not sure if it is exact the same use case. I will describe you mine:
Where After fixing that one by overriding binary directory of direct dependency, another issue appeared:
This time there is a conflict between My guess to fix this would be to override this defaults by some CPM-defaults:
For example by replacing |
I have the same problem as jm4r mentioned. |
* Override FetchContent paramers, fixes #281 * add check to verify that dependency is cached * update test comment * rename test file and class * update test indentation
FYI: CPM should now be able to override FetchContent calls since v0.35.1! Please me know if you encounter further issues with this. |
@DNKpp @TheLartians Just revisited this issue: Problem easily reproduced with 0.38.1 :( Workaround is wrapping a
And call it:
BTW: is there a way to revert to the behavior that cached dependencies are copied to |
In the top-level project there is https://github.com/vtil-project/VTIL-Utils/blob/master/cmake/VTIL-Core.cmake:
CPMAddPackage( NAME VTIL-Core GIT_REPOSITORY https://github.com/mrexodia/VTIL-Core GIT_TAG e6debb384cb218caff8cb94f50f00076b994a762 )
And after that it includes https://github.com/vtil-project/VTIL-Utils/blob/master/cmake/VTIL-NativeLifters.cmake:
CPMAddPackage( NAME VTIL-NativeLifters GIT_REPOSITORY https://github.com/vtil-project/VTIL-NativeLifters GIT_TAG f8837ef4d2412a5a1c25f725f25685a23e1cf1a1 )
Inside the
VTIL-NativeLifters
repo there is aFetchContent
call with the nameVTIL-Core
, The idea here is that you can pin a different version ofVTIL-Core
in your project that will then be used to compile theVTIL-NativeLifters
library.https://github.com/vtil-project/VTIL-NativeLifters/blob/master/Dependencies/CMakeLists.txt#L4:
When using
CPM_SOURCE_CACHE
CMake errors out:Without
CPM_SOURCE_CACHE
everything works as intended:This is cmake 3.20.5 btw
The text was updated successfully, but these errors were encountered: