Page MenuHomePhorge

No OneTemporary

diff --git a/cmake/modules/KDE4Macros.cmake b/cmake/modules/KDE4Macros.cmake
index afdf284228..5a449a88e1 100644
--- a/cmake/modules/KDE4Macros.cmake
+++ b/cmake/modules/KDE4Macros.cmake
@@ -1,1139 +1,758 @@
# for documentation look at FindKDE4Internal.cmake
# this file contains the following macros (or functions):
# KDE4_ADD_UI_FILES
# KDE4_ADD_UI3_FILES
# KDE4_ADD_KCFG_FILES
# _KDE4_SET_CUSTOM_TARGET_PROPERTY
# _KDE4_GET_CUSTOM_TARGET_PROPERTY
# KDE4_ADD_PLUGIN
# KDE4_ADD_KDEINIT_EXECUTABLE
# KDE4_ADD_UNIT_TEST
# KDE4_ADD_EXECUTABLE
# KDE4_ADD_WIDGET_FILES
# KDE4_UPDATE_ICONCACHE
# KDE4_INSTALL_ICONS
# KDE4_REMOVE_OBSOLETE_CMAKE_FILES
# KDE4_CREATE_HANDBOOK
# KDE4_ADD_APP_ICON
# KDE4_CREATE_MANPAGE
# KDE4_CREATE_BASIC_CMAKE_VERSION_FILE (function)
# KDE4_INSTALL_AUTH_HELPER_FILES
# KDE4_AUTH_INSTALL_ACTIONS
# Copyright (c) 2006-2009 Alexander Neundorf, <neundorf@kde.org>
# Copyright (c) 2006, 2007, Laurent Montel, <montel@kde.org>
# Copyright (c) 2007 Matthias Kretz <kretz@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-macro (KDE4_ADD_KCFG_FILES _sources )
- foreach (_current_ARG ${ARGN})
- if( ${_current_ARG} STREQUAL "GENERATE_MOC" )
- set(_kcfg_generatemoc TRUE)
- endif( ${_current_ARG} STREQUAL "GENERATE_MOC" )
-
- if( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" )
- set(_kcfg_relativepath TRUE)
- endif( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" )
- endforeach (_current_ARG ${ARGN})
-
- foreach (_current_FILE ${ARGN})
-
- if(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")
- get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- get_filename_component(_abs_PATH ${_tmp_FILE} PATH)
-
- if (_kcfg_relativepath) # Process relative path only if the option was set
- # Get relative path
- get_filename_component(_rel_PATH ${_current_FILE} PATH)
-
- if (IS_ABSOLUTE ${_rel_PATH})
- # We got an absolute path
- set(_rel_PATH "")
- endif (IS_ABSOLUTE ${_rel_PATH})
- endif (_kcfg_relativepath)
-
- get_filename_component(_basename ${_tmp_FILE} NAME_WE)
- # If we had a relative path and we're asked to use it, then change the basename accordingly
- if(NOT ${_rel_PATH} STREQUAL "")
- set(_basename ${_rel_PATH}/${_basename})
- endif(NOT ${_rel_PATH} STREQUAL "")
-
- file(READ ${_tmp_FILE} _contents)
- string(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2" _kcfg_FILENAME "${_contents}")
- set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
- set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
- set(_moc_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
- set(_kcfg_FILE ${_abs_PATH}/${_kcfg_FILENAME})
- # Maybe the .kcfg is a generated file?
- if(NOT EXISTS "${_kcfg_FILE}")
- set(_kcfg_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_kcfg_FILENAME})
- endif(NOT EXISTS "${_kcfg_FILE}")
- if(NOT EXISTS "${_kcfg_FILE}")
- message(ERROR "${_kcfg_FILENAME} not found; tried in ${_abs_PATH} and ${CMAKE_CURRENT_BINARY_DIR}")
- endif(NOT EXISTS "${_kcfg_FILE}")
-
- # make sure the directory exist in the build directory
- if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}")
- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH})
- endif(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}")
-
-# if (CMAKE_CROSSCOMPILING)
-# set(IMPORT_KCONFIG_COMPILER_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportKConfigCompilerExecutable.cmake" CACHE FILEPATH "Point it to the export file of kconfig_compiler from a native build")
-# include(${IMPORT_KCONFIG_COMPILER_EXECUTABLE})
-# set(KDE4_KCFGC_EXECUTABLE kconfig_compiler)
-# endif (CMAKE_CROSSCOMPILING)
-
- # the command for creating the source file from the kcfg file
- add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}
- COMMAND ${KDE4_KCFGC_EXECUTABLE}
- ARGS ${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}
- MAIN_DEPENDENCY ${_tmp_FILE}
- DEPENDS ${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} )
-
- if(_kcfg_generatemoc)
- qt4_generate_moc(${_header_FILE} ${_moc_FILE} )
- set_source_files_properties(${_src_FILE} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file
- list(APPEND ${_sources} ${_moc_FILE})
- endif(_kcfg_generatemoc)
-
- list(APPEND ${_sources} ${_src_FILE} ${_header_FILE})
- endif(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")
- endforeach (_current_FILE)
-
-endmacro (KDE4_ADD_KCFG_FILES)
-
get_filename_component(KDE4_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-#create the implementation files from the ui files and add them to the list of sources
-#usage: KDE4_ADD_UI_FILES(foo_SRCS ${ui_files})
-macro (KDE4_ADD_UI_FILES _sources )
- foreach (_current_FILE ${ARGN})
-
- get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
- get_filename_component(_basename ${_tmp_FILE} NAME_WE)
- set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h)
-
- # we need to run uic and replace some things in the generated file
- # this is done by executing the cmake script kde4uic.cmake
- add_custom_command(OUTPUT ${_header}
- COMMAND ${CMAKE_COMMAND}
- ARGS
- -DKDE4_HEADER:BOOL=ON
- -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE}
- -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
- -DKDE_UIC_H_FILE:FILEPATH=${_header}
- -DKDE_UIC_BASENAME:STRING=${_basename}
- -P ${KDE4_MODULE_DIR}/kde4uic.cmake
- MAIN_DEPENDENCY ${_tmp_FILE}
- )
- list(APPEND ${_sources} ${_header})
- endforeach (_current_FILE)
-endmacro (KDE4_ADD_UI_FILES)
-
-
macro (_KDE4_SET_CUSTOM_TARGET_PROPERTY _target_name _property_name _property)
string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}")
set(_kde4_${_dir}_${_target_name}_${_property_name} "${_property}")
endmacro (_KDE4_SET_CUSTOM_TARGET_PROPERTY)
macro (_KDE4_GET_CUSTOM_TARGET_PROPERTY _var _target_name _property_name)
string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}")
set(${_var} "${_kde4_${_dir}_${_target_name}_${_property_name}}")
endmacro (_KDE4_GET_CUSTOM_TARGET_PROPERTY)
-macro(KDE4_INSTALL_TS_FILES _lang _sdir)
- file(GLOB_RECURSE _ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_sdir}/*)
- foreach(_current_TS_FILES ${_ts_files})
- string(REGEX MATCH "\\.svn/" _in_svn ${_current_TS_FILES})
- if(NOT _in_svn)
- get_filename_component(_subpath ${_current_TS_FILES} PATH)
- install(FILES ${_current_TS_FILES} DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_SCRIPTS/${_subpath})
- endif(NOT _in_svn)
- endforeach(_current_TS_FILES)
-endmacro(KDE4_INSTALL_TS_FILES)
-
-
macro (KDE4_CREATE_HANDBOOK _docbook)
get_filename_component(_input ${_docbook} ABSOLUTE)
set(_doc ${CMAKE_CURRENT_BINARY_DIR}/index.cache.bz2)
#Bootstrap
if (_kdeBootStrapping)
set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-chunk.xsl")
set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
else (_kdeBootStrapping)
set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-chunk.xsl")
set(_bootstrapOption)
endif (_kdeBootStrapping)
file(GLOB _docs *.docbook)
# if (CMAKE_CROSSCOMPILING)
# set(IMPORT_MEINPROC4_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportMeinProc4Executable.cmake" CACHE FILEPATH "Point it to the export file of meinproc4 from a native build")
# include(${IMPORT_MEINPROC4_EXECUTABLE})
# set(KDE4_MEINPROC_EXECUTABLE meinproc4)
# endif (CMAKE_CROSSCOMPILING)
add_custom_command(OUTPUT ${_doc}
COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} --cache ${_doc} ${_input}
DEPENDS ${_docs} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(_targ "${_targ}-handbook")
add_custom_target(${_targ} ALL DEPENDS ${_doc})
if(KDE4_ENABLE_HTMLHANDBOOK)
set(_htmlDoc ${CMAKE_CURRENT_SOURCE_DIR}/index.html)
add_custom_command(OUTPUT ${_htmlDoc}
COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} -o ${_htmlDoc} ${_input}
DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(htmlhandbook DEPENDS ${_htmlDoc})
endif(KDE4_ENABLE_HTMLHANDBOOK)
set(_args ${ARGN})
set(_installDest)
if(_args)
list(GET _args 0 _tmp)
if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
list(GET _args 1 _installDest )
list(REMOVE_AT _args 0 1)
endif("${_tmp}" STREQUAL "INSTALL_DESTINATION")
endif(_args)
get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
if(_args)
list(GET _args 0 _tmp)
if("${_tmp}" STREQUAL "SUBDIR")
list(GET _args 1 dirname )
list(REMOVE_AT _args 0 1)
endif("${_tmp}" STREQUAL "SUBDIR")
endif(_args)
if(_installDest)
file(GLOB _images *.png)
install(FILES ${_doc} ${_docs} ${_images} DESTINATION ${_installDest}/${dirname})
# TODO symlinks on non-unix platforms
if (UNIX)
# execute some cmake code on make install which creates the symlink
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"${_installDest}/common\" \"\$ENV{DESTDIR}${_installDest}/${dirname}/common\" )" )
endif (UNIX)
endif(_installDest)
endmacro (KDE4_CREATE_HANDBOOK)
macro (KDE4_CREATE_MANPAGE _docbook _section)
get_filename_component(_input ${_docbook} ABSOLUTE)
get_filename_component(_base ${_input} NAME)
string(REGEX REPLACE "\\.${_section}\\.docbook$" "" _base ${_base})
set(_doc ${CMAKE_CURRENT_BINARY_DIR}/${_base}.${_section})
# sometimes we have "man-" prepended
string(REGEX REPLACE "/man-" "/" _outdoc ${_doc})
#Bootstrap
if (_kdeBootStrapping)
set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-include-man.xsl")
set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
else (_kdeBootStrapping)
set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-include-man.xsl")
set(_bootstrapOption)
endif (_kdeBootStrapping)
# if (CMAKE_CROSSCOMPILING)
# set(IMPORT_MEINPROC4_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportMeinProc4Executable.cmake" CACHE FILEPATH "Point it to the export file of meinproc4 from a native build")
# include(${IMPORT_MEINPROC4_EXECUTABLE})
# set(KDE4_MEINPROC_EXECUTABLE meinproc4)
# endif (CMAKE_CROSSCOMPILING)
add_custom_command(OUTPUT ${_outdoc}
COMMAND ${KDE4_MEINPROC_EXECUTABLE} --stylesheet ${_ssheet} --check ${_bootstrapOption} ${_input}
DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
)
get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(_targ "${_targ}-manpage-${_base}")
add_custom_target(${_targ} ALL DEPENDS "${_outdoc}")
set(_args ${ARGN})
set(_installDest)
if(_args)
list(GET _args 0 _tmp)
if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
list(GET _args 1 _installDest )
list(REMOVE_AT _args 0 1)
endif("${_tmp}" STREQUAL "INSTALL_DESTINATION")
endif(_args)
get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
if(_args)
list(GET _args 0 _tmp)
if("${_tmp}" STREQUAL "SUBDIR")
list(GET _args 1 dirname )
list(REMOVE_AT _args 0 1)
endif("${_tmp}" STREQUAL "SUBDIR")
endif(_args)
if(_installDest)
install(FILES ${_outdoc} DESTINATION ${_installDest}/man${_section})
endif(_installDest)
endmacro (KDE4_CREATE_MANPAGE)
-macro (KDE4_UPDATE_ICONCACHE)
- # Update mtime of hicolor icon theme dir.
- # We don't always have touch command (e.g. on Windows), so instead create
- # and delete a temporary file in the theme dir.
- install(CODE "
- set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
- if (NOT DESTDIR_VALUE)
- file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\")
- file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\")
- endif (NOT DESTDIR_VALUE)
- ")
-endmacro (KDE4_UPDATE_ICONCACHE)
-
-# a "map" of short type names to the directories
-# unknown names should give empty results
-# KDE 3 compatibility
-set(_KDE4_ICON_GROUP_mime "mimetypes")
-set(_KDE4_ICON_GROUP_filesys "places")
-set(_KDE4_ICON_GROUP_device "devices")
-set(_KDE4_ICON_GROUP_app "apps")
-set(_KDE4_ICON_GROUP_action "actions")
-# KDE 4 / icon naming specification compatibility
-set(_KDE4_ICON_GROUP_mimetypes "mimetypes")
-set(_KDE4_ICON_GROUP_places "places")
-set(_KDE4_ICON_GROUP_devices "devices")
-set(_KDE4_ICON_GROUP_apps "apps")
-set(_KDE4_ICON_GROUP_actions "actions")
-set(_KDE4_ICON_GROUP_categories "categories")
-set(_KDE4_ICON_GROUP_status "status")
-set(_KDE4_ICON_GROUP_emblems "emblems")
-set(_KDE4_ICON_GROUP_emotes "emotes")
-set(_KDE4_ICON_GROUP_animations "animations")
-set(_KDE4_ICON_GROUP_intl "intl")
-
-# a "map" of short theme names to the theme directory
-set(_KDE4_ICON_THEME_ox "oxygen")
-set(_KDE4_ICON_THEME_cr "crystalsvg")
-set(_KDE4_ICON_THEME_lo "locolor")
-set(_KDE4_ICON_THEME_hi "hicolor")
-
-
-# only used internally by KDE4_INSTALL_ICONS
-macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR)
-
- # if the string doesn't match the pattern, the result is the full string, so all three have the same content
- if (NOT ${_group} STREQUAL ${_install_NAME} )
- set(_icon_GROUP ${_KDE4_ICON_GROUP_${_group}})
- if(NOT _icon_GROUP)
- set(_icon_GROUP "actions")
- endif(NOT _icon_GROUP)
-# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}")
- install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} )
- endif (NOT ${_group} STREQUAL ${_install_NAME} )
-
-endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
-
-
-macro (KDE4_INSTALL_ICONS _defaultpath )
-
- # the l10n-subdir if language given as second argument (localized icon)
- set(_lang ${ARGV1})
- if(_lang)
- set(_l10n_SUBDIR l10n/${_lang})
- else(_lang)
- set(_l10n_SUBDIR ".")
- endif(_lang)
-
- # first the png icons
- file(GLOB _icons *.png)
- foreach (_current_ICON ${_icons} )
- # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
- string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}")
- set(_type "${CMAKE_MATCH_1}")
- set(_size "${CMAKE_MATCH_2}")
- set(_group "${CMAKE_MATCH_3}")
- set(_name "${CMAKE_MATCH_4}")
-
- set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
- if( _theme_GROUP)
- _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
- ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
- ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
- endif( _theme_GROUP)
- endforeach (_current_ICON)
-
- # mng icons
- file(GLOB _icons *.mng)
- foreach (_current_ICON ${_icons} )
- # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
- string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}")
- set(_type "${CMAKE_MATCH_1}")
- set(_size "${CMAKE_MATCH_2}")
- set(_group "${CMAKE_MATCH_3}")
- set(_name "${CMAKE_MATCH_4}")
-
- set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
- if( _theme_GROUP)
- _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
- ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
- ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
- endif( _theme_GROUP)
- endforeach (_current_ICON)
-
- # and now the svg icons
- file(GLOB _icons *.svgz)
- foreach (_current_ICON ${_icons} )
- # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
- string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}")
- set(_type "${CMAKE_MATCH_1}")
- set(_group "${CMAKE_MATCH_2}")
- set(_name "${CMAKE_MATCH_3}")
-
- set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
- if( _theme_GROUP)
- _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
- ${_defaultpath}/${_theme_GROUP}/scalable
- ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
- endif( _theme_GROUP)
- endforeach (_current_ICON)
-
- kde4_update_iconcache()
-
-endmacro (KDE4_INSTALL_ICONS)
-
-
# This macro doesn't set up the RPATH related options for executables anymore,
# since now (wioth cmake 2.6) just the full RPATH is used always for everything.
# It does create wrapper shell scripts for the executables.
# It overrides the defaults set in FindKDE4Internal.cmake.
# For every executable a wrapper script is created, which sets the appropriate
# environment variable for the platform (LD_LIBRARY_PATH on most UNIX systems,
# DYLD_LIBRARY_PATH on OS X and PATH in Windows) so that it points to the built
# but not yet installed versions of the libraries. So if RPATH is disabled, the executables
# can be run via these scripts from the build tree and will find the correct libraries.
# If RPATH is not disabled, these scripts are also used but only for consistency, because
# they don't really influence anything then, because the compiled-in RPATH overrides
# the LD_LIBRARY_PATH env. variable.
macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME)
if (UNIX)
if (APPLE)
set(_library_path_variable "DYLD_LIBRARY_PATH")
elseif (CYGWIN)
set(_library_path_variable "PATH")
else (APPLE)
set(_library_path_variable "LD_LIBRARY_PATH")
endif (APPLE)
if (APPLE)
# DYLD_LIBRARY_PATH does not work like LD_LIBRARY_PATH
# OSX already has the RPATH in libraries and executables, putting runtime directories in
# DYLD_LIBRARY_PATH actually breaks things
set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${KDE4_LIB_DIR}")
else (APPLE)
set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${LIB_INSTALL_DIR}:${KDE4_LIB_DIR}:${QT_LIBRARY_DIR}")
endif (APPLE)
get_target_property(_executable ${_target_NAME} LOCATION )
# use add_custom_target() to have the sh-wrapper generated during build time instead of cmake time
add_custom_command(TARGET ${_target_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
-D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable}
-D_ld_library_path="${_ld_library_path}" -D_executable=${_executable}
-P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake
)
macro_additional_clean_files(${_executable}.shell)
# under UNIX, set the property WRAPPER_SCRIPT to the name of the generated shell script
# so it can be queried and used later on easily
set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}.shell)
else (UNIX)
# under windows, set the property WRAPPER_SCRIPT just to the name of the executable
# maybe later this will change to a generated batch file (for setting the PATH so that the Qt libs are found)
get_target_property(_executable ${_target_NAME} LOCATION )
set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable})
set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}\;${LIB_INSTALL_DIR}\;${KDE4_LIB_DIR}\;${QT_LIBRARY_DIR}")
get_target_property(_executable ${_target_NAME} LOCATION )
# use add_custom_target() to have the batch-file-wrapper generated during build time instead of cmake time
add_custom_command(TARGET ${_target_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
-D_filename="${_executable}.bat"
-D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}"
-P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake
)
endif (UNIX)
endmacro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE)
macro (KDE4_ADD_PLUGIN _target_NAME )
#if the first argument is "WITH_PREFIX" then keep the standard "lib" prefix,
#otherwise set the prefix empty
set(_args ${ARGN})
# default to module
set(_add_lib_param "MODULE")
set(_with_pre FALSE)
foreach(arg ${_args})
if (arg STREQUAL "WITH_PREFIX")
set(_with_pre TRUE)
endif (arg STREQUAL "WITH_PREFIX")
if (arg STREQUAL "STATIC")
set(_add_lib_param STATIC)
endif (arg STREQUAL "STATIC")
if (arg STREQUAL "SHARED")
set(_add_lib_param SHARED)
endif (arg STREQUAL "SHARED")
if (arg STREQUAL "MODULE")
set(_add_lib_param MODULE)
endif (arg STREQUAL "MODULE")
endforeach(arg)
if(_with_pre)
list(REMOVE_ITEM _args "WITH_PREFIX")
endif(_with_pre)
if(_add_lib_param STREQUAL "STATIC")
list(REMOVE_ITEM _args "STATIC")
endif(_add_lib_param STREQUAL "STATIC")
if (_add_lib_param STREQUAL "SHARED")
list(REMOVE_ITEM _args "SHARED")
endif (_add_lib_param STREQUAL "SHARED")
if (_add_lib_param STREQUAL "MODULE")
list(REMOVE_ITEM _args "MODULE")
endif (_add_lib_param STREQUAL "MODULE")
set(_SRCS ${_args})
if("${_add_lib_param}" STREQUAL "STATIC")
add_definitions(-DQT_STATICPLUGIN)
endif("${_add_lib_param}" STREQUAL "STATIC")
add_library(${_target_NAME} ${_add_lib_param} ${_SRCS})
if (NOT _with_pre)
set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
endif (NOT _with_pre)
# for shared libraries/plugins a -DMAKE_target_LIB is required
string(TOUPPER ${_target_NAME} _symbol)
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol})
set(_symbol "MAKE_${_symbol}_LIB")
set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol})
endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
# this macro is intended to check whether a list of source
# files has the "NOGUI" or "RUN_UNINSTALLED" keywords at the beginning
# in _output_LIST the list of source files is returned with the "NOGUI"
# and "RUN_UNINSTALLED" keywords removed
# if "NOGUI" is in the list of files, the _nogui argument is set to
# "NOGUI" (which evaluates to TRUE in cmake), otherwise it is set empty
# (which evaluates to FALSE in cmake)
# "RUN_UNINSTALLED" in the list of files is ignored, it is not necessary anymore
# since KDE 4.2 (with cmake 2.6.2), since then all executables are always built
# with RPATH pointing into the build dir.
# if "TEST" is in the list of files, the _test argument is set to
# "TEST" (which evaluates to TRUE in cmake), otherwise it is set empty
# (which evaluates to FALSE in cmake)
macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _test)
set(${_nogui})
set(${_test})
set(${_output_LIST} ${ARGN})
list(LENGTH ${_output_LIST} count)
list(GET ${_output_LIST} 0 first_PARAM)
set(second_PARAM "NOTFOUND")
if (${count} GREATER 1)
list(GET ${_output_LIST} 1 second_PARAM)
endif (${count} GREATER 1)
set(remove "NOTFOUND")
if (${first_PARAM} STREQUAL "NOGUI")
set(${_nogui} "NOGUI")
set(remove 0)
endif (${first_PARAM} STREQUAL "NOGUI")
if (${first_PARAM} STREQUAL "RUN_UNINSTALLED")
set(remove 0)
endif (${first_PARAM} STREQUAL "RUN_UNINSTALLED")
if (${first_PARAM} STREQUAL "TEST")
set(${_test} "TEST")
set(remove 0)
endif (${first_PARAM} STREQUAL "TEST")
if (${second_PARAM} STREQUAL "NOGUI")
set(${_nogui} "NOGUI")
set(remove 0;1)
endif (${second_PARAM} STREQUAL "NOGUI")
if (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
set(remove 0;1)
endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
if (${second_PARAM} STREQUAL "TEST")
set(${_test} "TEST")
set(remove 0;1)
endif (${second_PARAM} STREQUAL "TEST")
if (NOT "${remove}" STREQUAL "NOTFOUND")
list(REMOVE_AT ${_output_LIST} ${remove})
endif (NOT "${remove}" STREQUAL "NOTFOUND")
endmacro(KDE4_CHECK_EXECUTABLE_PARAMS)
macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )
kde4_check_executable_params(_SRCS _nogui _test ${ARGN})
configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp PROPERTIES SKIP_AUTOMOC TRUE)
# under Windows, build a normal executable and additionally a dummy kdeinit4_foo.lib, whose only purpose on windows is to
# keep the linking logic from the CMakeLists.txt on UNIX working (under UNIX all necessary libs are linked against the kdeinit
# library instead against the executable, under windows we want to have everything in the executable, but for compatibility we have to
# keep the library there-
if(WIN32)
if (MINGW)
list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_res.o _res_position)
else(MINGW)
list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}.rc _res_position)
endif(MINGW)
if(NOT _res_position EQUAL -1)
list(GET _SRCS ${_res_position} _resourcefile)
list(REMOVE_AT _SRCS ${_res_position})
endif(NOT _res_position EQUAL -1)
set(_KDEINIT4_TARGET_NAME_ ${_target_NAME})
string(REGEX REPLACE "[-]" "_" _KDEINIT4_TARGET_NAME_ "${_KDEINIT4_TARGET_NAME_}")
configure_file(${KDE4_MODULE_DIR}/kde4init_win32lib_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp)
add_library(kdeinit_${_target_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp)
kde4_add_executable(${_target_NAME} "${_nogui}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})
set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME})
target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY} kdeinit_${_target_NAME})
else(WIN32)
add_library(kdeinit_${_target_NAME} SHARED ${_SRCS})
set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME})
kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
target_link_libraries(${_target_NAME} kdeinit_${_target_NAME})
endif(WIN32)
endmacro (KDE4_ADD_KDEINIT_EXECUTABLE)
# Add a unit test, which is executed when running make test .
# The targets are always created, but only built for the "all"
# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
# are created but not built by default. You can build them by manually building the target.
# The name of the target can be specified using TESTNAME <testname>, if it is not given
# the macro will default to the <name>
macro (KDE4_ADD_UNIT_TEST _test_NAME)
set(_srcList ${ARGN})
set(_targetName ${_test_NAME})
if( ${ARGV1} STREQUAL "TESTNAME" )
set(_targetName ${ARGV2})
list(REMOVE_AT _srcList 0 1)
endif( ${ARGV1} STREQUAL "TESTNAME" )
set(_nogui)
list(GET ${_srcList} 0 first_PARAM)
if( ${first_PARAM} STREQUAL "NOGUI" )
set(_nogui "NOGUI")
endif( ${first_PARAM} STREQUAL "NOGUI" )
kde4_add_executable( ${_test_NAME} TEST ${_srcList} )
if(NOT KDE4_TEST_OUTPUT)
set(KDE4_TEST_OUTPUT plaintext)
endif(NOT KDE4_TEST_OUTPUT)
set(KDE4_TEST_OUTPUT ${KDE4_TEST_OUTPUT} CACHE STRING "The output to generate when running the QTest unit tests")
set(using_qtest "")
foreach(_filename ${_srcList})
if(NOT using_qtest)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
file(READ ${_filename} file_CONTENT)
string(REGEX MATCH "QTEST_(KDE)?MAIN" using_qtest "${file_CONTENT}")
endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
endif(NOT using_qtest)
endforeach(_filename)
get_target_property( loc ${_test_NAME} LOCATION )
if(WIN32)
if(MSVC_IDE)
STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}" loc "${loc}")
endif()
# .bat because of rpath handling
set(_executable "${loc}.bat")
else(WIN32)
if (Q_WS_MAC AND NOT _nogui)
set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
else (Q_WS_MAC AND NOT _nogui)
# .shell because of rpath handling
set(_executable "${loc}.shell")
endif (Q_WS_MAC AND NOT _nogui)
endif(WIN32)
if (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
#MESSAGE(STATUS "${_targetName} : Using QTestLib, can produce XML report.")
add_test( ${_targetName} ${_executable} -xml -o ${_targetName}.tml)
else (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
#MESSAGE(STATUS "${_targetName} : NOT using QTestLib, can't produce XML report, please use QTestLib to write your unit tests.")
add_test( ${_targetName} ${_executable} )
endif (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
# add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} -xml -o ${_test_NAME}.tml )
if (NOT MSVC_IDE) #not needed for the ide
# if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
if (NOT KDE4_BUILD_TESTS)
get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
if(NOT _buildtestsAdded)
add_custom_target(buildtests)
set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE)
endif(NOT _buildtestsAdded)
add_dependencies(buildtests ${_test_NAME})
endif (NOT KDE4_BUILD_TESTS)
endif (NOT MSVC_IDE)
endmacro (KDE4_ADD_UNIT_TEST)
# add a manifest file to executables.
#
# There is a henn-egg problem when a target runtime part is renamed using
# the OUTPUT_NAME option of cmake's set_target_properties command.
#
# At now the Makefiles rules creating for manifest adding are performed
# *after* the cmake's add_executable command but *before* an optional
# set_target_properties command.
# This means that in KDE4_ADD_MANIFEST the LOCATION property contains
# the unchanged runtime part name of the target. :-(
#
# The recently used workaround is to specify a variable build off the target name followed
# by _OUTPUT_NAME before calling kde4_add_executable as shown in the following example:
#
# set(xyz_OUTPUT_NAME test)
# kde4_add_executable( xyz <source>)
# set_target_properties( xyz PROPERTIES OUTPUT_NAME ${xyz_OUTPUT_NAME} )
#
# The full solution would be to introduce a kde4_target_link_libraries macro and to
# call KDE4_ADD_MANIFEST inside instead of calling in kde4_add_executable.
# This would require patching of *all* places in the KDE sources where target_link_libraries
# is used and to change the related docs.
#
# Because yet I found only 2 locations where this problem occurs (kjs, k3b), the workaround
# seems to be a pragmatically solution.
#
# This macro is an internal macro only used by kde4_add_executable
#
macro (_KDE4_ADD_MANIFEST _target_NAME)
set(x ${_target_NAME}_OUTPUT_NAME)
if (${x})
get_target_property(_var ${_target_NAME} LOCATION )
string(REPLACE "${_target_NAME}" "${${x}}" _executable ${_var})
else(${x})
get_target_property(_executable ${_target_NAME} LOCATION )
endif(${x})
if (_kdeBootStrapping)
set(_cmake_module_path ${CMAKE_SOURCE_DIR}/cmake/modules)
else (_kdeBootStrapping)
set(_cmake_module_path ${KDE4_INSTALL_DIR}/share/apps/cmake/modules)
endif (_kdeBootStrapping)
set(_manifest ${_cmake_module_path}/Win32.Manifest.in)
#message(STATUS ${_executable} ${_manifest})
add_custom_command(
TARGET ${_target_NAME}
POST_BUILD
COMMAND ${KDE4_MT_EXECUTABLE}
ARGS
-manifest ${_manifest}
-updateresource:${_executable}
COMMENT "adding vista trustInfo manifest to ${_target_NAME}"
)
endmacro(_KDE4_ADD_MANIFEST)
macro (KDE4_ADD_EXECUTABLE _target_NAME)
kde4_check_executable_params( _SRCS _nogui _test ${ARGN})
set(_add_executable_param)
# determine additional parameters for add_executable()
# for GUI apps, create a bundle on OSX
if (Q_WS_MAC)
set(_add_executable_param MACOSX_BUNDLE)
endif (Q_WS_MAC)
# for GUI apps, this disables the additional console under Windows
if (WIN32)
set(_add_executable_param WIN32)
endif (WIN32)
if (_nogui)
set(_add_executable_param)
endif (_nogui)
if (_test AND NOT KDE4_BUILD_TESTS)
set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL)
endif (_test AND NOT KDE4_BUILD_TESTS)
add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS})
IF (KDE4_ENABLE_UAC_MANIFEST)
_kde4_add_manifest(${_target_NAME})
ENDIF(KDE4_ENABLE_UAC_MANIFEST)
if (_test)
set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}/\\"")
endif (_test)
kde4_handle_rpath_for_executable(${_target_NAME})
if (WIN32)
target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY})
endif (WIN32)
endmacro (KDE4_ADD_EXECUTABLE)
include(GenerateExportHeader)
macro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE)
set(_first_SRC ${_lib_TYPE})
set(_add_lib_param)
if (${_lib_TYPE} STREQUAL "STATIC")
set(_first_SRC)
set(_add_lib_param STATIC)
endif (${_lib_TYPE} STREQUAL "STATIC")
if (${_lib_TYPE} STREQUAL "SHARED")
set(_first_SRC)
set(_add_lib_param SHARED)
endif (${_lib_TYPE} STREQUAL "SHARED")
if (${_lib_TYPE} STREQUAL "MODULE")
set(_first_SRC)
set(_add_lib_param MODULE)
endif (${_lib_TYPE} STREQUAL "MODULE")
set(_SRCS ${_first_SRC} ${ARGN})
add_library(${_target_NAME} ${_add_lib_param} ${_SRCS})
# for shared libraries a -DMAKE_target_LIB is required
string(TOUPPER ${_target_NAME} _symbol)
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol})
set(_symbol "MAKE_${_symbol}_LIB")
set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol})
endmacro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE)
macro(kf5_add_library _target_NAME _lib_TYPE)
kde4_add_library(${_target_NAME} ${_lib_TYPE} ${ARGN})
generate_export_header(${_target_NAME})
endmacro()
-macro (KDE4_ADD_WIDGET_FILES _sources)
- foreach (_current_FILE ${ARGN})
-
- get_filename_component(_input ${_current_FILE} ABSOLUTE)
- get_filename_component(_basename ${_input} NAME_WE)
- set(_source ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.cpp)
- set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.moc)
-
- # create source file from the .widgets file
- add_custom_command(OUTPUT ${_source}
- COMMAND ${KDE4_MAKEKDEWIDGETS_EXECUTABLE}
- ARGS -o ${_source} ${_input}
- MAIN_DEPENDENCY ${_input} DEPENDS ${_KDE4_MAKEKDEWIDGETS_DEP})
-
- # create moc file
- qt4_generate_moc(${_source} ${_moc} )
-
- list(APPEND ${_sources} ${_source} ${_moc})
-
- endforeach (_current_FILE)
-
-endmacro (KDE4_ADD_WIDGET_FILES)
-
-
macro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
# the files listed here will be removed by remove_obsoleted_cmake_files.cmake, Alex
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake )
set(module_install_dir ${DATA_INSTALL_DIR}/cmake/modules )
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "#generated by cmake, dont edit\n\n")
foreach ( _current_FILE ${ARGN})
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "message(STATUS \"Removing ${module_install_dir}/${_current_FILE}\" )\n" )
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "exec_program( ${CMAKE_COMMAND} ARGS -E remove ${module_install_dir}/${_current_FILE} OUTPUT_VARIABLE _dummy)\n" )
endforeach ( _current_FILE)
endmacro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
macro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
string(TOUPPER ${_libName} _libNameUpperCase)
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _libNameUpperCase ${_libNameUpperCase})
# the next line is is required, because in CMake arguments to macros are not real
# variables, but handled differently. The next line create a real CMake variable,
# so configure_file() will replace it correctly.
set(_libName ${_libName})
# compared to write(FILE) configure_file() only really writes the file if the
# contents have changed. Otherwise we would have a lot of recompiles.
configure_file(${KDE4_MODULE_DIR}/kde4exportsheader.h.in ${_outputFile})
endmacro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
macro (KDE4_CREATE_HTML_HANDBOOK _docbook)
message(STATUS "KDE4_CREATE_HTML_HANDBOOK() is deprecated. Enable the option KDE4_ENABLE_HTMLHANDBOOK instead, this will give you targets htmlhandbook for creating the html help.")
endmacro (KDE4_CREATE_HTML_HANDBOOK)
-# adds application icon to target source list
-# 'appsources' - the sources of the application
-# 'pngfiles' - specifies the list of icon files
-# example: KDE4_ADD_WIN32_APP_ICON(myapp_SRCS "pics/cr16-myapp.png;pics/cr32-myapp.png")
-macro (KDE4_ADD_WIN32_APP_ICON appsources)
- message(STATUS "KDE4_ADD_WIN32_APP_ICON() is deprecated, use KDE4_ADD_APP_ICON() instead")
- if (WIN32)
- if(NOT WINCE)
- find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
- else(NOT WINCE)
- find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
- endif(NOT WINCE)
- string(REPLACE _SRCS "" appname ${appsources})
- if (PNG2ICO_EXECUTABLE)
- set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appname})
-
- # png2ico is found by the above find_program
-# message("png2ico ${_outfilename}.ico ${ARGN}")
- exec_program(png2ico ARGS ${_outfilename}.ico ${ARGN})
-
- # now make rc file for adding it to the sources
- file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
- list(APPEND ${appsources} ${CMAKE_CURRENT_BINARY_DIR}/${appname}.rc)
- endif(PNG2ICO_EXECUTABLE)
- endif(WIN32)
-endmacro (KDE4_ADD_WIN32_APP_ICON)
-
-# adds application icon to target source list
-# for detailed documentation see the top of FindKDE4Internal.cmake
-macro (KDE4_ADD_APP_ICON appsources pattern)
- set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appsources})
-
- if (WIN32)
- if(NOT WINCE)
- find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
- else(NOT WINCE)
- find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
- endif(NOT WINCE)
- if (PNG2ICO_EXECUTABLE)
- string(REPLACE "*" "(.*)" pattern_rx "${pattern}")
- file(GLOB files "${pattern}")
- foreach (it ${files})
- string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}")
- if (fn MATCHES ".*16.*" )
- list (APPEND _icons ${it})
- endif (fn MATCHES ".*16.*")
- if (fn MATCHES ".*32.*" )
- list (APPEND _icons ${it})
- endif (fn MATCHES ".*32.*")
- if (fn MATCHES ".*48.*" )
- list (APPEND _icons ${it})
- endif (fn MATCHES ".*48.*")
- if (fn MATCHES ".*64.*" )
- list (APPEND _icons ${it})
- endif (fn MATCHES ".*64.*")
- if (fn MATCHES ".*128.*" )
- list (APPEND _icons ${it})
- endif (fn MATCHES ".*128.*")
- endforeach (it)
- if (_icons)
- add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc
- COMMAND ${PNG2ICO_EXECUTABLE} ARGS --rcfile ${_outfilename}.rc ${_outfilename}.ico ${_icons}
- DEPENDS ${PNG2ICO_EXECUTABLE} ${_icons}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
- list(APPEND ${appsources} ${_outfilename}.rc)
- else(_icons)
- message(STATUS "Unable to find a related icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
- endif(_icons)
- else(PNG2ICO_EXECUTABLE)
- message(STATUS "Unable to find the png2ico utility - application will not have an application icon!")
- endif(PNG2ICO_EXECUTABLE)
- endif(WIN32)
- if (Q_WS_MAC)
- # first convert image to a tiff using the Mac OS X "sips" utility,
- # then use tiff2icns to convert to an icon
- find_program(SIPS_EXECUTABLE NAMES sips)
- find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns)
- if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
- file(GLOB_RECURSE files "${pattern}")
- # we can only test for the 128-icon like that - we don't use patterns anymore
- foreach (it ${files})
- if (it MATCHES ".*128.*" )
- set (_icon ${it})
- endif (it MATCHES ".*128.*")
- endforeach (it)
-
- if (_icon)
-
- # first, get the basename of our app icon
- add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff
- COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff
- COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns
- DEPENDS ${_icon}
- )
-
- # This will register the icon into the bundle
- set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
-
- # Append the icns file to the sources list so it will be a dependency to the
- # main target
- list(APPEND ${appsources} ${_outfilename}.icns)
-
- # Install the icon into the Resources dir in the bundle
- set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
-
- else(_icon)
- # TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
- message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
- endif(_icon)
-
- else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
- message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
- endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
- endif(Q_WS_MAC)
-endmacro (KDE4_ADD_APP_ICON)
-
-
# This macro is only kept around for compatibility, it is not needed/used anymore
# since CMake 2.6.0. With CMake 2.6.0 it is not necessary anymore link libraries again
# ("relink") to change their RPATH. Since this is fast now, they are now always built with
# full RPATH.
# Still keep this macro here, since somebody might use it and so that would break
# if we would just remove it from here.
# What it does now it sets the target properties of the given target the same way as
# they were set by the old version of the macro with the option FULL_RPATH enabled.
# This one may be a candidate for removal. Alex
macro (KDE4_HANDLE_RPATH_FOR_LIBRARY _target_NAME)
message(STATUS "You are using the macro KDE4_HANDLE_RPATH_FOR_LIBRARY(), which is an internal macro and shouldn't be used by external projects. Please remove it.")
if (NOT CMAKE_SKIP_RPATH)
set_target_properties(${_target_NAME} PROPERTIES SKIP_BUILD_RPATH FALSE BUILD_WITH_INSTALL_RPATH FALSE)
endif (NOT CMAKE_SKIP_RPATH)
endmacro (KDE4_HANDLE_RPATH_FOR_LIBRARY)
# This macro adds the needed files for an helper executable meant to be used by applications using KAuth.
# It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on.
# This macro takes care of generate the needed files, and install them in the right location. This boils down
# to a DBus policy to let the helper register on the system bus, and a service file for letting the helper
# being automatically activated by the system bus.
# *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work.
function(KDE4_INSTALL_AUTH_HELPER_FILES HELPER_TARGET HELPER_ID HELPER_USER)
if(KDE4_AUTH_HELPER_BACKEND_NAME STREQUAL "DBUS")
if (_kdeBootStrapping)
set(_stubFilesDir ${CMAKE_SOURCE_DIR}/kdecore/auth/backends/dbus/ )
else (_kdeBootStrapping)
set(_stubFilesDir ${KDE4_DATA_INSTALL_DIR}/kauth/ )
endif (_kdeBootStrapping)
configure_file(${_stubFilesDir}/dbus_policy.stub
${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf
DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
configure_file(${_stubFilesDir}/dbus_service.stub
${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service
DESTINATION ${DBUS_SYSTEM_SERVICES_INSTALL_DIR})
endif(KDE4_AUTH_HELPER_BACKEND_NAME STREQUAL "DBUS")
endfunction(KDE4_INSTALL_AUTH_HELPER_FILES)
# This macro generates an action file, depending on the backend used, for applications using KAuth.
# It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example
# for file format). The macro will take care of generating the file according to the backend specified,
# and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy
# file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/),
# and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during
# the install phase
function(KDE4_INSTALL_AUTH_ACTIONS HELPER_ID ACTIONS_FILE)
if(KDE4_AUTH_BACKEND_NAME STREQUAL "APPLE")
install(CODE "execute_process(COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT" OR KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy)
get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE)
add_custom_command(OUTPUT ${_output}
COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${_input} > ${_output}
MAIN_DEPENDENCY ${_input}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating ${HELPER_ID}.policy"
DEPENDS ${_KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP})
add_custom_target("actions for ${HELPER_ID}" ALL DEPENDS ${_output})
install(FILES ${_output} DESTINATION ${KDE4_AUTH_POLICY_FILES_INSTALL_DIR})
endif()
endfunction(KDE4_INSTALL_AUTH_ACTIONS)
# TODO: Move this to kde4support
if (_kdeBootStrapping)
include("${CMAKE_SOURCE_DIR}/kdecore/KDECoreMacros.cmake")
+ include("${CMAKE_SOURCE_DIR}/kdeui/KDEUIMacros.cmake")
include("${CMAKE_SOURCE_DIR}/kde3support/KDE3SupportMacros.cmake")
else()
include("${KDE4_MODULE_DIR}/KDECoreMacros.cmake")
+ include("${KDE4_MODULE_DIR}/KDEUIMacros.cmake")
include("${KDE4_MODULE_DIR}/KDE3SupportMacros.cmake")
endif()
macro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES _append_or_write _filename)
message(FATAL_ERROR "_KDE4_EXPORT_LIBRARY_DEPENDENCIES() was an internal macro and has been removed again. Just remove the code which calls it, there is no substitute.")
endmacro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES)
macro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
message(FATAL_ERROR "_KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.")
endmacro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES)
macro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
message(FATAL_ERROR "KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.")
endmacro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
macro (KDE4_INSTALL_HANDBOOK _lang)
message(STATUS "KDE4_INSTALL_HANDBOOK() is deprecated. Remove it please. Now all is done in KDE4_CREATE_HANDBOOK.")
endmacro (KDE4_INSTALL_HANDBOOK )
macro (KDE4_SET_CUSTOM_TARGET_PROPERTY)
message(FATAL_ERROR "KDE4_SET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead")
endmacro (KDE4_SET_CUSTOM_TARGET_PROPERTY)
macro (KDE4_GET_CUSTOM_TARGET_PROPERTY)
message(FATAL_ERROR "KDE4_GET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead")
endmacro (KDE4_GET_CUSTOM_TARGET_PROPERTY)
diff --git a/kdeui/CMakeLists.txt b/kdeui/CMakeLists.txt
index ca84aef3e8..18521f6650 100644
--- a/kdeui/CMakeLists.txt
+++ b/kdeui/CMakeLists.txt
@@ -1,731 +1,735 @@
project(kdeui)
#set(KDEUI_NO_ATTICA FALSE)
#if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
# set(KDEUI_NO_ATTICA TRUE)
#endif(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
# TODO QT5 Make the above work and port it to whatever parts of QtGui actually need attica.
set(KDEUI_NO_ATTICA TRUE)
include_directories(
${CMAKE_SOURCE_DIR}/interfaces
${CMAKE_SOURCE_DIR}/interfaces/kregexpeditor
${CMAKE_BINARY_DIR}/tier2/sonnet/core
${CMAKE_SOURCE_DIR}/tier2/sonnet/core
${CMAKE_BINARY_DIR}/tier1/itemmodels/src
${CMAKE_SOURCE_DIR}/tier1/itemmodels/src
${CMAKE_BINARY_DIR}/tier1/kauth/src/
${CMAKE_SOURCE_DIR}/tier1/kauth/src/
${kcoreaddons_BINARY_DIR}/src
${kcoreaddons_SOURCE_DIR}/src/caching
${kcoreaddons_SOURCE_DIR}/src/io
${kcoreaddons_SOURCE_DIR}/src/jobs
${kcoreaddons_SOURCE_DIR}/src/text
${kcoreaddons_SOURCE_DIR}/src/kernel
${kcoreaddons_SOURCE_DIR}/src/randomness
${CMAKE_SOURCE_DIR}/kdeui
${KDE4_KDECORE_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/actions
${CMAKE_CURRENT_SOURCE_DIR}/colors
${CMAKE_CURRENT_SOURCE_DIR}/config
${CMAKE_CURRENT_SOURCE_DIR}/dialogs
${CMAKE_CURRENT_SOURCE_DIR}/findreplace
${CMAKE_CURRENT_SOURCE_DIR}/fonts
${CMAKE_CURRENT_SOURCE_DIR}/icons
${CMAKE_CURRENT_SOURCE_DIR}/itemviews
${CMAKE_CURRENT_SOURCE_DIR}/jobs
${CMAKE_CURRENT_SOURCE_DIR}/kernel
${CMAKE_CURRENT_SOURCE_DIR}/notifications
${CMAKE_CURRENT_SOURCE_DIR}/paged
${CMAKE_CURRENT_SOURCE_DIR}/shortcuts
${CMAKE_CURRENT_SOURCE_DIR}/sonnet
${CMAKE_CURRENT_SOURCE_DIR}/util
${CMAKE_CURRENT_SOURCE_DIR}/widgets
${CMAKE_CURRENT_SOURCE_DIR}/windowmanagement
${CMAKE_CURRENT_SOURCE_DIR}/xmlgui
${CMAKE_CURRENT_BINARY_DIR}/util
${DBUSMENUQT_INCLUDE_DIR}
)
if(NOT KDEUI_NO_ATTICA)
include_directories( ${LIBATTICA_INCLUDE_DIR} )
set(KDEUI_EXTRA_LIBS ${KDEUI_EXTRA_LIBS} ${LIBATTICA_LIBRARIES} )
set(HAVE_ATTICA TRUE)
endif(NOT KDEUI_NO_ATTICA)
macro_bool_to_01(HAVE_ATTICA)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/kaboutapplicationconfigattica_p.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/dialogs/kaboutapplicationconfigattica_p.h
)
set(HAVE_KSECRETSSERVICE 0)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/util/config-kwallet.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/util/config-kwallet.h
)
add_subdirectory( about )
add_subdirectory( tests )
add_subdirectory( sonnet/tests )
########### next target ###############
set(kdeui_LIB_SRCS
actions/kactioncollection.cpp
actions/kactioncategory.cpp
actions/kaction.cpp
actions/kactionmenu.cpp
actions/kcodecaction.cpp
actions/kdualaction.cpp
actions/kfontaction.cpp
actions/kfontsizeaction.cpp
actions/kpastetextaction.cpp
actions/krecentfilesaction.cpp
actions/kselectaction.cpp
actions/kstandardaction.cpp
actions/ktoggleaction.cpp
actions/ktoggletoolbaraction.cpp
actions/ktogglefullscreenaction.cpp
actions/ktoolbarlabelaction.cpp
actions/ktoolbarpopupaction.cpp
actions/ktoolbarspaceraction.cpp
colors/kcolorspaces.cpp
colors/kcolorutils.cpp
colors/kcolorscheme.cpp
colors/kcolorcollection.cpp
colors/kcolorhelpers.cpp
colors/kcolorbutton.cpp
colors/kcolorcombo.cpp
colors/kcolorchoosermode.cpp
colors/kcolordialog.cpp
colors/kcolormimedata.cpp
colors/kcolorvalueselector.cpp
colors/khuesaturationselect.cpp
config/kconfigskeleton.cpp
config/kconfiggroupgui.cpp
dialogs/kaboutkdedialog_p.cpp
dialogs/kassistantdialog.cpp
dialogs/kconfigdialog.cpp
dialogs/kconfigdialogmanager.cpp
dialogs/kbugreport.cpp
dialogs/kdialog.cpp
dialogs/kedittoolbar.cpp
dialogs/kinputdialog.cpp
dialogs/klinkdialog.cpp
dialogs/kmessagebox.cpp
dialogs/kmessageboxmessagehandler.cpp
dialogs/kaboutapplicationdialog.cpp
dialogs/kaboutapplicationpersonmodel_p.cpp
dialogs/kaboutapplicationpersonlistdelegate_p.cpp
dialogs/kaboutapplicationpersonlistview_p.cpp
dialogs/knewpassworddialog.cpp
dialogs/kpassworddialog.cpp
dialogs/kpixmapregionselectordialog.cpp
dialogs/kprogressdialog.cpp
dialogs/kshortcuteditwidget.cpp
dialogs/kshortcutseditordelegate.cpp
dialogs/kshortcutseditoritem.cpp
dialogs/kshortcutseditor.cpp
dialogs/kshortcutschemeseditor.cpp
dialogs/kshortcutsdialog.cpp
dialogs/ksplashscreen.cpp
dialogs/kswitchlanguagedialog_p.cpp
dialogs/ktip.cpp
findreplace/kfind.cpp
findreplace/kreplace.cpp
findreplace/kfinddialog.cpp
findreplace/kreplacedialog.cpp
fonts/fonthelpers.cpp
fonts/kfontchooser.cpp
fonts/kfontcombobox.cpp
fonts/kfontdialog.cpp
fonts/kfontrequester.cpp
fonts/kfontutils.cpp
icons/kiconbutton.cpp
icons/kicondialog.cpp
icons/kiconeffect.cpp
icons/kiconengine.cpp
icons/kicon.cpp
icons/kiconloader.cpp
icons/kicontheme.cpp
icons/kiconcache.cpp
itemviews/klistwidget.cpp
itemviews/kconfigviewstatesaver.cpp
itemviews/klistwidgetsearchline.cpp
itemviews/ktreewidgetsearchline.cpp
itemviews/kviewstatemaintainer.cpp
itemviews/kfilterproxysearchline.cpp
itemviews/kextendableitemdelegate.cpp
itemviews/kcategorizedsortfilterproxymodel.cpp
itemviews/kcategorizedview.cpp
itemviews/kcategorydrawer.cpp
itemviews/kwidgetitemdelegate.cpp
itemviews/kwidgetitemdelegatepool.cpp
# This requires patches which are not yet in Qt. Disabled for now.
# itemviews/kreparentingproxymodel.cpp
jobs/kdialogjobuidelegate.cpp
jobs/kabstractwidgetjobtracker.cpp
jobs/kwidgetjobtracker.cpp
jobs/kstatusbarjobtracker.cpp
jobs/kuiserverjobtracker.cpp
kernel/kapplication.cpp
kernel/kclipboard.cpp
kernel/kuniqueapplication.cpp
kernel/ksessionmanager.cpp
kernel/kstyle.cpp
kernel/kstartupinfo.cpp
kernel/kglobalsettings.cpp
kernel/ksystemeventfilter.cpp
notifications/knotification.cpp
notifications/knotificationmanager.cpp
notifications/knotificationrestrictions.cpp
paged/kpagedialog.cpp
paged/kpagemodel.cpp
paged/kpageview.cpp
paged/kpageview_p.cpp
paged/kpagewidget.cpp
paged/kpagewidgetmodel.cpp
shortcuts/kshortcut.cpp
shortcuts/kshortcutschemeshelper.cpp
shortcuts/kstandardshortcut.cpp
shortcuts/kglobalaccel.cpp
shortcuts/kglobalshortcutinfo.cpp
shortcuts/kglobalshortcutinfo_dbus.cpp
shortcuts/kacceleratormanager.cpp
shortcuts/kcheckaccelerators.cpp
shortcuts/kgesture.cpp
shortcuts/kgesturemap.cpp
sonnet/dialog.cpp
sonnet/configwidget.cpp
sonnet/highlighter.cpp
sonnet/configdialog.cpp
sonnet/dictionarycombobox.cpp
util/kckey.cpp
util/kcompletion.cpp
util/kcompletionbase.cpp
util/kcrash.cpp
util/kcursor.cpp
util/kguiitem.cpp
util/kimagecache.cpp
util/kkeyserver.cpp
util/kmanagerselection.cpp
util/kmodifierkeyinfo.cpp
util/kmodifierkeyinfoprovider.cpp
util/knumvalidator.cpp
util/kpassivepopup.cpp
util/kpassivepopupmessagehandler.cpp
util/kpixmapcache.cpp
util/kpixmapprovider.cpp
util/kstandardguiitem.cpp
util/kwordwrap.cpp
util/kxerrorhandler.cpp
util/kxmessages.cpp
util/kxutils.cpp
util/kundostack.cpp
util/kpixmapsequence.cpp
util/kpixmapsequenceoverlaypainter.cpp
util/kpixmapsequencewidget.cpp
widgets/kactionselector.cpp
widgets/kanimatedbutton.cpp
widgets/kdialogbuttonbox.cpp
widgets/kbuttongroup.cpp
widgets/kcapacitybar.cpp
widgets/kcharselect.cpp
widgets/kcharselectdata.cpp
widgets/kcmodule.cpp
widgets/kcombobox.cpp
widgets/kcompletionbox.cpp
widgets/kdatecombobox.cpp
widgets/kdatepicker.cpp
widgets/kdatetable.cpp
widgets/kdatetimeedit.cpp
widgets/kdatetimewidget.cpp
widgets/kdatewidget.cpp
widgets/keditlistwidget.cpp
widgets/kfadewidgeteffect.cpp
widgets/khbox.cpp
widgets/khelpmenu.cpp
widgets/khistorycombobox.cpp
widgets/kkeysequencewidget.cpp
widgets/klanguagebutton.cpp
widgets/kled.cpp
widgets/klineedit.cpp
widgets/kmainwindow.cpp
widgets/kmenu.cpp
widgets/kmenubar.cpp
widgets/kmessagewidget.cpp
widgets/kmultitabbar.cpp
widgets/knuminput.cpp
widgets/kpixmapregionselectorwidget.cpp
widgets/kpushbutton.cpp
widgets/kratingpainter.cpp
widgets/kratingwidget.cpp
widgets/krestrictedline.cpp
widgets/krichtextedit.cpp
widgets/krichtextwidget.cpp
widgets/kruler.cpp
widgets/kselector.cpp
widgets/kseparator.cpp
widgets/kshortcutwidget.cpp
widgets/ksqueezedtextlabel.cpp
widgets/kstatusbar.cpp
widgets/kstringvalidator.cpp
widgets/ktabbar.cpp
widgets/ktabwidget.cpp
widgets/ktextbrowser.cpp
widgets/ktextedit.cpp
widgets/ktimecombobox.cpp
widgets/ktimezonewidget.cpp
widgets/ktitlewidget.cpp
widgets/ktoolbar.cpp
widgets/kurllabel.cpp
widgets/kvbox.cpp
widgets/kxyselector.cpp
widgets/kdeuiwidgetsproxystyle.cpp
widgets/nestedlisthelper.cpp
xmlgui/kxmlguibuilder.cpp
xmlgui/kxmlguiwindow.cpp
xmlgui/kmainwindowiface.cpp
xmlgui/kmenumenuhandler_p.cpp
xmlgui/ktoolbarhandler.cpp
xmlgui/kxmlguiclient.cpp
xmlgui/kxmlguifactory.cpp
xmlgui/kxmlguifactory_p.cpp
xmlgui/kxmlguiversionhandler.cpp
)
if(NOT KDE_NO_DEPRECATED)
set(kdeui_LIB_SRCS
${kdeui_LIB_SRCS}
widgets/karrowbutton.cpp
widgets/keditlistbox.cpp
)
endif(NOT KDE_NO_DEPRECATED)
option(MAC_USE_OSXKEYCHAIN "On OS X, use the keychain as backend for kwallet, instead of kwalletd.")
if (Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
FIND_LIBRARY(SECURITY_LIBRARY Security)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet_mac.cpp)
else(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet.cpp)
else(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kwallet.cpp)
endif(Q_WS_MAC AND MAC_USE_OSXKEYCHAIN)
if(NOT WINCE)
set(kdeui_LIB_SRCS
${kdeui_LIB_SRCS}
dialogs/kdeprintdialog.cpp
notifications/kstatusnotifieritem.cpp
notifications/kstatusnotifieritemdbus_p.cpp
notifications/ksystemtrayicon.cpp
)
endif(NOT WINCE)
if (Q_WS_X11)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kkeyserver_x11.cpp
dialogs/kcupsoptionswidget_p.cpp
dialogs/kcupsoptionsjobwidget_p.cpp
dialogs/kcupsoptionspageswidget_p.cpp
dialogs/kcupsoptionssettingswidget_p.cpp )
endif (Q_WS_X11)
if (Q_WS_MAC)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kkeyserver_mac.cpp )
endif (Q_WS_MAC)
if (Q_WS_WIN)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} kernel/kapplication_win.cpp util/kkeyserver_win.cpp )
endif (Q_WS_WIN)
if (Q_WS_X11)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_x11.cpp
windowmanagement/kwindowinfo_x11.cpp
windowmanagement/netwm.cpp )
endif (Q_WS_X11)
if (Q_WS_MAC)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_mac.cpp
windowmanagement/kwindowinfo_mac.cpp)
endif (Q_WS_MAC)
if (Q_WS_WIN)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_win.cpp
windowmanagement/kwindowinfo_win.cpp)
endif (Q_WS_WIN)
if (Q_WS_QWS)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} windowmanagement/kwindowsystem_qws.cpp)
endif (Q_WS_QWS)
if (Q_WS_X11 AND X11_Xkb_FOUND)
include_directories (
${X11_Xkb_INCLUDE_PATH}
${X11_Xlib_INCLUDE_PATH}
)
set(kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kmodifierkeyinfoprovider_x11.cpp)
else (Q_WS_X11 AND X11_Xkb_FOUND)
set (kdeui_LIB_SRCS ${kdeui_LIB_SRCS} util/kmodifierkeyinfoprovider_dummy.cpp)
endif (Q_WS_X11 AND X11_Xkb_FOUND)
set( kdeui_UI
dialogs/kpassworddialog.ui
dialogs/knewpassworddialog.ui
dialogs/kshortcutsdialog.ui
widgets/kdatetimeedit.ui
widgets/kshortcutwidget.ui
sonnet/sonnetui.ui
sonnet/configui.ui
)
if (Q_WS_X11)
set( kdeui_UI ${kdeui_UI} dialogs/kcupsoptionspageswidget.ui
dialogs/kcupsoptionsjobwidget.ui
)
endif (Q_WS_X11)
kde4_add_ui_files(kdeui_LIB_SRCS ${kdeui_UI} )
set(kwallet_xml util/org.kde.KWallet.xml)
install(FILES ${kwallet_xml} DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
qt4_add_dbus_interface( kdeui_LIB_SRCS ${kwallet_xml} kwallet_interface )
qt4_add_dbus_interfaces(kdeui_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/jobs/org.kde.JobViewServer.xml )
qt4_add_dbus_interface(kdeui_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/jobs/org.kde.JobView.xml jobviewiface )
qt4_add_dbus_interface(kdeui_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/jobs/org.kde.JobViewV2.xml jobviewifacev2 )
set(statusnotifierwatcher_xml ${CMAKE_CURRENT_SOURCE_DIR}/notifications/org.kde.StatusNotifierWatcher.xml)
qt4_add_dbus_interface(kdeui_LIB_SRCS ${statusnotifierwatcher_xml} statusnotifierwatcher_interface)
set(notifications_xml ${CMAKE_CURRENT_SOURCE_DIR}/notifications/org.freedesktop.Notifications.xml)
qt4_add_dbus_interface(kdeui_LIB_SRCS ${notifications_xml} notifications_interface)
if(NOT WINCE)
qt4_add_dbus_adaptor(kdeui_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/notifications/org.kde.StatusNotifierItem.xml
${CMAKE_CURRENT_SOURCE_DIR}/notifications/kstatusnotifieritemdbus_p.h KStatusNotifierItemDBus)
endif(NOT WINCE)
set(kglobalaccel_xml ${CMAKE_CURRENT_SOURCE_DIR}/shortcuts/org.kde.KGlobalAccel.xml)
set_source_files_properties(${kglobalaccel_xml} PROPERTIES INCLUDE "kglobalshortcutinfo_p.h")
qt4_add_dbus_interface(kdeui_LIB_SRCS ${kglobalaccel_xml} kglobalaccel_interface )
install(FILES ${kglobalaccel_xml} DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
set(kglobalaccel_component_xml ${CMAKE_CURRENT_SOURCE_DIR}/shortcuts/org.kde.kglobalaccel.Component.xml)
set_source_files_properties(${kglobalaccel_component_xml} PROPERTIES INCLUDE "kglobalshortcutinfo_p.h")
qt4_add_dbus_interface(kdeui_LIB_SRCS ${kglobalaccel_component_xml} kglobalaccel_component_interface )
install(FILES ${kglobalaccel_component_xml} DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
set(knotify_xml ${CMAKE_CURRENT_SOURCE_DIR}/notifications/org.kde.KNotify.xml)
qt4_add_dbus_interface(kdeui_LIB_SRCS ${knotify_xml} knotify_interface)
kde4_add_library(kdeui ${LIBRARY_TYPE} ${kdeui_LIB_SRCS})
target_link_libraries(kdeui itemmodels sonnetcore kauth ${KDE4_KDECORE_LIBS} ${X11_LIBRARIES} ${QT_QTGUI_LIBRARY}
${QT_QTXML_LIBRARY} ${KDEUI_EXTRA_LIBS} ${QT_QTNETWORK_LIBRARY} kcoreaddons)
if(NOT WINCE)
target_link_libraries(kdeui ${QT_QTSVG_LIBRARY})
endif(NOT WINCE)
if(HAVE_DBUSMENUQT)
target_link_libraries(kdeui ${DBUSMENUQT_LIBRARIES})
endif()
if(MINGW)
target_link_libraries(kdeui gdi32 oleaut32)
endif(MINGW)
if(Q_WS_MAC)
target_link_libraries(kdeui ${CARBON_LIBRARY})
if (MAC_USE_OSXKEYCHAIN)
target_link_libraries(kdeui ${SECURITY_LIBRARY})
endif (MAC_USE_OSXKEYCHAIN)
endif(Q_WS_MAC)
if(X11_XTest_FOUND)
target_link_libraries(kdeui ${X11_XTest_LIB})
endif(X11_XTest_FOUND)
if(X11_Xcursor_FOUND)
target_link_libraries(kdeui ${X11_Xcursor_LIB})
endif(X11_Xcursor_FOUND)
if (X11_Xfixes_FOUND)
target_link_libraries(kdeui ${X11_Xfixes_LIB})
endif(X11_Xfixes_FOUND)
if (X11_Xrender_FOUND)
target_link_libraries(kdeui ${X11_Xrender_LIB})
endif(X11_Xrender_FOUND)
target_link_libraries(kdeui LINK_INTERFACE_LIBRARIES kdecore ${QT_QTGUI_LIBRARY})
if(NOT WINCE)
target_link_libraries(kdeui LINK_INTERFACE_LIBRARIES ${QT_QTSVG_LIBRARY})
endif(NOT WINCE)
set_target_properties(kdeui PROPERTIES VERSION ${KDE_NON_GENERIC_LIB_VERSION}
SOVERSION ${KDE_NON_GENERIC_LIB_SOVERSION}
)
install(TARGETS kdeui ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
if (Q_WS_MAC)
install( FILES util/kkeyserver_mac.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
elseif (Q_WS_WIN)
install( FILES util/kkeyserver_win.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel )
else(Q_WS_WIN)
install( FILES util/fixx11h.h util/kkeyserver_x11.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
endif (Q_WS_MAC)
install( FILES
dialogs/aboutkde.png
dialogs/kdeprint_nup1.png
dialogs/kdeprint_nup2.png
dialogs/kdeprint_nup4.png
dialogs/kdeprint_nupother.png
dialogs/ktip-bulb.png
dialogs/thumb_frame.png
DESTINATION ${DATA_INSTALL_DIR}/kdeui/pics )
install( FILES widgets/kcharselect-data DESTINATION ${DATA_INSTALL_DIR}/kcharselect )
install( FILES xmlgui/ui_standards.rc DESTINATION ${CONFIG_INSTALL_DIR}/ui )
install( FILES
kdeui_export.h
actions/kactioncollection.h
actions/kactioncategory.h
actions/kaction.h
actions/kactionmenu.h
actions/kdualaction.h
actions/kcodecaction.h
actions/kfontaction.h
actions/kfontsizeaction.h
actions/kpastetextaction.h
actions/krecentfilesaction.h
actions/kselectaction.h
actions/kstandardaction.h
actions/ktoggleaction.h
actions/ktoggletoolbaraction.h
actions/ktogglefullscreenaction.h
actions/ktoolbarlabelaction.h
actions/ktoolbarpopupaction.h
actions/ktoolbarspaceraction.h
colors/kcolorutils.h
colors/kcolorscheme.h
colors/kcolorcollection.h
colors/kcolorbutton.h
colors/kcolorchoosermode.h
colors/kcolorcombo.h
colors/kcolordialog.h
colors/kcolormimedata.h
colors/kcolorvalueselector.h
colors/khuesaturationselect.h
config/kconfigskeleton.h
dialogs/kaboutapplicationdialog.h
dialogs/kassistantdialog.h
dialogs/kbugreport.h
dialogs/kconfigdialog.h
dialogs/kconfigdialogmanager.h
dialogs/kdeprintdialog.h
dialogs/kdialog.h
dialogs/kedittoolbar.h
dialogs/kinputdialog.h
dialogs/kmessagebox.h
dialogs/kmessageboxmessagehandler.h
dialogs/knewpassworddialog.h
dialogs/kpassworddialog.h
dialogs/kpixmapregionselectordialog.h
dialogs/kprogressdialog.h
dialogs/ksplashscreen.h
dialogs/kshortcutsdialog.h
dialogs/kshortcutseditor.h
dialogs/ktip.h
findreplace/kfind.h
findreplace/kreplace.h
findreplace/kfinddialog.h
findreplace/kreplacedialog.h
fonts/kfontchooser.h
fonts/kfontcombobox.h
fonts/kfontdialog.h
fonts/kfontrequester.h
fonts/kfontutils.h
icons/kiconbutton.h
icons/kicondialog.h
icons/kiconeffect.h
icons/kicon.h
icons/k3icon_p.h # we install the private header as it is needed by kcm (tokoe)
icons/kiconloader.h
icons/kicontheme.h
icons/kiconcache.h
itemviews/kconfigviewstatesaver.h
itemviews/klistwidget.h
itemviews/kviewstatesaver.h
itemviews/kviewstatemaintainer.h
itemviews/klistwidgetsearchline.h
itemviews/ktreewidgetsearchline.h
itemviews/kfilterproxysearchline.h
itemviews/kextendableitemdelegate.h
itemviews/kcategorizedsortfilterproxymodel.h
itemviews/kcategorizedview.h
itemviews/kcategorydrawer.h
itemviews/kwidgetitemdelegate.h
# itemviews/kreparentingproxymodel.h
jobs/kdialogjobuidelegate.h
jobs/kabstractwidgetjobtracker.h
jobs/kwidgetjobtracker.h
jobs/kstatusbarjobtracker.h
jobs/kuiserverjobtracker.h
kernel/kapplication.h
kernel/kuniqueapplication.h
kernel/ksessionmanager.h
kernel/kstyle.h
kernel/kstartupinfo.h
kernel/kglobalsettings.h
kernel/ksystemeventfilter.h
notifications/kstatusnotifieritem.h
notifications/ksystemtrayicon.h
notifications/knotification.h
notifications/knotificationrestrictions.h
paged/kpagedialog.h
paged/kpagemodel.h
paged/kpageview.h
paged/kpagewidget.h
paged/kpagewidgetmodel.h
shortcuts/kshortcut.h
shortcuts/kstandardshortcut.h
shortcuts/kglobalaccel.h
shortcuts/kglobalshortcutinfo.h
shortcuts/kglobalshortcutinfo_p.h
shortcuts/kacceleratormanager.h
shortcuts/kgesture.h
util/kaccelgen.h
util/kcompletion.h
util/kcrash.h
util/kcursor.h
util/kguiitem.h
util/kkeyserver.h
util/kmanagerselection.h
util/kmodifierkeyinfo.h
util/knumvalidator.h
util/kpassivepopup.h
util/kpassivepopupmessagehandler.h
util/kpixmapcache.h
util/kpixmapprovider.h
util/kimagecache.h
util/kstandardguiitem.h
util/kwallet.h
util/kwordwrap.h
util/kxerrorhandler.h
util/kxutils.h
util/kxmessages.h
util/kundostack.h
util/kpixmapsequence.h
util/kpixmapsequenceoverlaypainter.h
util/kpixmapsequencewidget.h
widgets/kactionselector.h
widgets/kanimatedbutton.h
widgets/kdatecombobox.h
widgets/kdatepicker.h
widgets/kcapacitybar.h
widgets/kcmodule.h
widgets/kcombobox.h
widgets/kcompletionbox.h
widgets/kbuttongroup.h
widgets/kcharselect.h
widgets/kdatetable.h
widgets/kdatetimeedit.h
widgets/kdatetimewidget.h
widgets/kdatewidget.h
widgets/kdialogbuttonbox.h
widgets/keditlistwidget.h
widgets/kfadewidgeteffect.h
widgets/khbox.h
widgets/khelpmenu.h
widgets/khistorycombobox.h
widgets/kkeysequencewidget.h
widgets/klanguagebutton.h
widgets/kled.h
widgets/klineedit.h
widgets/kmainwindow.h
widgets/kmenu.h
widgets/kmenubar.h
widgets/kmessagewidget.h
widgets/kmultitabbar.h
widgets/knuminput.h
widgets/kpixmapregionselectorwidget.h
widgets/kpushbutton.h
widgets/kratingpainter.h
widgets/kratingwidget.h
widgets/krestrictedline.h
widgets/krichtextedit.h
widgets/krichtextwidget.h
widgets/kseparator.h
widgets/ksqueezedtextlabel.h
widgets/kstringvalidator.h
widgets/ktextbrowser.h
widgets/ktextedit.h
widgets/ktimecombobox.h
widgets/ktimezonewidget.h
widgets/ktitlewidget.h
widgets/ktabbar.h
widgets/ktabwidget.h
widgets/kruler.h
widgets/kselector.h
widgets/kshortcutwidget.h
widgets/kstatusbar.h
widgets/ktoolbar.h
widgets/kurllabel.h
widgets/kvbox.h
widgets/kxyselector.h
windowmanagement/kwindowsystem.h
windowmanagement/kwindowinfo.h
windowmanagement/netwm_def.h
windowmanagement/netwm.h
xmlgui/kxmlguiwindow.h
xmlgui/kxmlguiclient.h
xmlgui/kxmlguibuilder.h
xmlgui/kxmlguifactory.h
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel )
if(NOT KDE_NO_DEPRECATED)
install(FILES
widgets/karrowbutton.h
widgets/keditlistbox.h
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel )
endif(NOT KDE_NO_DEPRECATED)
install( FILES
sonnet/dialog.h
sonnet/highlighter.h
sonnet/configdialog.h
sonnet/configwidget.h
sonnet/dictionarycombobox.h
DESTINATION ${INCLUDE_INSTALL_DIR}/sonnet COMPONENT Devel )
install(PROGRAMS preparetips DESTINATION ${BIN_INSTALL_DIR} )
if (Q_WS_MAC)
install(PROGRAMS kernel/start-session-bus.sh DESTINATION ${BIN_INSTALL_DIR} )
endif (Q_WS_MAC)
install( FILES colors/40.colors colors/Oxygen.colors colors/Web.colors colors/Royal.colors colors/Rainbow.colors
DESTINATION ${CONFIG_INSTALL_DIR}/colors)
install( FILES
jobs/org.kde.JobViewServer.xml
jobs/org.kde.JobView.xml
jobs/org.kde.JobViewV2.xml
DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
install(FILES
notifications/org.kde.StatusNotifierItem.xml
notifications/org.kde.StatusNotifierWatcher.xml
DESTINATION ${DBUS_INTERFACES_INSTALL_DIR})
if (NOT Q_WS_X11)
# install our copy of the rgb.txt named colors list on systems without X11
install(FILES colors/rgb.txt DESTINATION ${DATA_INSTALL_DIR}/kdeui)
endif (NOT Q_WS_X11)
+
+install( FILES
+ KDEUIMacros.cmake
+ DESTINATION ${DATA_INSTALL_DIR}/cmake/modules COMPONENT Devel )
diff --git a/kdeui/KDEUIMacros.cmake b/kdeui/KDEUIMacros.cmake
new file mode 100644
index 0000000000..85c646d453
--- /dev/null
+++ b/kdeui/KDEUIMacros.cmake
@@ -0,0 +1,304 @@
+# Copyright (c) 2006-2009 Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2006, 2007, Laurent Montel, <montel@kde.org>
+# Copyright (c) 2007 Matthias Kretz <kretz@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+get_filename_component(KDE4UI_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+# TODO: These macros belong with the framework they relate to.
+
+#create the implementation files from the ui files and add them to the list of sources
+#usage: KDE4_ADD_UI_FILES(foo_SRCS ${ui_files})
+macro (KDE4_ADD_UI_FILES _sources )
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h)
+
+ # we need to run uic and replace some things in the generated file
+ # this is done by executing the cmake script kde4uic.cmake
+ add_custom_command(OUTPUT ${_header}
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -DKDE4_HEADER:BOOL=ON
+ -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE}
+ -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
+ -DKDE_UIC_H_FILE:FILEPATH=${_header}
+ -DKDE_UIC_BASENAME:STRING=${_basename}
+ -P ${KDE4UI_MODULE_DIR}/kde4uic.cmake
+ MAIN_DEPENDENCY ${_tmp_FILE}
+ )
+ list(APPEND ${_sources} ${_header})
+ endforeach (_current_FILE)
+endmacro (KDE4_ADD_UI_FILES)
+
+
+macro (KDE4_UPDATE_ICONCACHE)
+ # Update mtime of hicolor icon theme dir.
+ # We don't always have touch command (e.g. on Windows), so instead create
+ # and delete a temporary file in the theme dir.
+ install(CODE "
+ set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
+ if (NOT DESTDIR_VALUE)
+ file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\")
+ file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\")
+ endif (NOT DESTDIR_VALUE)
+ ")
+endmacro (KDE4_UPDATE_ICONCACHE)
+
+# a "map" of short type names to the directories
+# unknown names should give empty results
+# KDE 3 compatibility
+set(_KDE4_ICON_GROUP_mime "mimetypes")
+set(_KDE4_ICON_GROUP_filesys "places")
+set(_KDE4_ICON_GROUP_device "devices")
+set(_KDE4_ICON_GROUP_app "apps")
+set(_KDE4_ICON_GROUP_action "actions")
+# KDE 4 / icon naming specification compatibility
+set(_KDE4_ICON_GROUP_mimetypes "mimetypes")
+set(_KDE4_ICON_GROUP_places "places")
+set(_KDE4_ICON_GROUP_devices "devices")
+set(_KDE4_ICON_GROUP_apps "apps")
+set(_KDE4_ICON_GROUP_actions "actions")
+set(_KDE4_ICON_GROUP_categories "categories")
+set(_KDE4_ICON_GROUP_status "status")
+set(_KDE4_ICON_GROUP_emblems "emblems")
+set(_KDE4_ICON_GROUP_emotes "emotes")
+set(_KDE4_ICON_GROUP_animations "animations")
+set(_KDE4_ICON_GROUP_intl "intl")
+
+# a "map" of short theme names to the theme directory
+set(_KDE4_ICON_THEME_ox "oxygen")
+set(_KDE4_ICON_THEME_cr "crystalsvg")
+set(_KDE4_ICON_THEME_lo "locolor")
+set(_KDE4_ICON_THEME_hi "hicolor")
+
+
+# only used internally by KDE4_INSTALL_ICONS
+macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR)
+
+ # if the string doesn't match the pattern, the result is the full string, so all three have the same content
+ if (NOT ${_group} STREQUAL ${_install_NAME} )
+ set(_icon_GROUP ${_KDE4_ICON_GROUP_${_group}})
+ if(NOT _icon_GROUP)
+ set(_icon_GROUP "actions")
+ endif(NOT _icon_GROUP)
+# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}")
+ install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} )
+ endif (NOT ${_group} STREQUAL ${_install_NAME} )
+
+endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
+
+
+macro (KDE4_INSTALL_ICONS _defaultpath )
+
+ # the l10n-subdir if language given as second argument (localized icon)
+ set(_lang ${ARGV1})
+ if(_lang)
+ set(_l10n_SUBDIR l10n/${_lang})
+ else(_lang)
+ set(_l10n_SUBDIR ".")
+ endif(_lang)
+
+ # first the png icons
+ file(GLOB _icons *.png)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_size "${CMAKE_MATCH_2}")
+ set(_group "${CMAKE_MATCH_3}")
+ set(_name "${CMAKE_MATCH_4}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ # mng icons
+ file(GLOB _icons *.mng)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_size "${CMAKE_MATCH_2}")
+ set(_group "${CMAKE_MATCH_3}")
+ set(_name "${CMAKE_MATCH_4}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ # and now the svg icons
+ file(GLOB _icons *.svgz)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_group "${CMAKE_MATCH_2}")
+ set(_name "${CMAKE_MATCH_3}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/scalable
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ kde4_update_iconcache()
+
+endmacro (KDE4_INSTALL_ICONS)
+
+
+macro (KDE4_ADD_WIDGET_FILES _sources)
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component(_input ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_input} NAME_WE)
+ set(_source ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.cpp)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.moc)
+
+ # create source file from the .widgets file
+ add_custom_command(OUTPUT ${_source}
+ COMMAND ${KDE4_MAKEKDEWIDGETS_EXECUTABLE}
+ ARGS -o ${_source} ${_input}
+ MAIN_DEPENDENCY ${_input} DEPENDS ${_KDE4_MAKEKDEWIDGETS_DEP})
+
+ # create moc file
+ qt4_generate_moc(${_source} ${_moc} )
+
+ list(APPEND ${_sources} ${_source} ${_moc})
+
+ endforeach (_current_FILE)
+
+endmacro (KDE4_ADD_WIDGET_FILES)
+
+# adds application icon to target source list
+# 'appsources' - the sources of the application
+# 'pngfiles' - specifies the list of icon files
+# example: KDE4_ADD_WIN32_APP_ICON(myapp_SRCS "pics/cr16-myapp.png;pics/cr32-myapp.png")
+macro (KDE4_ADD_WIN32_APP_ICON appsources)
+ message(STATUS "KDE4_ADD_WIN32_APP_ICON() is deprecated, use KDE4_ADD_APP_ICON() instead")
+ if (WIN32)
+ if(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
+ else(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
+ endif(NOT WINCE)
+ string(REPLACE _SRCS "" appname ${appsources})
+ if (PNG2ICO_EXECUTABLE)
+ set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appname})
+
+ # png2ico is found by the above find_program
+# message("png2ico ${_outfilename}.ico ${ARGN}")
+ exec_program(png2ico ARGS ${_outfilename}.ico ${ARGN})
+
+ # now make rc file for adding it to the sources
+ file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
+ list(APPEND ${appsources} ${CMAKE_CURRENT_BINARY_DIR}/${appname}.rc)
+ endif(PNG2ICO_EXECUTABLE)
+ endif(WIN32)
+endmacro (KDE4_ADD_WIN32_APP_ICON)
+
+# adds application icon to target source list
+# for detailed documentation see the top of FindKDE4Internal.cmake
+macro (KDE4_ADD_APP_ICON appsources pattern)
+ set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appsources})
+
+ if (WIN32)
+ if(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
+ else(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
+ endif(NOT WINCE)
+ if (PNG2ICO_EXECUTABLE)
+ string(REPLACE "*" "(.*)" pattern_rx "${pattern}")
+ file(GLOB files "${pattern}")
+ foreach (it ${files})
+ string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}")
+ if (fn MATCHES ".*16.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*16.*")
+ if (fn MATCHES ".*32.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*32.*")
+ if (fn MATCHES ".*48.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*48.*")
+ if (fn MATCHES ".*64.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*64.*")
+ if (fn MATCHES ".*128.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*128.*")
+ endforeach (it)
+ if (_icons)
+ add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc
+ COMMAND ${PNG2ICO_EXECUTABLE} ARGS --rcfile ${_outfilename}.rc ${_outfilename}.ico ${_icons}
+ DEPENDS ${PNG2ICO_EXECUTABLE} ${_icons}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ list(APPEND ${appsources} ${_outfilename}.rc)
+ else(_icons)
+ message(STATUS "Unable to find a related icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
+ endif(_icons)
+ else(PNG2ICO_EXECUTABLE)
+ message(STATUS "Unable to find the png2ico utility - application will not have an application icon!")
+ endif(PNG2ICO_EXECUTABLE)
+ endif(WIN32)
+ if (Q_WS_MAC)
+ # first convert image to a tiff using the Mac OS X "sips" utility,
+ # then use tiff2icns to convert to an icon
+ find_program(SIPS_EXECUTABLE NAMES sips)
+ find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns)
+ if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ file(GLOB_RECURSE files "${pattern}")
+ # we can only test for the 128-icon like that - we don't use patterns anymore
+ foreach (it ${files})
+ if (it MATCHES ".*128.*" )
+ set (_icon ${it})
+ endif (it MATCHES ".*128.*")
+ endforeach (it)
+
+ if (_icon)
+
+ # first, get the basename of our app icon
+ add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff
+ COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff
+ COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns
+ DEPENDS ${_icon}
+ )
+
+ # This will register the icon into the bundle
+ set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
+
+ # Append the icns file to the sources list so it will be a dependency to the
+ # main target
+ list(APPEND ${appsources} ${_outfilename}.icns)
+
+ # Install the icon into the Resources dir in the bundle
+ set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
+
+ else(_icon)
+ # TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
+ message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
+ endif(_icon)
+
+ else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
+ endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ endif(Q_WS_MAC)
+endmacro (KDE4_ADD_APP_ICON)
+
diff --git a/cmake/modules/kde4uic.cmake b/kdeui/kde4uic.cmake
similarity index 100%
rename from cmake/modules/kde4uic.cmake
rename to kdeui/kde4uic.cmake

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 1, 9:05 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10075500
Default Alt Text
(85 KB)

Event Timeline