I want to change the macro value from the command line using CMakeList.txt
. I have
#ifndef NUMBER
#define NUMBER 1
#endif
and
#ifndef NAME
#define NAME "MyName" //string format
#endif
I found some links -> How to define a C++ preprocessor macro through the command line with CMake?. There they say to add add_definitions(-DNUMBER=5)
in CMake and it is working I can change the value using this way.
I want some way where I can change the value using command-Line. Like
add_definitions(-DNUMBER=NUMBERX)
and from command Line we provide the number cmake NUMBERX=100. and NAMEX="ALEXA".
Or some other way instead add_definitions()
.