Giter VIP home page Giter VIP logo

downloadproject's People

Contributors

chrisstaite avatar craigscott-crascit avatar henryiii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

downloadproject's Issues

missing cmake module file: CMake-downloadInformation.cmake

I used to be able to get this working on Linux and Windows. Not sure about the cmake version numbers.

Now however, with Cmake 3.6.0-rc2 on Windows and with Cmake 3.5.1 on Ubuntu, I am getting:

CMake Error: Could not find cmake module file: CMake-downloadInformation.cmake

-- Configuring incomplete, errors occurred!

CMake Error at cmake/modules/DownloadProject.cmake:167 (message):
CMake step for googletest failed: 1
Call Stack (most recent call first):
cmake/modules/custom_DownloadProject.cmake:83 (download_project)
cmake/ExternalLists.cmake:5 (custom_AddDownloadProject)
CMakeLists.txt:20 (include)

Is this an official Cmake module that no longer exists?

Tensorflow Example

Hi,

Thanks for this nice helper for CMake.

I have a quick question as I wanted to add as a sub-project Tensorflow but the CMakeLists or Makefiles are not located in the root folder.

CMake:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/cmake

Makefiles:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile

I am interested by both approach as with Makefiles as you can cross-compile for iOS or Android, and CMake manage some dependencies options.

How could I fit both cases with your helpers without beging over complicated ? :-)

Thanks in advance.

Cheers,
Richard

Downloaded projects using ${CMAKE_SOURCE_DIRECTORY} break

Since projects are downloaded as source, when a project uses ${CMAKE_SOURCE_DIRECTORY} it uses the source directory of the highest level project and disrupts the resulting paths.

Is this a limitation of this approach, or can this be worked around?

Expanded info in the main file

I think it would be helpful to have the license and the URL to the GitHub repo in the file, so that it's easy to add the file(s) to a project's cmake folder.

Switching revisions redownloads full repository

We use this awesome script to download our 3rdparty repository containing several gigabytes of pre-buillt thirdparty libraries.

However, when we add a new prebuild there and consequently update the referenced version in our main repository's cmake, the whole repository is checked out again (Instead of just downloading the diff). This takes hours for our +20 GB repository, especially via VPN.

Is there a way to achieve just a git pull using DownloadProject or FetchContent?

Failed to clone repository

I am trying to use DownloadProject exactly as demonstrated (to download GTest), but I am getting:

[ 11%] Performing download step (git clone) for 'googletest-download'
-- 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'

I can clone the repository manually with no issues. Any thoughts?

Thanks,

David

Including DownloadProject.cmake from another project results into: Failed to clone

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?

When does git sync happen?

It is not clear to me when the sync will happen. Right now, if I change GIT_TAG, then I need to remove my build directory and run cmake again. What if the git repository is updated? Do I need to manually clean my build from time to time to be sure I am on the latest version?

NOTE: the example only works for the "master" branch of "google-test" (they apparently changed the structure a little bit).

Failed download steps don't fail the main CMake run

The result of the two execute_process() calls in DownloadProject.cmake are not being checked. This means that if either one fails, the main build still carries on as though they succeeded. In the best case, the build will still fail, but in the worse case it can result in old code being used when, for example, a developer updates the download_project() command to a new tag or repo and the update to that new tag/repo fails.

compile options and static import path

Hi, very interesting idea and I wanted to get your feedback on a couple ideas.

The first is an issue with an independent generate + build process. I am getting the following error:

gtest.lib(gtest-all.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in mytest.cpp.obj

My thoughts (not an expert in this area) are the separate execute_process is not pulling in my current CMake options, such as MSVC compile flags. Do you see a convenient way of forwarding these in the DownloadProject.cmake?

  1. I don't want these sources in the same folder as my tests. I've roughly injected a static path for this:
include(CMakeParseArguments)

set(DOWNLOAD_PROJECT_DIR ${CMAKE_CURRENT_LIST_DIR})

function(download_project)
...
    configure_file("${DOWNLOAD_PROJECT_DIR}/DownloadProject.CMakeLists.cmake.in" ${DL_ARGS_PROJ}-download/CMakeLists.txt)
...
endfunction()

Curious about your thoughts. Thanks!

Unexpected prefix behavior

I would like to have all the external projects under the same directory. A ThirdParty folder placed at the rood of cmake_binary_dir. When using ExternalProject_Add, this can be done locally to each project using [PREFIX dir] or globally as follows:

# Set default ExternalProject root directory
set_directory_properties(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/ThirdParty)

However when using DownloadProject, this EP_PREFIX has no effect even when forced like this:

download_project(PROJ                googletest
                 PREFIX "ThirdParty"
                 GIT_REPOSITORY      https://github.com/google/googletest.git
                 GIT_TAG             master
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)

The project is downloaded at ./ThirdParty/googletest-download indeed, but then CMake crushes since ./ThirdParty/googletest-src is not created.

-- Build files have been written to: /tmp/DownloadProject/build/ThirdParty/googletest-download
Scanning dependencies of target googletest-download
[ 11%] Creating directories for 'googletest-download'
[ 22%] Performing download step (git clone) for 'googletest-download'
Cloning into 'googletest-src'...
Already on 'master'
Your branch is up-to-date with 'origin/master'.
[ 33%] No patch step for 'googletest-download'
[ 44%] Skipping update step for 'googletest-download'
[ 55%] No configure step for 'googletest-download'
[ 66%] No build step for 'googletest-download'
[ 77%] No install step for 'googletest-download'
[ 88%] No test step for 'googletest-download'
[100%] Completed 'googletest-download'
[100%] Built target googletest-download
CMake Error at CMakeLists.txt:25 (add_subdirectory):
  add_subdirectory given source "ThirdParty/googletest-src" which is not an
  existing directory.

What am I missing?

not working in a nested project

@audiofanatic I've tried to use the download_project function in a child directory of a project and it doesn't download the external project.

Any tip or hint? thanks!

Add mention of CMake 3.11 FetchContent

A similar tool was just added to CMake 3.11: the FetchContent module, which downloads content at configure time. I would recommend adding a mention of this module to the README just in case a user is okay with requiring CMake 3.11+.

GTest example doesn't work with MSVC 11

The GTest example actually doesn't work with MSVC 11 (toolset v110) due to VC++ not supporting variadic templates.

The problem can be fixed by defining GTEST_HAS_TR1_TUPLE to 0 or _VARIADIC_MAX to 10, although the latter is more of a band aid than a solution.

This is just a heads up for anyone who might want to use this with an old version of MSVC

Discussion / Feature request: support for multi-config generators

Would it be possible to support multi-config generators if the downloaded project supports installing multiple configurations side-by-side from a single configuration? Currently downloaded projects build using the default configuration and if it's not link-compatible with other configurations, one is in trouble.

Strange output formatting with ccmake

When I configure in ccmake, some information about the DownloadProject is printed, but it oddly overlaps the normal ccmake menus:

ccmake

This goes away by using QUIET, but it seems like this isn't intended behavior without QUIET.

Can't build MariaDB C connector

I'm using this to build the C connector for MariaDB but the process never goes beyond the download stage.

I have this on my CMakeLists.txt:

download_project(PROJ               mariadb-connector-c
                 GIT_REPOSITORY     https://github.com/MariaDB/mariadb-connector-c
                 GIT_TAG            v_2.3.3
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)

and I can see that source files are downloaded correctly. It just doesn't build them and no errors are shown.

I use this with Catch, a header only library, without any problems:

download_project(PROJ               catch
                 GIT_REPOSITORY     https://github.com/philsquared/Catch
                 GIT_TAG            v1.9.4
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
include_directories(${catch_SOURCE_DIR}/single_include/)

Passing GIT_TAG to project doesn't seem to have the expected effect

I'm using DownloadProject to checkout a number of libraries I depend on, namely Asio. I've added what I think are the correct settings but when I run CMake it tells me it cannot checkout the branch:

include(DownloadProject.cmake)
download_project(PROJ               asio
                 GIT_REPOSITORY     https://github.com/fmtlib/fmt
                 GIT_TAG            asio-1-10-8  # asio-1-10-8
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)

and this raises the error:

$ cmake .
-- Downloading/updating asio
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruihpacheco/chi/databaseclient/cpp/build/asio-download
[ 11%] Performing download step (git clone) for 'asio-download'
Cloning into 'asio-src'...
error: pathspec 'asio-1-10-8' did not match any file(s) known to git.
CMake Error at asio-download/asio-download-prefix/tmp/asio-download-gitclone.cmake:65 (message):
  Failed to checkout tag: 'asio-1-10-8'


make[2]: *** [asio-download-prefix/src/asio-download-stamp/asio-download-download] Error 1
make[1]: *** [CMakeFiles/asio-download.dir/all] Error 2
make: *** [all] Error 2
-- Downloading/updating fmt
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruihpacheco/chi/databaseclient/cpp/build/fmt-download
[ 11%] Skipping update step for 'fmt-download'
[ 22%] No configure step for 'fmt-download'
[ 33%] No build step for 'fmt-download'
[ 44%] No install step for 'fmt-download'
[ 55%] No test step for 'fmt-download'
[ 66%] Completed 'fmt-download'
[100%] Built target fmt-download
-- Downloading/updating googletest
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruihpacheco/chi/databaseclient/cpp/build/googletest-download
[ 11%] Skipping update step for 'googletest-download'
[ 22%] No configure step for 'googletest-download'
[ 33%] No build step for 'googletest-download'
[ 44%] No install step for 'googletest-download'
[ 55%] No test step for 'googletest-download'
[ 66%] Completed 'googletest-download'
[100%] Built target googletest-download
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruihpacheco/chi/databaseclient/cpp/build

Asio seems to have that tag: https://github.com/chriskohlhoff/asio/releases/tag/asio-1-10-8

This forces me to always be on master which is obviously less than optimal.

How can we disable the install step?

When I used your extension as

include(DownloadProject)
download_project(PROJ                googletest
                 GIT_REPOSITORY      https://github.com/google/googletest.git
                 GIT_TAG             master
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})

I have the problem that the downloaded project gets installed as well when my project installs
can I somehow disable this?

This is not related to this library but maybe you can help :-)

Project not being built after download

I'm trying to automate the download and build of mariadb-connector-c and added this to he CMakeLists.txt where I define my tests (not the one at the root of my project):

download_project(PROJ               mariadb-connector-c
                 GIT_REPOSITORY     https://github.com/MariaDB/mariadb-connector-c
                 GIT_TAG            master
                 ${UPDATE_DISCONNECTED_IF_AVAILABLE}
)
add_subdirectory(${mariadb-connector-c_SOURCE_DIR} ${mariadb-connector-c_BINARY_DIR})

While the source code is downloaded, the result of running CMake on the connector is stored in the -download folder and the product is not built or configured, I need to run cmake manually again.

Is there a way to go around this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.