#include <primitives/sw/settings_program_name.h>

#if defined(SW_EXECUTABLE)
EXPORT_FROM_EXECUTABLE
std::string getProgramName()
{
    // this will trigger build error if executable forget to set
    // PackageDefinitions = true;
#ifndef PACKAGE_NAME_CLEAN
#error "Set '.PackageDefinitions = true;' on your target."
#endif
    return PACKAGE_NAME_CLEAN;
}

// use gitrev instead?
EXPORT_FROM_EXECUTABLE
std::string getVersionString()
{
    std::string s;
    s += ::sw::getProgramName();
    s += " version ";
    s += PACKAGE_VERSION;
    s += "\n";
    s += "assembled " __DATE__ " " __TIME__;
    return s;
}
#endif

#include <primitives/sw/settings_program_name.h>

#if defined(SW_EXECUTABLE) && !defined(SW_CUSTOM_PROGRAM_NAME)
EXPORT_FROM_EXECUTABLE
std::string getProgramName()
{
    // this will trigger build error if executable forget to set
    // PackageDefinitions = true;
#ifndef PACKAGE_NAME_CLEAN
#error "Set '.PackageDefinitions = true;' on your target."
#endif
    return PACKAGE_NAME_CLEAN;
}

// use gitrev instead?
EXPORT_FROM_EXECUTABLE
std::string getVersionString()
{
    std::string s;
    s += ::sw::getProgramName();
    s += " version ";
    s += PACKAGE_VERSION;
    s += "\n";
    s += "assembled " __DATE__ " " __TIME__;
    return s;
}
#endif

Allow to define custom program name.
[sw.settings] Allow to define custom program name.
