chore(cpp): remove STRINGIFY macro
This commit is contained in:
parent
9f9d0a4e87
commit
1cfc9dfd1e
|
@ -28,10 +28,10 @@ qt6_add_qml_module(${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Compile time definitions required by the project
|
# Compile time definitions required by the project
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_NAME=${PROJECT_NAME})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_NAME="${PROJECT_NAME}")
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_DOMAIN=${PROJECT_ORGANIZATION_DOMAIN})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_DOMAIN="${PROJECT_ORGANIZATION_DOMAIN}")
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_NAME=${PROJECT_ORGANIZATION_NAME})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_ORGANIZATION_NAME="${PROJECT_ORGANIZATION_NAME}")
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_APPLICATION_NAME=${PROJECT_APPLICATION_NAME})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_PROJECT_APPLICATION_NAME="${PROJECT_APPLICATION_NAME}")
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_BINARY_DIR=${CMAKE_BINARY_DIR})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_BINARY_DIR=${CMAKE_BINARY_DIR})
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_SOURCE_DIR=${CMAKE_SOURCE_DIR})
|
target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_SOURCE_DIR=${CMAKE_SOURCE_DIR})
|
||||||
|
|
|
@ -25,7 +25,7 @@ int main(int argc, char *argv[])
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
||||||
for (const QString &locale : uiLanguages) {
|
for (const QString &locale : uiLanguages) {
|
||||||
const QString baseName = STRINGIFY(BUILD_PROJECT_NAME) + QLocale(locale).name();
|
const QString baseName = BUILD_PROJECT_NAME + QLocale(locale).name();
|
||||||
if (translator.load(":/i18n/" + baseName)) {
|
if (translator.load(":/i18n/" + baseName)) {
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
break;
|
break;
|
||||||
|
@ -49,13 +49,13 @@ void setApplicationInformation(QGuiApplication& app) {
|
||||||
#if !defined BUILD_PROJECT_ORGANIZATION_NAME
|
#if !defined BUILD_PROJECT_ORGANIZATION_NAME
|
||||||
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_NAME")
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_NAME")
|
||||||
#endif
|
#endif
|
||||||
app.setOrganizationName(STRINGIFY(BUILD_PROJECT_ORGANIZATION_NAME));
|
app.setOrganizationName(BUILD_PROJECT_ORGANIZATION_NAME);
|
||||||
#if !defined BUILD_PROJECT_ORGANIZATION_DOMAIN
|
#if !defined BUILD_PROJECT_ORGANIZATION_DOMAIN
|
||||||
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_DOMAIN")
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_ORGANIZATION_DOMAIN")
|
||||||
#endif
|
#endif
|
||||||
app.setOrganizationDomain(STRINGIFY(BUILD_PROJECT_ORGANIZATION_DOMAIN));
|
app.setOrganizationDomain(BUILD_PROJECT_ORGANIZATION_DOMAIN);
|
||||||
#if !defined BUILD_PROJECT_APPLICATION_NAME
|
#if !defined BUILD_PROJECT_APPLICATION_NAME
|
||||||
static_assert(false, "Compile-time define missing: BUILD_PROJECT_APPLICATION_NAME")
|
static_assert(false, "Compile-time define missing: BUILD_PROJECT_APPLICATION_NAME")
|
||||||
#endif
|
#endif
|
||||||
app.setApplicationName(STRINGIFY(BUILD_PROJECT_APPLICATION_NAME));
|
app.setApplicationName(BUILD_PROJECT_APPLICATION_NAME);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,3 @@ constexpr bool isDebugBuild()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined STRINGIFY
|
|
||||||
#define STRINGIFY(X) STRIFY(X)
|
|
||||||
#define STRIFY(X) #X
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue