Comments (6)
This seems awesome. Should we do a separate repo in the cpp-pm org? Or add it to the gate repo?
from hunter.
Looking through the code, a few points to make:
- FetchContent is from cmake 11. We should add a line in the example to make it clear (cmake_minimum_required)
- The code parses the release notes from the GitHub API. It just means that we need to make sure we always keep the format of the release notes the same (capitals, etc), otherwise parsing fails and potentially everyone who uses this setup’s builds will start to fail as well. We’ve been meaning to add a bot to automatically release each commit with the appropriate message rather than doing everything manually - doing that would nicely complement this feature
- To avoid parsing the release notes, we could get the tar URL directly from the GitHub app response, but it doesn’t have the SHA. On a slightly unrelated note, how important do people really think the SHA is? How often do you download something in your scripts, and really worry about a corrupt download?
- This setup is meant to pull down latest hunter every time a build is run. This has a couple impacts, rather than locking a version of hunter.
- One is that the default version of packages often changes between releases, so unless you are locking the version of every package you use, builds may pull in new versions of your package and if that new version is API-incompatible your builds can stop working.
- Another impact is that we (CC: @rbsheth) are pretty sure that the hunter version factors into the cache key for package builds, so if you are using local/remote caching in your builds rather than building all dependencies from source each time, using the latest version of hunter each time will effectively make your caches useless without a more sophisticated setup
- I noticed you allow people to lock both package and hunter versions, I’m just mentioning the consequences if someone doesn’t
- Once we have a consensus on what repo to use, I’ll make it. My only lean towards using gate is that our mantra of telling everyone to copy and paste gate into their repo to use hunter feels a bit dirty - it’s not really clear where the code comes from, what version it’s at or how to update it. If we put it in gate we can update the docs to encourage everyone to use FetchContent to bring in gate, and then optionally use this simplified setup above. Eventually maybe we just roll HunterGate and SetupHunter into one
from hunter.
I think:
set(HUNTER_PACKAGES package1 package2)
include(FetchContent)
FetchContent_Declare(SetupHunter GIT_REPOSITORY https://github.com/cpp-pm/setup.git)
FetchContent_MakeAvailable(SetupHunter)
would be easy to remember 😄
Edit: I think the gate repo should also be OK. A character less to type.
from hunter.
I'm slightly in favor of setup
or init
. BTW, you can omit .git
suffix in the URL.
from hunter.
I'm slightly in favor of
setup
orinit
. BTW, you can omit.git
suffix in the URL.
I didn't know about the .git
suffix omission. Thanks. I've updated the SetupHunter
documentation.
I also prefer setup
or init
, but if the code goes into gate
in the CMakeLists.txt
instead of doing:
file(
DOWNLOAD https://raw.githubusercontent.com/cpp-pm/gate/master/cmake/HunterGate.cmake
${CMAKE_BINARY_DIR}/HunterGate.cmake)
it could just be:
include(cmake/HunterGate.cmake)
Which should save some KiB from being transferred every time the user runs CMake on the project.
from hunter.
I pushed a MR to the gate project cpp-pm/gate#2
I've used the tagged version to download the tar.gz file, and used the downloaded tar.gz file to compute a SHA1 value and feed the file as file:// URL to HunterGate
😄
from hunter.
Related Issues (20)
- ceres-solver v2.1.0 unexpectedly builds with CUDA support
- How to compute Hunter/Toolchain/Config ID HOT 4
- Add "tensorflow-lite" package HOT 1
- fatal error C1083: Cannot open include file: 'json/json.h': No such file or directory HOT 4
- [BUG] cmake hangs on hunter_unpack_directory HOT 1
- Support for OpenSSL 3.x HOT 3
- missing SHA1 details in v0.24.16 release note HOT 1
- Pass build options to boost HOT 3
- /usr/bin/ld: /home/sahoo/.hunter/_Base/cb0ea1f/a3a48bb/b64ffe3/Install/lib/libz.a(zutil.c.o): relocation R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a shared object; recompile with -fPIC HOT 12
- unittest hunter_setup_msvc fails because of ARM64 change HOT 9
- reeenable cmake hunter unittests to run in CI
- Doc - First step points to ruslo/hunter/wiki which does not exist HOT 1
- Missing OpenSSL 3.x IMPORTED Targets Crypto and SSL HOT 2
- cmake has now deprecated support for versions prior to 3.5 HOT 5
- hunter_protected_sources doesn't seem to be working with custom packages
- Update "imgui" package HOT 2
- OpenCV force push access rights HOT 1
- GitHub Actions macos-10.15 runner deprecated and removed by 2022-08-30
- OpenSSL v3+ version number not reporting correctly in CMake
- MingW builds broken in CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hunter.