Reputation: 963
I have compile options in list form like:
set(flags "-auto" "-qopenmp" "-convert big_endian")
Then, I add them to the target:
target_compile_options(${lib_name} PRIVATE ${flags})
But when I run "make" the compile options with spaces get quotes added to them:
-auto -qopenmp "-convert big_endian"
And then the compiler doesn't recognize it as a flag.
So, why does CMake add quotes to my compile options? Is there any way I can stop it from doing that?
Upvotes: 0
Views: 1456
Reputation: 963
Found the fix.
Just have to also quote the option to the flag like so:
"-convert" "big_endian"
Upvotes: 1