Skip to content
  • Tomáš Pecka's avatar
    aql: Download new TClap by cmake · 7c0adf3e
    Tomáš Pecka authored
    Long story short, tclap<=1.2.4 does not work with g++-11 compiler. We
    sent a patch into TClap which was merged [1], however, new version was
    not yet released so the distros have not included the fix in the
    packaged versions of TClap.
    
    This is becoming kind of a blocker for people who want to compile ALT.
    I figured out that CMake can download external projects and if you do
    things *magically right* [2] you can also convince the external projects
    to be built before your project so you can depend on them.
    So, CMake should now download TClap if you configure it to build aql2.
    As tclap is header-only, compilation of aql2 modules should include the
    directory where tclap is downloaded (and prefer it to the /usr/include
    system path).
    Unfortunately, tclap triggers a lot of warnings for us (hi,
    -Wsuggest-override and -Werror) that we haven't seen before because
    system headers do not trigger warnings. Fortunately, CMake can configure
    includes to be SYSTEM includes (and use -isystem instead -I for g++
    builds) which make things working again. However, this is just a really
    big hack, AFAIK.
    
    (I, personally, still think we should use some new, C++17-ready argument
    parsing library. There is plenty of them.)
    
    [1] https://sourceforge.net/p/tclap/code/ci/52a118c0edb20f64e8da88dc9d0bfee63f2232ac/
    [2] https://crascit.com/2015/07/25/cmake-gtest/
    
    Bug: algorithms-library-toolkit/automata-library#214
    Bug: https://sourceforge.net/p/tclap/bugs/33/
    7c0adf3e