-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
Description
Sometimes it is useful to pass CMake variables into C++ code. The way to do it is to use the CMake configure_file() macro. It takes a *.h.in as input and generate a .h file.
SEMMacroBuildCLI already generate a *CLP.h file. It would be great if we could define pre-processor variables by passing a simple SEMMacroBuildCLI parameter. For example:
in cmake:
SEMMacroBuildCLI( MyCLI PREPROCESSOR MY_CMAKE_VARIABLE ...)
If MY_CMAKE_VARIABLE is True, that would generate in the CLP.h file:
#define MY_CMAKE_VARIABLE
which could then be used in the MyCLI.cxx file:
int main(int argc, char* argv[])
{
PARSE_ARGS
#ifdefined MY_CMAKE_VARIABLE
// do something here
#endif
...
}