I have a makefile for my project, with which I can pass an argument that controls certain build flags. Now I want to do the same using CMake. I have created CMakeLists.txt but I don't know how to pass the argument and check for the argument value in CMakeLists.txt.
Sample of my Makefile:
ifeq "$(MY_VARIABLE)" "option_value" //setting some flags else //setting some other flag endif I then call make using make MY_VARIABLE=option_value. What is the way in CMake to take the argument from command prompt and set flags based on that?