Organization

Commands

-----

command_name(space seperated list of strings)

-----

Variables

-----

set(myvar world)

message(STATUS "hello ${myvar})

-----

Comments

Use # for single line comments.

Custom Functions/Macros


function(my_command input output)
  # some comment
  set(${output} ... PARENT_SCOPE)
endfunction()
 
my_command(foo bar)





macro(my_command input output)
  # some comment
endmacro()
my_command(foo bar)



CREATE macros to wrap commands that have output parameters. Otherwise, create functions.


References


https://www.youtube.com/watch?v=bsXLMQ6WgIk