CMake Tutorial EP 2 | Libraries | Installing | Pairing with Executables | RE-DONE!

แชร์
ฝัง

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

  • @VictorAndScience
    @VictorAndScience ปีที่แล้ว +65

    Came to learn about CMake, and I ended up learning all the c++ basics I've been missing my entire life.
    Thanks, mate.

  • @elwinjyothis5388
    @elwinjyothis5388 3 หลายเดือนก่อน +5

    I was frustrated with external libraries in C/C++ for a very very long time. I even stopped working with C/C++ at a point. Just finished this video, now I can build, link and install any external libraries or open source tools out there in the internet. I finally understand whats going under the hood. Thank you soo much!!!!

  • @darrenfinch1935
    @darrenfinch1935 7 หลายเดือนก่อน +10

    As someone who has been trying to learn about CMake, this tutorial series is super helpful and criminally underrated. Thanks!

  • @archibald-yc5le
    @archibald-yc5le ปีที่แล้ว +3

    Taught me everything I need about CMake, the best and the most practical tutorial there is. Thank you so much, you've gained a happy subscriber

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

    I started building a large BASH program last month, and the harder it gets to manage, the more I'm starting to want to use C++ instead. In you come just a few weeks before with the exact tutorial that I needed to convert all my shell scripts to a structured cpp project. Thanks a lot!

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

    Literally the best hands on tutorial on CMake you will ever find.

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

    I think you can return the exit value of the main function by typing echo $? on linux at 27:34

  • @satyamraj2779
    @satyamraj2779 3 วันที่ผ่านมา +1

    Thank you for your invaluable lecture. I learned a great deal from this video. To capture the return value, try printing it using the command "echo $?".

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

    Thank you very much for this brilliant series! I found it very helpful. Great job done! Keep rocking!

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

    Very useful. Thanks a lot for taking the time to record and share this!

  • @Kirfx
    @Kirfx 4 หลายเดือนก่อน

    Thank you! I've been avoiding C/C++ very long time because of build system complexity. You make it clear.

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

    This is awesome stuff dude. Just exactly what I needed to learn right now.

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

    Made my first installable c++ programme today. Thanks to you. I've been learning make and cmake lately.

  • @nandunarayanan
    @nandunarayanan 10 หลายเดือนก่อน +6

    you did not remove the relative path inclusion of adder.h in main.cpp, instead you could have add
    #include
    using namespace mearlymath;

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

    These tutorials are great! Thanks for making them!

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

    I like almost any content you create for us

  • @danibarack552
    @danibarack552 7 หลายเดือนก่อน +1

    my man the info is useful and I'm glad that people enjoy learning a lot but please get to the point lmao. I just want to learn how to create a library and link it to a project in cmake, I don't need to hear a whole tangent on namespaces

  • @SuperflyJon
    @SuperflyJon 11 หลายเดือนก่อน

    Given that in this example we are building the library and the executable adding a add_subdirectory() function to the parent CMakeLists.txt file will chain the projects. Then building the executable will build the library as well

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

    Thanks for your time to teach people something.
    Just a little feedback: In the previous video, you were using VS Code and I think it was easier to understand the file hierarchy. Also, not seeing the current directory in the command line prompt confuses things for us :)

  • @user-hk9yw4qr4h
    @user-hk9yw4qr4h 3 หลายเดือนก่อน

    Love your videos, and really digging your logo!

  • @user-kt8nc4xd1u
    @user-kt8nc4xd1u ปีที่แล้ว

    Really great contents! Thanks for creating this video

  • @Zero-fl6wf
    @Zero-fl6wf ปีที่แล้ว +6

    SEE ORIGINAL EPISODE 2, in episode 3 you would need what you see in original episode 2

  • @gabemorris1231
    @gabemorris1231 7 หลายเดือนก่อน +2

    Please "sudo apt install tree" and run the tree command from time to time. It'll make it easier for us to see the file structure, but thanks for the vid.

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

    -f shouldn't be needed on rm -R. It doesn't do what some people assume it does, and what it does do is hide some error messages that may indicate you made a mistake typing the command. If the files you are deleting exist and your user has permissions on both the files and their containing directories, rm -R (or just rm -r) should work fine

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

    Btw, you made the include file available but you did not change the include directive, its still using a relative path

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

    Very good tutorial you earned another subscriber and a like ! Thank you zues

  • @MurderByProxy
    @MurderByProxy 7 หลายเดือนก่อน

    I was about to make a comment the other day about how videos seem to me in numerical order but not in chronological… took me a while to realize it was indeed the case

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

    Here to stomp the comp... 💯

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

    echo $? for getting the exit status of program. Thanks for the tutorial.

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

    echo $? will show 5

  • @Ashish_singh_dev
    @Ashish_singh_dev 6 หลายเดือนก่อน +1

    17:24 also add adder.h in add_library(mearlymath adder.cpp adder.h) // those who are getting errors

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

    Im a total newb in cmake and thanks for the video. I have some questions.
    1. 00:26:56 In my case this didn't work and cmake gives me an error like this: /usr/bin/ld: cannot find -lmearlymath. So I erased target_link_directories(testsome PRIVATE ${CMAKE_SOURCE_DIR}/../../SomeLibDemo/cpp/build/)
    and replaced target link lib with
    target_link_libraries(testsome ${CMAKE_SOURCE_DIR}/../../SomeLibDemo/cpp/build/libmealymath.a)
    and this worked. Why is that /usr/bin/ld: cannot find -lmearlymath error popuping?
    2. 00:33:30 my workspace shows up with this cmake error:
    install TARGETS given unknown argument "include".
    I get the meaning of DESTINATION and PUBLIC_HEADER from the offical docs, but what is lib and include?

    • @tadashi_hamada
      @tadashi_hamada 7 หลายเดือนก่อน

      I had same issue. It was because i ran "make" instead of "sudo make install"

  • @Yusufbek-gp2qp
    @Yusufbek-gp2qp 14 วันที่ผ่านมา

    Thank you!!!

  • @azeddinfaouzi8126
    @azeddinfaouzi8126 7 หลายเดือนก่อน

    Amazing, maybe a little bit of zoom on the code, content stays perfect :] Thank you

  • @minhajsixbyte
    @minhajsixbyte 3 หลายเดือนก่อน

    Hi, 27:47
    echo $?
    to get the last return value.
    Thanks!

  • @teuton8363
    @teuton8363 10 หลายเดือนก่อน

    Thanks!

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

    unable to do same things in cmake 3.10.2

  • @ns50350
    @ns50350 7 หลายเดือนก่อน

    where can we find trimerdemo and trim file

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

    9:00 at the drop of a dime.
    Haha. I'm going to use that one.

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

    Thanks alot

  • @double-lung7364
    @double-lung7364 ปีที่แล้ว

    Thanks

  • @testtest-ip3lu
    @testtest-ip3lu 5 หลายเดือนก่อน

    I really don't like the cmake thing , still can't compile a simple project . cmake also need the so file start with `lib`. And there are so many similar command make people confused. I really hope rust and cargo replace all those cmake and cpp things

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

    27:50 "echo $?" or "echo $status" for csh

    • @teuton8363
      @teuton8363 10 หลายเดือนก่อน

      Well it's fundamentally wrong what he is doing. The return value of a program indicates the status (negative values => not successful).

  • @jonasprintzen9508
    @jonasprintzen9508 8 หลายเดือนก่อน +1

    I suggest adopting "Solve one problem Well", by sticking with talking about cmake. No Linux-commands, no C/C++. it's a better way to keep it short.
    Returned value from a command: echo $?.. Try 'false;echo $?;true;echo $?'
    You really shouldn't create confusion about which folder you are in. Let the prompt show!

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

    If you say definition all the time than, eventually, you will be right 😅

  • @florentcastelli
    @florentcastelli 7 หลายเดือนก่อน

    Have you tested your project with CMake 2.8? No.
    So stop claiming it's the required version and use something current. Then you won't have to worry about bumping the minimum required version each time you want to use a feature.

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

    The original was easier to follow, you mix things that are linux usage related thats not too important for cmake

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

    CMake generated Makefiles are artificially long - you could typically throw out more than 90% of its content. A handwritten Makefile for such a simple example would also only consist of a few lines.
    Thing is that handwritten Makefiles require you to specify all the dependencies and get all commands right for e.g. building a library.
    What I don't like about cmake: there is a lot of black magic happening behind the scenes. This discomfits me. Same is true for GUI vs command line.

    • @5374seth
      @5374seth หลายเดือนก่อน

      A hammer doesn't tell you how a nail works, neither does CMake(or other build systems) tell you how the C++ building process works. C++ is just a forever-mess. CMake helps to ease that mess by abstracting away whatever specific functionally-equivalent syntactical idiosyncrasies your theoretical build system contains. I see CMake, and tools like it, as necessary evils in the hellscape that is the land of decentralized implementations of languages and their tools, ie the C++ ecosystem.

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

    5:18 that's kinda misleading and wrong, you don't need 2 hundred lines of Makefile to compile a programme, most of the stuff cmake puts into makefile are not useful for simple projects and moreover are a bloat imo

  • @typicalIsraeli
    @typicalIsraeli 8 หลายเดือนก่อน +9

    I'm sorry, this tutorial is too "all over the place" i.e. not concise. The crucial aspects could have been covered in 10m - 15m. Video quality is low, even at 1080p (doesn't seem sharp), and the text editor is way too small. Learning C++ tricks is not the topic, tutorials should be focused.

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

    Please please - this music overlay is execively annoying!

  • @Alperic27
    @Alperic27 23 ชั่วโมงที่ผ่านมา

    ya just have no clue what cmake really is …. 🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️

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

    Thanks