cmake65816

Split <INCLUDES> variable in CMAKE_[LANGUAGE]_COMPILE_OBJECT call


I got the following variable

set( CMAKE_CA65816_COMPILE_OBJECT "<CMAKE_CA65816_COMPILER> --cpu 65816 -s -o <OBJECT> <SOURCE> -I <INCLUDES>")

This results in this command

ca65 --cpu 65816 -s -o Game.s.o Game.s -I include_dir1 include_dir2 include_dir3

But i need to repeat the -I parameter multiple times like this.

ca65 --cpu 65816 -s -o Game.s.o Game.s -I include_dir1 -I include_dir2 -I include_dir3

Is it possible to split the <INCLUDES> cmake variable?


Solution

  • There is variable CMAKE_INCLUDE_FLAG_<LANG> which denotes a flag to use with includes. You may also want to set CMAKE_INCLUDE_SYSTEM_FLAG_<LANG> variable to flag used with "system" includes (added with SYSTEM keyword).

    set(CMAKE_INCLUDE_FLAG_CA65816 "-I")
    set(CMAKE_INCLUDE_SYSTEM_FLAG_CA65816 "-Isystem")