0

I am new to CMake tool, so sorry for the stupid question. I am switching to CMake as build system generator for a Cross-Platform project I am working in, and I would like to inject a symbol (that is, something like -Dvar=value) in all targets within my codebase. I need to do this from CMake command line invocation, not using add_definitions(), add_compile_definitions() or target_compile_definitions() CMake commands. Thanks in advance for any help.

fabiop
  • 179
  • 10
  • So you want to pass a compiler option via command line. Have you checked [that question](https://stackoverflow.com/questions/44284275/passing-compiler-options-cmake) about that problem? – Tsyvarev Nov 27 '20 at 10:47
  • My issue is more complex, I am compiling with Android Studio, and i would like to inject my own symbols, together with the CMake variables (including compilation flags) that AS pass to CMake executable – fabiop Nov 27 '20 at 14:43
  • So, what is wrong in `-DCMAKE_CXX_FLAGS=<..>` parameter described in the referenced question? In any case, please add your constraints (e.g. about Android Studio) into the **question post**, so you won't get answers which are definitely not suited for you. – Tsyvarev Nov 27 '20 at 17:28

0 Answers0