Browse Source

Stringify meta data in template

improve/error-messages
Martchus 4 years ago
parent
commit
e57e79f9c9
  1. 8
      cmake/modules/BasicConfig.cmake
  2. 12
      cmake/templates/config.h.in

8
cmake/modules/BasicConfig.cmake

@ -116,14 +116,6 @@ if(APPEND_GIT_REVISION)
endif()
endif()
# stringify the meta data
set(META_PROJECT_NAME_STR "\"${META_PROJECT_NAME}\"")
set(META_APP_NAME_STR "\"${META_APP_NAME}\"")
set(META_APP_AUTHOR_STR "\"${META_APP_AUTHOR}\"")
set(META_APP_URL_STR "\"${META_APP_URL}\"")
set(META_APP_DESCRIPTION_STR "\"${META_APP_DESCRIPTION}\"")
set(META_APP_VERSION_STR "\"${META_APP_VERSION}\"")
# set TARGET_EXECUTABLE which is used to refer to the target executable at its installation location
set(TARGET_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bin/${TARGET_PREFIX}${META_PROJECT_NAME}${TARGET_SUFFIX}")

12
cmake/templates/config.h.in

@ -4,12 +4,12 @@
#ifndef @META_PROJECT_VARNAME_UPPER@_CONFIG
#define @META_PROJECT_VARNAME_UPPER@_CONFIG
#define PROJECT_NAME @META_PROJECT_NAME_STR@
#define APP_NAME @META_APP_NAME_STR@
#define APP_VERSION @META_APP_VERSION_STR@
#define APP_AUTHOR @META_APP_AUTHOR_STR@
#define APP_URL @META_APP_URL_STR@
#define APP_DESCRIPTION @META_APP_DESCRIPTION_STR@
#define PROJECT_NAME "@META_PROJECT_NAME@"
#define APP_NAME "@META_APP_NAME@"
#define APP_VERSION "@META_APP_VERSION@"
#define APP_AUTHOR "@META_APP_AUTHOR@"
#define APP_URL "@META_APP_URL@"
#define APP_DESCRIPTION "@META_APP_DESCRIPTION@"
#define APP_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define QT_TRANSLATION_FILES {@QT_TRANSLATION_FILES_ARRAY@}
#define APP_SPECIFIC_QT_TRANSLATION_FILES {@APP_SPECIFIC_QT_TRANSLATION_FILES_ARRAY@}

Loading…
Cancel
Save