Add macro to auto init resources of static deps

The actual generation of the macro code is done
in qtutilities
feature/exec_app
Martchus 6 years ago
parent 9087e8da7e
commit 789b9e9184
  1. 6
      cmake/templates/Config.cmake.in
  2. 7
      cmake/templates/config.h.in

@ -35,6 +35,7 @@ set(@META_PROJECT_VARNAME_UPPER@_PRIVATE_KF_MODULES "@KF_MODULES@")
set(@META_PROJECT_VARNAME_UPPER@_PUBLIC_QT_MODULES "@META_PUBLIC_QT_MODULES@")
set(@META_PROJECT_VARNAME_UPPER@_PUBLIC_KF_MODULES "@META_PUBLIC_KF_MODULES@")
set(@META_PROJECT_VARNAME_UPPER@_HAS_QT_TRANSLATION_FILES @APP_SPECIFIC_QT_TRANSLATIONS_AVAILABLE@)
set(@META_PROJECT_VARNAME_UPPER@_QT_RESOURCES @QT_RESOURCES@)
macro(use_@META_PROJECT_VARNAME@)
# make CMake modules of the project available
@ -57,4 +58,9 @@ macro(use_@META_PROJECT_VARNAME@)
if(@META_PROJECT_VARNAME_UPPER@_HAS_QT_TRANSLATION_FILES)
list(APPEND APP_SPECIFIC_QT_TRANSLATION_FILES @META_PROJECT_NAME@)
endif()
# ensure Qt resources of static libs are loaded
if(USE_STATIC_@META_PROJECT_VARNAME_UPPER@ AND @META_PROJECT_VARNAME_UPPER@_QT_RESOURCES)
message(STATUS "Adding ${@META_PROJECT_VARNAME_UPPER@_QT_RESOURCES} to LIBRARIES_QT_RESOURCES for ${META_PROJECT_NAME}.")
list(APPEND LIBRARIES_QT_RESOURCES ${@META_PROJECT_VARNAME_UPPER@_QT_RESOURCES})
endif()
endmacro()

@ -1,8 +1,8 @@
// Created via CMake from template config.h.in
// WARNING! Any changes to this file will be overwritten by the next CMake run!
#ifndef APPLICATION_CONFIG
#define APPLICATION_CONFIG
#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@
@ -13,7 +13,8 @@
#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@}
#define ENABLE_QT_RESOURCES_OF_STATIC_DEPENDENCIES@ENABLE_QT_RESOURCES_OF_STATIC_DEPENDENCIES@
#cmakedefine SVG_SUPPORT
#cmakedefine SVG_ICON_SUPPORT
#endif // APPLICATION_CONFIG
#endif // @META_PROJECT_VARNAME_UPPER@_CONFIG

Loading…
Cancel
Save