import CMake, CMake and C++20 Modules - Bill Hoffman - CppCon 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2024
  • cppcon.org/
    ---
    import CMake, CMake and C++20 Modules - Bill Hoffman - CppCon 2022
    github.com/Cpp...
    Originally developed as part of the National Institutes of Health (NIH) open source medical segmentation and registration toolkit ITK in 1999, CMake has grown to take on a vital role in the C++ ecosystem. Bill Hoffman, a founder of Kitware (www.kitware.com), and the creator of CMake will talk about where CMake is in 2022. The talk will start with a brief history of CMake and how it fits into the world of C++. It will then talk about recent developments to support C++20 modules.
    For most of CMake's history, CMake has played catch up and implemented new features as compilers and IDEs have been released. With C++ modules, CMake developers have engaged the standards committee and compiler vendors to help craft the standard in such a way that CMake and other build systems can more seamlessly implement C++ modules. CMake has worked with Fortran modules for many years and has updated the ninja build tool to be able to dynamically update dependency information as it is discovered. To do this CMake requires a Fortran parser built into CMake. For obvious reasons CMake does not want to get into having its own C++ parser. This is the main driving force for pushing this work into the compilers. This talk will go over the road map for CMake C++ module support.
    In addition to the history of CMake, C++ module support, this talk will include material covering important CMake features supporting the seamless building, testing and deployment of C++ across most computing platforms. In summary, listeners will learn about CMake origins, the roadmap of C++ module support in CMake and get an overview of the current set of features in CMake.
    ---
    Bill Hoffman
    Mr. Hoffman is a founder of Kitware and currently serves as Chairman of the Board, Vice President, and Chief Technical Officer (CTO). He is the original author and a lead architect of CMake, an open source, cross-platform build and configuration tool that is used by hundreds of projects around the world, and he is the co-author of the accompanying text, Mastering CMake. Using his 20+ years of experience with large software systems development, Mr. Hoffman is also a major technical contributor to Kitware’s Visualization Toolkit, Insight Toolkit, and ParaView projects
    Mr. Hoffman received a B.S. in Computer Science from the University of Central Florida and an M.S. in Computer Science from Rensselear Polytechnic Institute (RPI). Prior to the formation of Kitware, he spent nine years at the General Electric Corporate Research and Development center, working in the Computer Vision Group. He has planned and taught several graduate-level courses at RPI as well as a course in object-oriented programming at New York University.
    __
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    TH-cam Channel Managed by Digital Medium Ltd events.digital...
    #cppcon #programming #cmake

