Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Plain Wu
    @plainwuatdeepforce_gitlab
    ok thank you ^_^
    Tim Stack
    @tstack
    are there any examples of packages that provide binaries for use during a build? I use re2c to generate some code and would like to install that via hunter
    Ruslan Baratov
    @ruslo
    @tstack If you're not cross-compiling (CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME are equal) then doing something like hunter_add_package(re2c) should be enough.
    caseymcc
    @caseymcc
    question on the local config. on the hastynoise lib if I have some project flags set using a local config file and compile the project directly everything works fine. however if I put the mods into the package and test the package it seems the local config is ignored. Should the flags be put in the hunter.cmake hunter_cmake_args or is there another way to handle it?
    Ruslan Baratov
    @ruslo

    @caseymcc CMAKE_ARGS for the package will be calculated once before first dependency build. See the Config-ID part:

    The HunterGate parameters of the dependency, including local customization, will be ignored and taken fully from a parent.

    Should the flags be put in the hunter.cmake hunter_cmake_args or is there another way to handle it?

    Yes, you can add them to hunter_cmake_args upstream or in your own fork, or you can mention the CMAKE_ARGS in documentation.

    caseymcc
    @caseymcc
    @ruslo so on HastyNoise I needed to include boost filesystem and I am adding it as a shared library so I need to feed somethings to the config like I mentioned above if I a local config in Hasty's cmakelist file everything works fine. However when trying to package Hasty for Hunter again the example fails as the local config is ignored. I tried put the flags in the HastyNoise/hunter.cmake file using hunter_cmake_args(Boost CMAKE_ARGS ...) hoping that it would be picked up there (but does not seem to work either). So taking what you have said above I am assuming they will need to be noted foe the lib that the parent project will have to set the flags for boost (and for testing purposes the hunter example) . Is this correct or is there a way for HastyNoise to force the boost flags without the parent knowing?
    actually I really don't care that boost filesystem is shared or static but the default config on clang seems to fail on an -fPic issue that I am not very familiar with.
    caseymcc
    @caseymcc
    looking at ruslo/hunter#979, should I just switch back to static and set the tests to using a pic toolchain from polly?
    Ruslan Baratov
    @ruslo

    I tried put the flags in the HastyNoise/hunter.cmake file using hunter_cmake_args(Boost CMAKE_ARGS ...) hoping that it would be picked up there

    @caseymcc It should not work, it's designed to be used for the current project only, not for dependency.

    Is this correct or is there a way for HastyNoise to force the boost flags without the parent knowing?

    That would be quite surprising if doing hunter_add_package(Boost COMPONENTS system) will do static boost.system build, but doinghunter_add_package(Boost COMPONENTS system) + hunter_add_package(HastyNoise) will switch it to shared boost.system build.

    but the default config on clang seems to fail on an -fPic issue that I am not very familiar with

    I need details, why it's failing? You forced SHARED library somewhere?

    Example of adding HUNTER_BUILD_SHARED_LIBS=ON to test:

    Example of mentioning PIC toolchain in documentation:

    caseymcc
    @caseymcc
    I just modified the hunter example to use boost as a shared lib.
    If I just used boost as default with no config via 'hunter_add_package(Boost COMPONENTS filesystem)' I would get /usr/bin/ld: /home/caseymcc/.hunter/_Base/270cafa/252eb92/d897b4b/Install/lib/libboost_filesystem-mt-d-x64.a(operations.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    which I think is happening because the project using it is a shared lib. I tested with feeding boost CMAKE_POSITION_INDEPENDENT_CODE=ON which worked, but in the end I just made it use the shared version of boost.
    Tim Stack
    @tstack
    it seems like the pkg-config-based packages need the pkg-config binary installed? would it be possible to remove that dependency?
    Ruslan Baratov
    @ruslo
    @tstack actually the right question is "would it be possible to ADD that dependency?" :)
    Tim Stack
    @tstack
    okie. I was trying to build on an ubuntu xenial vagrant box and it failed since pkg-config wasn't installed
    Ruslan Baratov
    @ruslo
    @tstack Related CMake module: https://cmake.org/cmake/help/latest/module/FindPkgConfig.html
    So if it would be possible to install pkg-config executable with Hunter we can initialialize PKG_CONFIG_EXECUTABLE accordingly. So there will be no necessity to have it in the system.
    Tim Stack
    @tstack
    cool, I can open a github issue to track, if that's okay
    Ruslan Baratov
    @ruslo

    okie. I was trying to build on an ubuntu xenial vagrant box and it failed since pkg-config wasn't installed

    @tstack Install it system wide, it's a common workaround for missing packages

    Tim Stack
    @tstack
    yeah, that's what I did
    Tim Stack
    @tstack
    is a hunter-packages fork of a package really needed to just add hunter_add_package() to the CMakeLists.txt ? Why can the autotools builds get away with using DEPENDS_ON_PACKAGES, but a fork is needed for a cmake-based project?
    Ruslan Baratov
    @ruslo

    Why can the autotools builds get away with using DEPENDS_ON_PACKAGES, but a fork is needed for a cmake-based project?

    @tstack Forks are easier to maintain if the structure is complex. If you move internal stuff out of the package and put it into Hunter code that leads to maintaining hell with if(*_VERSION VERSION_LESS ...). E.g. see Boost:

    Or something fresh:

    Related:

    Just for your info you can get rid of hunter_add_package by this improvement in theory:

    Tim Stack
    @tstack
    I've read the FAQs. And, I can understand having forks for older versions with broken/overcomplicated packaging. But, seeming to need a fork for a simple cmake-based package because it calls find_package() where the only difference is adding hunter_add_package() is onerous.
    I've been trying to use packages that have been forked and they aren't being updated to the latest version
    So, I have to reject the "it's easier" claim, because the reality is that packages are not being updated
    I'm really trying to drink the hunter/cmake kool-aid here, but I feel like I'm drinking from a dribble glass.
    David Hirvonen
    @headupinclouds

    I've been trying to use packages that have been forked and they aren't being updated to the latest version

    Where and how the package related patches are stored and the frequency of package updates seem to be independent issues. If hunter stored the package patches inside the repository, I don't see how this would translate to more frequent updates.

    Tim Stack
    @tstack

    Where and how the package related patches are stored and the frequency of package updates seem to be independent issues.

    Again, I'm talking about cases where the patch is solely about adding hunter_add_package() calls. Requiring a fork in that case instead of just being able to express the dependency in the hunter.cmake file (or, ideally, mining it out of the package's CMakeLists.txt file) increases the maintenance burden to a great degree.

    And, again, there are plenty of out-of-date packages that can be pointed to as evidence that the theory is not working out in practice
    Ruslan Baratov
    @ruslo
    To all: Please read the IMPORTANT announcement "Hunter: To be or not to be" ruslo/hunter#1921
    Tom Mason
    @wheybags
    Posted on reddit and hacker news :)
    really hope this works out
    Tom Mason
    @wheybags
    @ruslo Do you think it might be possible to organise sponsorship from kitware?
    Ruslan Baratov
    @ruslo
    @wheybags I'm not sure why they might be interested. If you write C++ code you don't ask for the help from Bjarne Stroustrup, right? :) I will not reject any contribution if they offer though. Also, they are pretty much in a win-win situation, if you're developing C++ package manager and don't support CMake you suck, not vice versa.
    My current hope only for peoples who are using Hunter already. Any package manager is as strong as the community around it. Hunter was there for more than a five years, if there is no solid support from peoples then I think it's right about a time to launch a shutdown party.
    Paweł Bylica
    @chfast
    What was the original motivation for creating it?
    Ruslan Baratov
    @ruslo
    @chfast Creating Hunter?
    Paweł Bylica
    @chfast
    yes
    Ruslan Baratov
    @ruslo
    @chfast I was learning CMake, at some point reached ExternalProject_Add module. It was an experiment to create some structure that allows the developer to merge/share/update ExternalProject_Add recipes easily.
    Tom Mason
    @wheybags
    @ruslo if it were rolled into cmake as a feature, it could be very powerful
    Jake Zhang
    @Kiddinglife
    Hi folks, is it possible to use private git server to host all the packages for company-internal use? thanks.
    David Hirvonen
    @headupinclouds
    see ruslo/hunter#1320 . you can add password protection for packages (github personal access token, etc), but not for the hunter fork itself. you could set up a vpn and run everything behind that.
    Ruslan Baratov
    @ruslo

    if it were rolled into cmake as a feature, it could be very powerful

    @wheybags There is no need to have the whole Hunter in CMake. You only need HunterGate functionality.

    If you could implement next features:

    • HunterGate functionality as a standard module in CMake
    • Trigger HunterGate logic before project if HUNTER_ENABLED=ON
    • Server which can respond with URL/SHA1 for "get latest" request
    • CMake hook for the find_package: https://github.com/forexample/cmake-find-package-include to get rid of hunter_add_package
    • Apply CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON to get rid of CONFIG

    Then you can do:

    # CMakeLists.txt
    
    cmake_minimum_required(VERSION 3.2)
    project(foo)
    
    find_package(Boost REQUIRED system filesystem iostreams)
    find_package(ZLIB REQUIRED)
    cmake -H. -B_builds -DHUNTER_ENABLED=ON

    to satistify dependencies automatically with Hunter.

    Or

    cmake -H. -B_builds -DHUNTER_SHA1=32cfed254da901f6f184027d530d8da47e035b85

    for reproducible build.

    needs
    @needs
    Hello, I have trouble figuring out how to add a "private" dependency in my project. I have a libfoo in a private git repo, and I would like to clone the repo, build the lib, include the right directories and so on. Is there a proper way to do it with hunter? hunter_config() maybe?
    Ruslan Baratov
    @ruslo

    @needs If you push back changes to the server and make a release, you can use "Protected sources" feature:

    Also, you can pack submodule on-the-fly:

    needs
    @needs
    Oh okay, so submodule is the way to go since the lib doesn't have any releases. Thank you
    needs
    @needs
    (Well, turns out ExternalProject_Add() is much better suited for what I wanted to do)
    EBF Iulian
    @EBF_Iulian_twitter
    Would it be possible to add Xerces library to Hunter repository?

    I'm looking for xsd (codesynthesis) and xerces packages. Seems like they are not available on hunter

    Ok I'm not the first one to look for xerces