Don't built-in icons already provided as fallback
This commit is contained in:
parent
d9380d024e
commit
5531450c0a
|
@ -114,7 +114,7 @@ set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
||||||
set(META_APP_DESCRIPTION "Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models")
|
set(META_APP_DESCRIPTION "Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models")
|
||||||
set(META_VERSION_MAJOR 5)
|
set(META_VERSION_MAJOR 5)
|
||||||
set(META_VERSION_MINOR 1)
|
set(META_VERSION_MINOR 1)
|
||||||
set(META_VERSION_PATCH 0)
|
set(META_VERSION_PATCH 1)
|
||||||
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
||||||
|
|
||||||
# required to include CMake modules from own project directory
|
# required to include CMake modules from own project directory
|
||||||
|
|
|
@ -169,28 +169,38 @@ if(REQUIRED_ICONS)
|
||||||
set(ICON_THEME_PATH "${ICON_SEARCH_PATH}/${ICON_THEME}")
|
set(ICON_THEME_PATH "${ICON_SEARCH_PATH}/${ICON_THEME}")
|
||||||
set(NEW_ICON_THEME_PATH "${ICON_SEARCH_PATH}/${ICON_THEME}")
|
set(NEW_ICON_THEME_PATH "${ICON_SEARCH_PATH}/${ICON_THEME}")
|
||||||
if(IS_DIRECTORY "${ICON_THEME_PATH}")
|
if(IS_DIRECTORY "${ICON_THEME_PATH}")
|
||||||
|
message(STATUS "The specified icon theme \"${ICON_THEME}\" has been located under \"${ICON_THEME_PATH}\" and will be built-in.")
|
||||||
# find index files
|
# find index files
|
||||||
file(GLOB GLOBBED_ICON_THEME_INDEX_FILES LIST_DIRECTORIES false "${ICON_THEME_PATH}/index.theme" "${ICON_THEME_PATH}/icon-theme.cache")
|
if(NOT ICON_THEME STREQUAL FALLBACK_ICON_THEME)
|
||||||
|
file(GLOB GLOBBED_ICON_THEME_INDEX_FILES LIST_DIRECTORIES false "${ICON_THEME_PATH}/index.theme" "${ICON_THEME_PATH}/icon-theme.cache")
|
||||||
|
else()
|
||||||
|
# only index.theme required when icons are provided as fallback anyways
|
||||||
|
file(GLOB GLOBBED_ICON_THEME_INDEX_FILES LIST_DIRECTORIES false "${ICON_THEME_PATH}/index.theme")
|
||||||
|
endif()
|
||||||
# make the first specified built-in the default theme
|
# make the first specified built-in the default theme
|
||||||
if(NOT EXISTS "${DEFAULT_THEME_INDEX_FILE}")
|
if(NOT EXISTS "${DEFAULT_THEME_INDEX_FILE}")
|
||||||
file(MAKE_DIRECTORY "${BUILDIN_ICONS_DIR}/default")
|
file(MAKE_DIRECTORY "${BUILDIN_ICONS_DIR}/default")
|
||||||
file(WRITE "${DEFAULT_THEME_INDEX_FILE}" "[Icon Theme]\nInherits=${NEW_ICON_THEME_NAME}")
|
file(WRITE "${DEFAULT_THEME_INDEX_FILE}" "[Icon Theme]\nInherits=${NEW_ICON_THEME_NAME}")
|
||||||
list(APPEND ICON_THEME_FILES "<file>default/index.theme</file>")
|
list(APPEND ICON_THEME_FILES "<file>default/index.theme</file>")
|
||||||
endif()
|
endif()
|
||||||
# find required icons
|
# find required icons, except the icon theme is provided as fallback anyways
|
||||||
set(GLOB_PATTERNS)
|
if(NOT ICON_THEME STREQUAL FALLBACK_ICON_THEME)
|
||||||
foreach(REQUIRED_ICON ${REQUIRED_ICONS})
|
set(GLOB_PATTERNS)
|
||||||
list(APPEND GLOB_PATTERNS
|
foreach(REQUIRED_ICON ${REQUIRED_ICONS})
|
||||||
"${ICON_THEME_PATH}/${REQUIRED_ICON}"
|
list(APPEND GLOB_PATTERNS
|
||||||
"${ICON_THEME_PATH}/${REQUIRED_ICON}.*"
|
"${ICON_THEME_PATH}/${REQUIRED_ICON}"
|
||||||
"${ICON_THEME_PATH}/*/${REQUIRED_ICON}"
|
"${ICON_THEME_PATH}/${REQUIRED_ICON}.*"
|
||||||
"${ICON_THEME_PATH}/*/${REQUIRED_ICON}.*"
|
"${ICON_THEME_PATH}/*/${REQUIRED_ICON}"
|
||||||
)
|
"${ICON_THEME_PATH}/*/${REQUIRED_ICON}.*"
|
||||||
endforeach()
|
)
|
||||||
file(GLOB_RECURSE GLOBBED_ICON_THEME_FILES LIST_DIRECTORIES false ${GLOB_PATTERNS})
|
endforeach()
|
||||||
|
file(GLOB_RECURSE GLOBBED_ICON_THEME_FILES LIST_DIRECTORIES false ${GLOB_PATTERNS})
|
||||||
|
else()
|
||||||
|
message(STATUS "Icon files for specified theme \"${ICON_THEME}\" are skipped because these are provided as fallback anyways.")
|
||||||
|
set(GLOBBED_ICON_THEME_FILES)
|
||||||
|
endif()
|
||||||
# make temporary copy of required icons and create resource list for Qt
|
# make temporary copy of required icons and create resource list for Qt
|
||||||
foreach(ICON_THEME_FILE ${GLOBBED_ICON_THEME_INDEX_FILES} ${GLOBBED_ICON_THEME_FILES})
|
foreach(ICON_THEME_FILE ${GLOBBED_ICON_THEME_INDEX_FILES} ${GLOBBED_ICON_THEME_FILES})
|
||||||
#message(STATUS "relpath: ${ICON_THEME_FILE_RELATIVE_PATH}, new relpath: ${NEW_ICON_THEME_FILE_RELATIVE_PATH}")
|
|
||||||
# resolve symlinks (use
|
# resolve symlinks (use
|
||||||
if(IS_SYMLINK "${ICON_THEME_FILE}")
|
if(IS_SYMLINK "${ICON_THEME_FILE}")
|
||||||
string(REGEX REPLACE "^${ICON_SEARCH_PATH}/" "" ICON_THEME_FILE_RELATIVE_PATH "${ICON_THEME_FILE}")
|
string(REGEX REPLACE "^${ICON_SEARCH_PATH}/" "" ICON_THEME_FILE_RELATIVE_PATH "${ICON_THEME_FILE}")
|
||||||
|
|
10
global.h
10
global.h
|
@ -14,4 +14,14 @@
|
||||||
# define QT_UTILITIES_IMPORT LIB_IMPORT
|
# define QT_UTILITIES_IMPORT LIB_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \def QT_UTILITIES_EXPORT
|
||||||
|
* \brief Marks the symbol to be exported by the qtutilities library.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \def QT_UTILITIES_IMPORT
|
||||||
|
* \brief Marks the symbol to be imported from the qtutilities library.
|
||||||
|
*/
|
||||||
|
|
||||||
#endif // QT_UTILITIES_GLOBAL
|
#endif // QT_UTILITIES_GLOBAL
|
||||||
|
|
Loading…
Reference in New Issue