ความคิดเห็น • 45

  • @djordjepepic1656
    @djordjepepic1656 ปีที่แล้ว +14

    Was shocked and impressed to discover the presenter is actually the original author of CMake! Also once I realized this, I also realized that this guy is exactly how I would have imagined the author of CMake to be; smart, easygoing, friendly and here to build some C++! Anyways great talk, definitely very helpful to me in my endeavor of writing a new package manager for C++.

  • @JaskMar
    @JaskMar ปีที่แล้ว +10

    17:00 to skip things we already know about CMake (non-modules-related information)

  • @TheMR-777
    @TheMR-777 ปีที่แล้ว +11

    I thought it's just a usual Cpp talk, opened it, and when got to know he's the creator of CMake, I was mind-blown!
    It's an honor to have a session with Mr. Hoffman.
    Moreover, a Great thanks to CppCon as always, for being a source of such valuable knowledge :)

  • @ianliu88
    @ianliu88 ปีที่แล้ว +3

    C++ is now on par with fortran, congrats!

  • @moamenkhet
    @moamenkhet ปีที่แล้ว +3

    Amazing talk, thank you very much!

  • @Omnifarious0
    @Omnifarious0 ปีที่แล้ว +2

    I'm really looking forward to when I can use this without compiling custom versions of system packages.

  • @brynyard
    @brynyard ปีที่แล้ว +8

    It's nice to have a configure/build tool that finally has sorted out (most) of various IDE&OS build quirks, but I think it's high time that the syntax get revised into anything that follows even just the most basic good practices of a programming language (or like someone mention - can be used like a lib and the config done in python). There's tons of severe issues with things like proper expressions, scoping, variable scoping, argument parsing, return values, debugging tools, quoting, inconsistent naming scheme, etc, and somehow I (and many more!) are really put off using CMake by these deficiencies. While continuing ironing out platform quirks and tool compatibilities are important, it's a bit disconcerting that these things doesn't even seem to even be considered for fixing.

    • @llothar68
      @llothar68 ปีที่แล้ว

      You just need to read a good language description. The only one i have seen is not in the online docs but you have to buy this CMake for Professionals book.
      The online documentation really needs thousands of examples. Look at the PHP documentation which is still the gold standard. And finally we need to add deprecation warnings to all options.

    • @brynyard
      @brynyard ปีที่แล้ว +1

      @@llothar68 sorry, but a better description of CMakes terrible language syntax doesn’t improve it (which incidentally also applies to PHO’s infamously inconcistent standard library).
      There are no good sources for how to write «good» CMake scripts, quite simply because it’s nigh impossuble given all the quirks one have to incorporate.

    • @angelmarauder5647
      @angelmarauder5647 ปีที่แล้ว

      @@brynyard what do you use instead?

  • @dexterman6361
    @dexterman6361 ปีที่แล้ว

    Can't wait to test this out! Shame cuda isn't catching up!
    Thank you for the video!

  • @petermuller608
    @petermuller608 5 หลายเดือนก่อน

    While I love CMake, I really dislike how hard it is to learn the modern style.
    Even the author of CMake uses legacy style set(CMAKE_CXX_STANDARD...) instead of target_compile_features(...)
    And it's not because it's slide code, both take up a line. Also complexity cannot be the reason, since he used much more complex generator expressions before.
    How should a novice learn? Is there something like shellcheck for cmake, warning about the usage of old features?

  • @TheMaidenOnes
    @TheMaidenOnes ปีที่แล้ว +1

    No clang support for modules yet..

  • @YourCRTube
    @YourCRTube ปีที่แล้ว

    55:08 A bit confusing mymodule_part_internal.cpp needs to be part of the set, though it does not export. I guess that's because it declares new partition?

  • @Key_Capz_
    @Key_Capz_ ปีที่แล้ว

    For some reason sstream module in vs 2022 isn't fully working unless you #include it.

  • @oraz.
    @oraz. ปีที่แล้ว

    Hold up, you need to build a patched gcc to do this?

  • @egorsozonov7425
    @egorsozonov7425 ปีที่แล้ว +25

    It's 2022, C++ is 40 years old, and yet C++ head honchos are still figuring out how to compile a C++ program...

    • @IllumTheMessage
      @IllumTheMessage ปีที่แล้ว +3

      We have to get it juuuuuuust right.

  • @crea7or
    @crea7or ปีที่แล้ว +20

    This is why Rust and other languages getting more attention than C++. Building apps shouldn't be that hard.

    • @StefaNoneD
      @StefaNoneD ปีที่แล้ว

      Exactly what I was thinking!

    • @nandhan6637
      @nandhan6637 ปีที่แล้ว

      ya lacking simplicity and wastes more time which is precious

    • @cgazzz
      @cgazzz ปีที่แล้ว

      This is however an experimental feature to support a huge new experimental feature on 3 different compiler families. Once a CMake pattern is started it's fairly simple to repeat

  • @PaulHindt
    @PaulHindt ปีที่แล้ว +7

    I would love to see a Python version of CMake, where CMake is simply imported as a module into Python script. Given the steady rise in popularity of the Meson build system, I suspect that there are many other C/C++ developers that share this opinion.
    I've written both small and largeish build scripts in CMake and, while generally a joy to use, my biggest gripe with CMake is having to learn its dedicated language syntax. To my mind the biggest strength of CMake is not its custom language, but the years of hard-won build system knowledge that KitWare has amassed. Mr. Hoffman sort of touches on this in the video, when he discusses reverse-engineering Visual Studio solutions to create CMake generators. The second biggest strength of CMake is its toolchain and IDE integration.

    • @petermuller608
      @petermuller608 5 หลายเดือนก่อน

      Isn't syntax completely arbitrary? It would be trivial to transpile from python to CMake if you restrict your python to the functions available in CMake

  • @StefaNoneD
    @StefaNoneD ปีที่แล้ว +13

    Still way too complicated compared to modern language toolkits for C#, Java, Rust, Go etc.
    You really have to study (!) CMake in order to use it professionally. In contrast, the above mentioned languages offer more easy way to use their build systems. Especially Rust with Cargo is very, very easy to use.

    • @JeremyCoppin
      @JeremyCoppin ปีที่แล้ว

      Exactly !! Compiling/Linking C++ is the biggest hurdle you will have in any C++ project, not the problem you're trying to solve, no matter how complex that problem is. The second problem is that there are very few 'modules to do common tasks' and if you do find one, see above. I have 10's of abandoned projects because of this, the latest being trying to link paho mqtt which I have working in Java and Python, neither of which gave me any issues.

    • @llothar68
      @llothar68 ปีที่แล้ว +2

      @@JeremyCoppin Ha, if you think compiling and linking is hardest, try deploying. But thats a language independent problem these days.

  • @discreet_boson
    @discreet_boson ปีที่แล้ว

    What about support for import std; ?

    • @pengxie3087
      @pengxie3087 ปีที่แล้ว

      it seems to be a C++23 standard feature

  • @王靖凯-w7k
    @王靖凯-w7k ปีที่แล้ว

    牛哇,小三年了,总算要来了!

  • @origamibulldoser1618
    @origamibulldoser1618 ปีที่แล้ว +4

    Cmake is nice, but it's also hard to ignore that cmake is a build system system.

    • @origamibulldoser1618
      @origamibulldoser1618 ปีที่แล้ว

      13 minutes in and cpp20 and modules are not yet mentioned.

  • @junaid1464
    @junaid1464 ปีที่แล้ว +6

    Honestly not happy with what we have for c++, been thinking around rethinking build system for c++, actually this should be 1st priority of standards community

    • @petermuller608
      @petermuller608 5 หลายเดือนก่อน

      The C++ Standard does not know build systems. It barely acknowledges source code is living in "files"
      Not saying you are wrong, but the standard is the wrong place

  • @DimiterStanev
    @DimiterStanev ปีที่แล้ว +1

    If only CMake supported generated .vcxproj with relative paths... When you have thousands of .vcxprojs it's hard to migrate over time.

  • @Dazza_Doo
    @Dazza_Doo 2 หลายเดือนก่อน

    If you're trying to claim that you're the official build of C++, Why haven't you built tools, Where is the integration?
    Where is the place that I go to download your application that then downloads the appropriate complier that I can then link all my projects to

  • @rabutuomr3382
    @rabutuomr3382 ปีที่แล้ว

    Module!

  • @ko_fes
    @ko_fes ปีที่แล้ว

    CMake under windows is a nightmare. 'Couse you can't change compilers/debugger/linker by changing cmake file only (if you want to use utilities that are not packaged by vs installer), - you also must some how setup dev environment and that is not trivial if you don't want to use IDEs and just want to build & run a project by a few commands.
    And also - why for building cmake project under windows it's necessary to generate a whole bunch of sln-related files, even if you use clang-cl? When Windows developers resolve this problem?

    • @lmi9f9
      @lmi9f9 ปีที่แล้ว +2

      Start over, you're doing it wrong. I don't know Such issuea.

    • @DFPercush
      @DFPercush ปีที่แล้ว

      You choose a generator (visual studio project, ninja, make) and a compiler ("specify native compiler" in cmake-gui) during the configure step. That information is in the cache. You might want to just start over with a new build directory if you don't see those options. If you want to use a utility that is not part of the standard compiler toolchain, you probably want to use add_custom_command and add_custom_target. If you need to build a visual studio project without opening the IDE, use msbuild. or cmake --build . But if you don't want any visual studio files, then you probably picked the wrong generator.

  • @junaid1464
    @junaid1464 ปีที่แล้ว +5

    Build system becoming job requirement. :(

    • @JeremyCoppin
      @JeremyCoppin ปีที่แล้ว

      It is a job in and of itself.

  • @kspangsege
    @kspangsege ปีที่แล้ว

    Emacs 👍 🙂

  • @konstantinlimarev2639
    @konstantinlimarev2639 ปีที่แล้ว

    Cpp modules th-cam.com/video/5X803cXe02Y/w-d-xo.htmlm50s