How to specify string option
in CMakeLists.txt
? Syntax option(OPT1 "Helpstring" ON)
works perfectly for boolean options but I would like to have few string options like -march=
argument passed to gcc
.
Any user-settable variable can be defined with set:
set(OPT2 "Default" CACHE STRING "Helpstring")
so -march would be something like:
set(ARCH "" CACHE STRING "Architecture to tell gcc to optimize for (-march)")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With