I am working on a CMAKE build system that cross compile ARM CortexM4 using Keil ARMCC toolset in Windows
I set the c compiler flags as the following
set(CMAKE_C_FLAGS "-c --c99 --cpu=Cortex-M4.fp.sp --apcs=interwork --split_sections")
However, ARMCC compiler has options that requires to input a destination path and a file name. For instance, for each c source file, besides the object file output, I need to also output the source browser information and source dependence by adding the compiler options with the follow format:
--omf_browse=my_output_path/the_current_source_file.crf and --depend my_output_path/the_current_source_file.d
How can i add the above options to the CMAKE_C_FLAGS?
thanks
The simple method is to set the property
COMPILE_OPTIONS
for each needed source file.Here is the test CMakeLists.txt
The output:
Makefile:
Another way, I think, is to create a custom CMake-toolchain file.