In data domenica 06 settembre 2009 16:13:07, Alexander Neundorf ha scritto: : > On Sunday 06 September 2009, Dario Freddi wrote: > > In data domenica 06 settembre 2009 15:57:59, Alexander Neundorf ha scritto: > > > Sure ? I don't see it. > > > > You are right. We replaced that macro with stubs some time ago and I > > completely forgot about it. > > Cool :-) > So we even got rid of an unused macro which we otherwise would have to > support for all of KDE4 at least :-)
Yeah :) > So whatever svn module needs to current version, should then specify this > version in the find_package(KDE4) call as shown above. > > I think this is something for a monday. Agreed. So I'm sending the last diff; this time including everything that's changed in KDELibs, which includes also bumping up the revision (already timestamped on tomorrow, when I will push it according to your suggestion. I will CCMAIL mueller in the commit, as he usually takes over this stuff from what I've seen). After this commit, I'll bump up KDE4WORKSPACE_VERSION to 4.3.61 and make it depend on kde 4.3.68 at least. Probably these two would better be off in the same commit. Please tell me if everything is right in what I am about to do (hoping you can trust me for the fixes in kdebase-workspace ;) ), and thank you very much again for your patience on this. > > Alex > -- ------------------- Dario Freddi KDE Developer GPG Key Signature: 511A9A3B
Index: cmake/modules/FindPolkitQt.cmake =================================================================== --- cmake/modules/FindPolkitQt.cmake (revisione 1020533) +++ cmake/modules/FindPolkitQt.cmake (copia locale) @@ -4,98 +4,70 @@ # POLKITQT_FOUND - system has Polkit-qt # POLKITQT_INCLUDE_DIR - the Polkit-qt include directory # POLKITQT_LIBRARIES - Link these to use all Polkit-qt libs -# POLKITQT_CORE_LIBRARY -# POLKITQT_GUI_LIBRARY +# POLKITQT_CORE_LIBRARY - Link this to use the polkit-qt-core library only +# POLKITQT_GUI_LIBRARY - Link this to use GUI elements in polkit-qt (polkit-qt-gui) # POLKITQT_DEFINITIONS - Compiler switches required for using Polkit-qt -# Copyright (c) 2008, Adrien Bustany, <[email protected]> # Copyright (c) 2009, Daniel Nicoletti, <[email protected]> # Copyright (c) 2009, Dario Freddi, <[email protected]> # Copyright (c) 2009, Michal Malek, <[email protected]> # -# Redistribution and use is allowed according to the terms of the GPLv2+ license. +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (POLKITQT_INCLUDE_DIR AND POLKITQT_LIB) set(POLKITQT_FIND_QUIETLY TRUE) endif (POLKITQT_INCLUDE_DIR AND POLKITQT_LIB) -include(FindPkgConfig) - if (NOT POLKITQT_MIN_VERSION) set(POLKITQT_MIN_VERSION "0.9.0") endif (NOT POLKITQT_MIN_VERSION) -pkg_search_module( POLKITQT polkit-qt ) +if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_POLKITQT QUIET polkit-qt) + set(POLKITQT_DEFINITIONS ${PC_POLKITQT_CFLAGS_OTHER}) +endif (NOT WIN32) -if (POLKITQT_FOUND) - if (POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) - message(STATUS "Found Polkit-Qt release < ${POLKITQT_MIN_VERSION}") - message(STATUS "You need Polkit-Qt version ${POLKITQT_MIN_VERSION} or newer to compile this component") - set(POLKITQT_FOUND FALSE) - return() - else (POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) - message(STATUS "Found Polkit-Qt release >= ${POLKITQT_MIN_VERSION}") - if ( NOT POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX ) - message("WARNING: Installation prefix does not match PolicyKit install prefixes. You probably will need to move files installed " - "in POLICY_FILES_INSTALL_DIR and by dbus_add_activation_system_service to the ${POLKITQT_PREFIX} prefix") - endif (NOT POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX) - endif (POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) -else (POLKITQT_FOUND) - set(POLKITQT_FOUND FALSE) - message(STATUS "Cannot find Polkit-Qt library!") - return() -endif (POLKITQT_FOUND) - - -# find_path( POLKITQT_INCLUDE_DIR PolicyKit/policykit-qt/Polkit-qt ) find_path( POLKITQT_INCLUDE_DIR - NAMES PolicyKit/polkit-qt/ - HINTS ${POLKITQT_INCLUDEDIR} + NAMES polkit-qt/auth.h + PATH_SUFFIXES PolicyKit ) - find_library( POLKITQT_CORE_LIBRARY NAMES polkit-qt-core - HINTS ${POLKITQT_LIBDIR} + HINTS ${PC_POLKITQT_LIBDIR} ) find_library( POLKITQT_GUI_LIBRARY NAMES polkit-qt-gui - HINTS ${POLKITQT_LIBDIR} + HINTS ${PC_POLKITQT_LIBDIR} ) +find_library( POLKITQT_LIBRARIES + NAMES polkit-qt-gui polkit-qt-core + HINTS ${PC_POLKITQT_LIBDIR} +) -if (POLKITQT_INCLUDE_DIR AND POLKITQT_CORE_LIBRARY AND POLKITQT_GUI_LIBRARY) - set(POLKITQT_FOUND TRUE) -else (POLKITQT_INCLUDE_DIR AND POLKITQT_CORE_LIBRARY AND POLKITQT_GUI_LIBRARY) - set(POLKITQT_FOUND FALSE) -endif (POLKITQT_INCLUDE_DIR AND POLKITQT_CORE_LIBRARY AND POLKITQT_GUI_LIBRARY) +include(FindPackageHandleStandardArgs) -set(POLKITQT_LIBRARIES ${POLKITQT_CORE_LIBRARY} ${POLKITQT_GUI_LIBRARY}) +# handle the QUIETLY and REQUIRED arguments and set POLKITQT_FOUND to TRUE if +# all listed variables are TRUE +find_package_handle_standard_args(PolkitQt DEFAULT_MSG POLKITQT_LIBRARIES POLKITQT_INCLUDE_DIR) -set(POLKITQT_INCLUDE_DIR ${POLKITQT_INCLUDE_DIR}/PolicyKit/polkit-qt ${POLKITQT_INCLUDE_DIR}/PolicyKit/) +mark_as_advanced(POLKITQT_INCLUDE_DIR POLKITQT_CORE_LIBRARY POLKITQT_GUI_LIBRARY POLKITQT_LIBRARIES) -#if (POLKITQT_PREFIX != ${CMAKE_INSTALL_PREFIX}) -#message("Warning: Move polkit files to /usr prefix") -#endif() -set(POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/PolicyKit/policy/) - if (POLKITQT_FOUND) - if (NOT POLKITQT_FIND_QUIETLY) - message(STATUS "Found Polkit-Qt: ${POLKITQT_LIBRARIES}") - endif (NOT POLKITQT_FIND_QUIETLY) -else (POLKITQT_FOUND) - if (POLKITQT_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find Polkit-Qt") - endif (POLKITQT_FIND_REQUIRED) + if (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) + message(STATUS "Found Polkit-Qt release < ${POLKITQT_MIN_VERSION}") + message(STATUS "You need Polkit-Qt version ${POLKITQT_MIN_VERSION} or newer to compile this component") + set(POLKITQT_FOUND FALSE) + return() + else (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) + if ( NOT PC_POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX ) + message("WARNING: Installation prefix does not match PolicyKit install prefixes. You probably will need to move files installed " + "in POLICY_FILES_INSTALL_DIR and by dbus_add_activation_system_service to the ${PC_POLKITQT_PREFIX} prefix") + endif (NOT PC_POLKITQT_PREFIX STREQUAL CMAKE_INSTALL_PREFIX) + endif (PC_POLKITQT_VERSION VERSION_LESS POLKITQT_MIN_VERSION) endif (POLKITQT_FOUND) -mark_as_advanced(POLKITQT_INCLUDE_DIR POLKITQT_LIB) - -macro(dbus_add_activation_system_service _sources) - pkg_search_module( DBUS dbus-1 ) - foreach (_i ${_sources}) - get_filename_component(_service_file ${_i} ABSOLUTE) - string(REGEX REPLACE "\\.service.*$" ".service" _output_file ${_i}) - set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_output_file}) - configure_file(${_service_file} ${_target}) - install(FILES ${_target} DESTINATION ${DBUS_PREFIX}/share/dbus-1/system-services ) - endforeach (_i ${ARGN}) -endmacro(dbus_add_activation_system_service _sources) +set(POLKITQT_POLICY_FILES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/PolicyKit/policy/) Index: cmake/modules/FindKDE4Internal.cmake =================================================================== --- cmake/modules/FindKDE4Internal.cmake (revisione 1020533) +++ cmake/modules/FindKDE4Internal.cmake (copia locale) @@ -204,7 +204,25 @@ # INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if # SUBDIR <subdir> is specified. # +# KDE4_INSTALL_AUTH_ACTIONS( HELPER_ID ACTIONS_FILE ) +# 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 # +# KDE4_INSTALL_AUTH_HELPER_FILES( HELPER_TARGET HELPER_ID HELPER_USER ) +# 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. +# +# +# # A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles # the flags for those buildtypes. FindKDE4Internal supports the values # Debug, Release, RelWithDebInfo, Profile and Debugfull: @@ -386,24 +404,26 @@ set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin ) if (WIN32) - set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) + set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC - set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler ) + set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler ) - set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 ) - set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets ) + set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 ) + set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen ) + set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets ) else (WIN32) - set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) - set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler${CMAKE_EXECUTABLE_SUFFIX}.shell ) - - set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4${CMAKE_EXECUTABLE_SUFFIX}.shell ) - set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell ) + set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib ) + set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler${CMAKE_EXECUTABLE_SUFFIX}.shell ) + set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen${CMAKE_EXECUTABLE_SUFFIX}.shell ) + set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4${CMAKE_EXECUTABLE_SUFFIX}.shell ) + set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell ) endif (WIN32) set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) # when building kdelibs, make the kcfg rules depend on the binaries... set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler) + set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP kauth-policy-gen) set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets) set( _KDE4_MEINPROC_EXECUTABLE_DEP meinproc4) Index: cmake/modules/MacroKAuth.cmake =================================================================== --- cmake/modules/MacroKAuth.cmake (revisione 1020533) +++ cmake/modules/MacroKAuth.cmake (copia locale) @@ -1,63 +1,3 @@ +message(FATAL_ERROR "Don't include(MacroKAuth) anymore, it's now included in find_package(KDE4). This file will be removed soon, and will not appear in KDE 4.4 release.") -execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data --locate kauth/dbus_service.stub OUTPUT_VARIABLE KDE4_KAUTH_DBUS_SERVICE_STUB ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) -message(STATUS "KAuth: DBus service stub file found at ${KDE4_KAUTH_DBUS_SERVICE_STUB}") -execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data --locate kauth/dbus_policy.stub OUTPUT_VARIABLE KDE4_KAUTH_DBUS_POLICY_STUB ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) -message(STATUS "KAuth: DBus policy stub file found at ${KDE4_KAUTH_DBUS_POLICY_STUB}") -execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path libexec --locate kauth-policy-gen OUTPUT_VARIABLE KDE4_KAUTH_POLICY_GEN ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) -set( KDE4_KAUTH_DBUS_POLICY_STUB ${DATA_INSTALL_DIR}/kauth/dbus_policy.stub) -set( KDE4_KAUTH_DBUS_SERVICE_STUB ${DATA_INSTALL_DIR}/kauth/dbus_service.stub) -set( KDE4_KAUTH_POLICY_GEN ${LIBEXEC_INSTALL_DIR}/kauth-policy-gen) - -if(NOT KDE4_KAUTH_DBUS_SERVICE_STUB) - message(FATAL_ERROR "DBus service stub file couldn't be found (required by kde4_auth_add_helper macro)") -endif(NOT KDE4_KAUTH_DBUS_SERVICE_STUB) - -if(NOT KDE4_KAUTH_DBUS_POLICY_STUB) - message(FATAL_ERROR "DBus policy stub file couldn't be found (required by kde4_auth_add_helper macro)") -endif(NOT KDE4_KAUTH_DBUS_POLICY_STUB) - -if(NOT KDE4_KAUTH_POLICY_GEN) - message(FATAL_ERROR "KAuth policy generator tool couldn't be found (required by kde4_auth_register_actions macro)") -endif(NOT KDE4_KAUTH_POLICY_GEN) - -macro(kde4_auth_add_helper _HELPER_TARGET _HELPER_ID _HELPER_USER) - - set(HELPER_ID ${_HELPER_ID}) - set(HELPER_TARGET ${_HELPER_TARGET}) - set(HELPER_USER ${_HELPER_USER}) - - kde4_add_executable(${HELPER_TARGET} ${ARGN}) - target_link_libraries(${HELPER_TARGET} ${KDE4_KDECORE_LIBS}) - install(TARGETS ${HELPER_TARGET} DESTINATION ${LIBEXEC_INSTALL_DIR}) - - configure_file(${KDE4_KAUTH_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(${KDE4_KAUTH_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}) - - -endmacro(kde4_auth_add_helper) - -macro(kde4_auth_register_actions HELPER_ID ACTIONS_FILE) - -if(APPLE) - install(CODE "execute_process(COMMAND ${KDE4_KAUTH_POLICY_GEN} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})") -elseif(UNIX) - 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} ${_input} > ${_output} - MAIN_DEPENDENCY ${_input} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating ${HELPER_ID}.policy") - add_custom_target("actions for ${HELPER_ID}" ALL DEPENDS ${_output}) - - if (POLKITQT_FOUND) - install(FILES ${_output} DESTINATION ${POLICY_FILES_INSTALL_DIR}) - endif (POLKITQT_FOUND) -endif() - -endmacro(kde4_auth_register_actions) Index: cmake/modules/KDE4Macros.cmake =================================================================== --- cmake/modules/KDE4Macros.cmake (revisione 1020533) +++ cmake/modules/KDE4Macros.cmake (copia locale) @@ -22,6 +22,8 @@ # 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, <[email protected]> # Copyright (c) 2006, 2007, Laurent Montel, <[email protected]> @@ -1217,7 +1219,62 @@ 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 (_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}) +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(APPLE) + install(CODE "execute_process(COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})") + elseif(UNIX) + 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}) + + if (POLKITQT_FOUND) + install(FILES ${_output} DESTINATION ${POLKITQT_POLICY_FILES_INSTALL_DIR}) + endif (POLKITQT_FOUND) + endif() + +endfunction(KDE4_INSTALL_AUTH_ACTIONS) + + 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) Index: kdecore/auth/example/CMakeLists.txt =================================================================== --- kdecore/auth/example/CMakeLists.txt (revisione 1020533) +++ kdecore/auth/example/CMakeLists.txt (copia locale) @@ -13,9 +13,12 @@ # Auth example helper set(kauth_helper_srcs helper/helper.cpp) +kde4_add_executable(kauth_helper ${kauth_helper_srcs}) +target_link_libraries(kauth_helper kdecore) +install(TARGETS kauth_helper DESTINATION ${LIBEXEC_INSTALL_DIR}) -kde4_auth_add_helper(kauth_helper org.kde.auth.example root ${kauth_helper_srcs}) -kde4_auth_register_actions(org.kde.auth.example actions.actions) +kde4_install_auth_helper_files(kauth_helper org.kde.auth.example root) +kde4_install_auth_actions(org.kde.auth.example actions.actions) # miscellaneous set_target_properties(kauth_example PROPERTIES COMPILE_FLAGS "-Wall -ggdb") Index: kdecore/auth/kauthactionreply.h =================================================================== --- kdecore/auth/kauthactionreply.h (revisione 1020533) +++ kdecore/auth/kauthactionreply.h (copia locale) @@ -148,13 +148,18 @@ stay away from typos, because we don't have any way to detect them. The second parameter is the name of the helper's class. Your helper, if complex, can be composed of a lot of source files, but the important thing is to include this macro in one at least one of them. - To build the helper, the MacroKAuth.cmake module provides a macro kde4_auth_add_helper(). Use it in your cmake file like this: + To build the helper, KDE macros provide a function named kde4_install_auth_helper_files(). Use it in your cmake file like this: @code - kde4_auth_add_helper(<helper_target> <helper_id> <user> <sources>) + kde4_add_executable(<helper_target> your sources...) + target_link_libraries(<helper_target> your libraries...) + install(TARGETS <helper_target> DESTINATION ${LIBEXEC_INSTALL_DIR}) + + kde4_install_auth_helper_files(<helper_target> <helper_id> <user>) @endcode - The first argument is the cmake target name for the helper executable, that will be create using the add_executable with the source files you provide as last argument. The second argument is the + The first argument is the cmake target name for the helper executable, which you have to build and install separately. Make sure to INSTALL THE HELPER IN ${LIBEXEC_INSTALL_DIR}, + otherwise kde4_install_auth_helper_files will not work. The second argument is the helper id. Please be sure to don't misspell it, and to not quote it. The user parameter is the user that the helper has to be run as. It usually is root, but some actions could require less strict permissions, so you should use the right user where possible (for example the user apache if you have to mess with apache settings). Note that the target created by this macro already links to libkauth and QtCore @@ -162,7 +167,7 @@ @section kauth_actions Action registration To be able to authorize the actions, they have to be added to the policy database. To do this in a cross-platform way, we provide a cmake macro. It looks like: @code - kde4_auth_register_actions(<helper_id> <actions definition file>) + kde4_install_auth_actions(<helper_id> <actions definition file>) @endcode The action definition file describes which actions are implemented by your code and which default security options they should have. It is a common text file in ini format, with one section for Index: kdecore/CMakeLists.txt =================================================================== --- kdecore/CMakeLists.txt (revisione 1020533) +++ kdecore/CMakeLists.txt (copia locale) @@ -22,7 +22,6 @@ include_directories( ${QT_INCLUDES} ) if (POLKITQT_FOUND) include_directories( ${POLKITQT_INCLUDE_DIR} ) - message(${POLKITQT_INCLUDE_DIR}) endif (POLKITQT_FOUND) # kdecore_OPTIONAL_SRCS is used to collect source files @@ -366,7 +365,7 @@ auth/backends/fake/kauth-policy-gen-polkit.cpp ) endif() -kde4_add_executable(kauth-policy-gen ${kauth_policy_gen_SRCS}) +kde4_add_executable(kauth-policy-gen NOGUI RUN_UNINSTALLED ${kauth_policy_gen_SRCS}) set( KAUTH_POLICY_GEN_LIBRARIES ${QT_QTCORE_LIBRARY} ) @@ -378,7 +377,7 @@ target_link_libraries( kauth-policy-gen ${KAUTH_POLICY_GEN_LIBRARIES} ) -install( TARGETS kauth-policy-gen DESTINATION ${LIBEXEC_INSTALL_DIR} COMPONENT Devel) +install( TARGETS kauth-policy-gen EXPORT kdelibsToolsTargets DESTINATION ${LIBEXEC_INSTALL_DIR}) ########### next target ############### Index: plasma/CMakeLists.txt =================================================================== --- plasma/CMakeLists.txt (revisione 1020533) +++ plasma/CMakeLists.txt (copia locale) @@ -346,13 +346,11 @@ ########### next target ############### -include(MacroKAuth) +kde4_add_executable(kcmremotewidgetshelper private/remotewidgetshelper.cpp) +target_link_libraries(kcmremotewidgetshelper kdecore) +install(TARGETS kcmremotewidgetshelper DESTINATION ${LIBEXEC_INSTALL_DIR}) -set( KDE4_KAUTH_DBUS_POLICY_STUB ${CMAKE_SOURCE_DIR}/kdecore/auth/backends/dbus/dbus_policy.stub) -set( KDE4_KAUTH_DBUS_SERVICE_STUB ${CMAKE_SOURCE_DIR}/kdecore/auth/backends/dbus/dbus_service.stub) -set( KDE4_KAUTH_POLICY_GEN kauth-policy-gen) +kde4_install_auth_helper_files(kcmremotewidgetshelper org.kde.kcontrol.kcmremotewidgets root) -kde4_auth_add_helper(kcmremotewidgetshelper org.kde.kcontrol.kcmremotewidgets root private/remotewidgetshelper.cpp) +kde4_install_auth_actions(org.kde.kcontrol.kcmremotewidgets kcm_remotewidgets.actions) -kde4_auth_register_actions(org.kde.kcontrol.kcmremotewidgets kcm_remotewidgets.actions) - Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revisione 1020533) +++ CMakeLists.txt (copia locale) @@ -10,9 +10,9 @@ set (KDE_VERSION_MAJOR 4) set (KDE_VERSION_MINOR 3) -set (KDE_VERSION_RELEASE 67) +set (KDE_VERSION_RELEASE 68) set (KDE_VERSION "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}" ) -set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.3.67 (KDE 4.4 >= 20090904))") +set (KDE_VERSION_STRING "${KDE_VERSION} (KDE 4.3.68 (KDE 4.4 >= 20090907))") set (KDE_DISTRIBUTION_TEXT "compiled sources" CACHE STRING "Indicate the distribution in bug reports" )
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
