How to build a program with 2 different values of a variable in CMake
问题 I've recently ported my Qt project from qmake to CMake . My main program contains a value which depends on a #define directive. I want to specify that define directive externally via CMake and build 3 differently named versions of the same executable. How should I do it? I've seen set_target_properties but this only works for libraries and not for executables. For example I want that the following program, int main() { cout << BUILDTYPE << endl; } it's compiled in 3 different flavors (3