Including DownloadProject.cmake from another project results into: Failed to clone
Closed this issue · 2 comments
I have a project with the following structure:
/path/to/my/proj
├── cmake
│....
│ ├── external
│ │ └── Gtest.cmake
│ ├── modules
│ │ ├── DownloadProject.cmake
│ │ └── DownloadProject.CMakeLists.cmake.in
in the main cmakeLists.txt file, I call:
include(cmake/external/Gtest.cmake)
which hold the following code:
include(cmake/modules/DownloadProject.cmake)
download_project(
PROJ googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.7.0
UPDATE DISCONNECTED 1
)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
However when I run the cmake file, this gives me:
-- Had to git clone more than once:
3 times.
CMake Error at googletest-download/googletest-download-prefix/tmp/googletest-download-gitclone.cmake:40 (message):
Failed to clone repository: 'https://github.com/google/googletest.git'
make[2]: *** [googletest-download-prefix/src/googletest-download-stamp/googletest-download-download] Error 1
make[1]: *** [CMakeFiles/googletest-download.dir/all] Error 2
make: *** [all] Error 2
CMakeFiles/googletest-download.dir/build.make:84: recipe for target 'googletest-download-prefix/src/googletest-download-stamp/googletest-download-download
Running the example project however works fine.
I tried changing the DL_ARGS_PREFIX variable but that did not change anything. What could be causing this?
It looks like you're missing an underscore?
UPDATE DISCONNECTED 1
should be
UPDATE_DISCONNECTED 1
ha it worked.