More Modern CMake - Deniz Bahadir - Meeting C++ 2018

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ธ.ค. 2024

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

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

    So, now that cmake finally joined the boat of build systems with sane concepts, it may be time to give it a sane syntax.

    • @yuricherkasov
      @yuricherkasov 5 ปีที่แล้ว

      I was always dreaming of converting all that messy Perl-like syntax into something like Python

  • @ZhanhuiLi
    @ZhanhuiLi 4 ปีที่แล้ว

    With knowledge from this lecture, projects managed by CMake become ever easier to understand and maintain. Big thanks!

  • @Deniz.Bahadir
    @Deniz.Bahadir 5 ปีที่แล้ว +9

    The sequel to this talk can be found here: th-cam.com/video/y9kSr5enrSk/w-d-xo.html

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

    The hardcoded /opt/boost path is not modern CMake. Try to run this in a CI pipeline...

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

    I always wondered why I have to define a source wenn adding a static library. Nice to see it fixed in 3.11 :)

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

    A fantastic presentation. So good in fact that it's finally justified to me that I should take a serious look at other build systems, like meson, build2, and evoke. cmake is just too heavy to code in without requiring an IDE of it's own to be able to introspect the properties to keep you productive without getting killed by "off by one" variable name errors.

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

      This seems rash, in my opinion, but maybe cmake isn't ideal for your projects. Terseness of a language is inversely related to its flexibility, and cmake made has made the deliberate decision to give us quite a bit of freedom in structuring our code.
      Also, I think it hurt the presentation to show the old cmake code. The right side is much more approachable when viewed by itself.

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

    Before people were writing Makefiles to compile c++ code. But they got complicated, so cmake was created to generated the Makefiles. But now cmake is becoming so complex, that a new tool needs to be developed that will generate cmake for you, which in turn can generated Makefile.

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

      That new tool could just be ... makefiles :p

    • @ovrskr
      @ovrskr 9 หลายเดือนก่อน

      @@retropaganda8442 Makefiles work great until you try to do anything on a path with spaces. Which very helpfully is the case on just about every Windows system!
      Don't get me wrong, I love my Makefiles, just all the build tools suck in a way :-(

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

    For everyone with no access to "More Modern CMake":
    In "Modern CMake" (since 3.1 because of target_sources) you can wrap your object library or imported library with an interface library. It's not pretty, but it's a decent workaround for most of the issues mentioned in this presentation.
    Here is an example:
    add_library(someexternallib OBJECT
    someexternallib/someexternallib.cpp
    someexternallib/someexternallib.h
    )
    set_property(TARGET someexternallib PROPERTY POSITION_INDEPENDENT_CODE ON)
    target_compile_definitions(someexternallib PRIVATE
    SOME_MACRO
    )
    add_library(someexternallib_interface INTERFACE)
    target_sources(someexternallib_interface INTERFACE
    $
    )
    target_compile_definitions(someexternallib_interface INTERFACE
    SOME_MACRO
    )
    target_include_directories(someexternallib_interface INTERFACE
    "${CMAKE_CURRENT_SOURCE_DIR}/someexternallib"
    )
    add_library(3rdparty::someexternallib
    ALIAS someexternallib_interface
    )

  • @qili3532
    @qili3532 5 ปีที่แล้ว

    thanks a lot, I'm wondering where can I find the sample code?

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

      sorry, speaker attach the source code web link already in the slides:
      github.com/Bagira80/More-Modern-CMake

  • @afigegoznaet
    @afigegoznaet 5 ปีที่แล้ว

    Normal slides, finally :)

  • @ovrskr
    @ovrskr 9 หลายเดือนก่อน

    if it's not broken, don't fix it. now there's so many ways to import and the build system is a mess -_-

  • @Stradigos
    @Stradigos 4 ปีที่แล้ว

    I'm confused.