CMake Tutorial EP 4 | Versioning Source Code

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 25

  • @dmcdcm
    @dmcdcm 3 роки тому +37

    just fyi, this vid has highest vid quality of 360p. sometimes i dont notice when i upload.
    oh and hey, you are a life saver with these videos. Everything you are covering is necessary knowledge, except no one at university covers it, no online courses cover it, and the few youtubers who do don't do it well. So from the bottom of my heart, thank you.

  • @gabrielciordas3369
    @gabrielciordas3369 3 роки тому +1

    Your CMake tutorials are so good that I subbed and enabled notifications.

  • @YourCRTube
    @YourCRTube 4 роки тому +1

    BTW one can also use the regular ${} syntax instead of @@. The second one is only needed if the file to be transformed already use the first one

  • @chuongnguyen4980
    @chuongnguyen4980 3 роки тому +4

    Great tutorial. I follow from EP1 to here, but have the error: the main.cpp can not find the "#include " when building, although this file is in build folder after run configure.
    I have to manually add #include "build/OLASConfig.h". Am I missing sth ?
    Thanks.

    • @chuongnguyen4980
      @chuongnguyen4980 3 роки тому +8

      Oh, so I found that using this line does not work for my case (Cmake 3.16.3), :
      target_link_directories(${PROJECT_NAME} PUBLIC ${PROJECT_BINARY_DIR})
      Replace it with the following works now:
      include_directories(${CMAKE_CURRENT_BINARY_DIR})
      Source: cmake.org/cmake/help/latest/command/configure_file.html

    • @rodrickedwards2759
      @rodrickedwards2759 2 роки тому +1

      @@chuongnguyen4980 Worked for me. Thanks!

  • @siddiqhabib9627
    @siddiqhabib9627 27 днів тому

    Going by the comments looks like some of the errors are due to including "*_Configh.h.in" instead of "*_Config.h" in main.cpp

  • @followthewhiterabbit7559
    @followthewhiterabbit7559 2 роки тому

    I am really binged on your videos for a couple of hours now, everything is great just the video quality seems to be pretty low in this one. hard to keep up with the things written in files.

  • @KP-nc9gk
    @KP-nc9gk 2 роки тому

    add_compile_definitions in cmake can simplify this right?

  • @benmclemor2714
    @benmclemor2714 3 роки тому +1

    hello, it does not work for me. I get the error, that OLAFConfig.h cannot be opened. No such file or directory. Does anyone have an idea why?

  • @gru74ik
    @gru74ik 3 роки тому

    I didn't get the point how the project can be built if we didn't create OLASConfig.h header (only OLASConfig.h.in has been created)?

    • @rexyliusde7681
      @rexyliusde7681 3 роки тому +2

      I believe CMake auto-generates the OLASConfig.h file based on OLASConfig.h.in . The Make file then uses the auto-generated OLASConfig.h .

  • @sammyiboi
    @sammyiboi 4 роки тому +5

    I'm finding that the best quality for this video is 360p. Maybe try re-uploading?

    • @CodeTechandTutorials
      @CodeTechandTutorials  4 роки тому +2

      AHH I did not notice, not sure why that happened. Thanks for the heads up.

    • @0xredact3d
      @0xredact3d 4 роки тому +1

      @@CodeTechandTutorials Is there an updated version now?

  • @晨晨韩
    @晨晨韩 3 роки тому

    Why should we need two header files, which are h.in and .h ?

    • @salvadorhernandezlopez953
      @salvadorhernandezlopez953 2 роки тому

      because the h.in have the reference if you want to view of the other perspective it have the name of the constant, and the .h have the value

  • @masoodkamandy5370
    @masoodkamandy5370 3 роки тому +10

    Can't tell if they're there or not because of the video quality, but the macro should look like this *with quotes*:
    #define MYPROJECT_VERSION_MAJOR "@MyProject_VERSION_MAJOR@"
    #define MYPROJECT_VERSION_MINOR "@MyProject_VERSION_MINOR@"

  • @Ashish_singh_dev
    @Ashish_singh_dev Рік тому

    project(test VERSION 1.0) //didn't work for me
    //working code NOTE: ORDER SHOULD BE SAME
    project(test)
    set(TEST_VERSION_MAJOR "1")
    set(TEST_VERSION_MINOR "0")
    configure_file(TESTConfig.h.in TESTConfig.h)
    // In TESTConfig.h.in
    #define TEST_VERSION_MAJOR "@TEST_VERSION_MAJOR@"
    #define TEST_VERSION_MINOR "@TEST_VERSION_MINOR@"

    • @sanjeevmaurya01
      @sanjeevmaurya01 3 дні тому

      test and TEST are not same change to make them same