Using CMake to Define Macros [Ep 9]

Поділитися
Вставка
  • Опубліковано 22 жов 2024
  • The title and picture say it all. Using #define but with CMake rather than doing it in your code.

КОМЕНТАРІ • 9

  • @timi_t_codes
    @timi_t_codes Місяць тому

    Thanks a lot for this CMake series!!

  • @default2043
    @default2043 Рік тому +1

    Another great video! One question though. I built the CMake project for different IDEs and compilers and I did notice that some other IDEs are not exactly great at picking up with the syntax completion and highlighting aspect like Visual Studio, CodeLite, etc. Is there any way to make them work?

    • @sudocpp
      @sudocpp  Рік тому +1

      For Visual Studio Code, you need an extension and even that doesn't highlight perfectly. I suspect other IDEs just haven't prioritized highlighting CMake logic. You could look for extensions to add that ability for them also.

    • @lsrinivasamurthy
      @lsrinivasamurthy 8 місяців тому

      cLion is best.

  • @Narblo
    @Narblo 11 місяців тому

    How do you add Defines to different config types and/or based on cmake config variables?

    • @sudocpp
      @sudocpp  10 місяців тому

      So you mean like a config.h file?

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

    What Abt add definition

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

      That will also work but if you check CMake's documentation you can see that it has been "superseded" by add_compile_definitions. (It still exists for backwards compatibility reasons.)
      Add_definitions basically just drops your string into the command line and technically can be used to also include directories and do other things, whereas add_compile_definitions is designed to be specific.

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

      @@sudocpp I was asking what does it do but thanks