Sorry for the delay. Here goes.
On Saturday 16 January 2010 19:27:19 Alexander Neundorf wrote:
> On Thursday 14 January 2010, Dario Freddi wrote:
> > On Wednesday 13 January 2010 20:21:50 Alexander Neundorf wrote:
>
> ...
>
> > > [...]
> > >
> > > How KDE4_AUTH_POLICY_FILES_INSTALL_DIR is not ok.
> > > The information coming from the KDELibsDependencies.cmake file, i.e.
> > > written by CreateKDELibsDependenciesFile.cmake, gives information
> > > about the kdelibs which is installed and which has been found. They are
> > > no cache variables so they cannot be changed by the user later on who
> > > builds against kdelibs.
> > >
> > > So KDE4_AUTH_POLICY_FILES_INSTALL_DIR is the variable which tells us
> > > where kdelibs installed its policy files to.
> > > OTOH the project which uses kdelibs is free to install its files to any
> > > other location.
> > > The locations recommended for use by KDE (FindKDE4Internal.cmake) are
> > > the FOO_INSTALL_DIR variables from FindKDE4Internal.cmake.
> > > So there you should add a AUTH_POLICY_FILES_INSTALL_DIR variable. I
> > > would suggest that this should be handled the same way as the other
> > > INSTALL_DIR variables.
> > > This would mean if you build foo against kdelibs and install it to the
> > > same location, AUTH_POLICY_FILES_INSTALL_DIR will point to
> > > KDE4_AUTH_POLICY_FILES_INSTALL_DIR.
> > > But if you install it somewhere else, this will be relative to the new
> > > CMAKE_INSTALL_PREFIX. And if you then set it via -D or write a value
> > > you want into the cache, you can point it just anyway.
> > > Would this be ok ?
> > > If not, how should it behave ?
> >
> > Basically, KDE4_AUTH_POLICY_FILES_INSTALL_DIR should be a proxy to
> > POLKITQT*_POLICY_FILES_INSTALL_DIR (and eventual future backends), for
> > the sake of not installing the Find files and finding the package
> > everytime a component using KAuth is built. I don't know if what you
> > suggested would work that out.
>
> Hmm, then at least write a
> set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ... CACHE )
> in the KDELibsDependencies.file, this way it can be changed via the cache
> later on.
>
> > > > Index: kdecore/auth/ConfigureChecks.cmake
> > > > ===================================================================
> > > > --- kdecore/auth/ConfigureChecks.cmake (revisione 1072643)
> > > > +++ kdecore/auth/ConfigureChecks.cmake (copia locale)
> > > > @@ -1,28 +1,34 @@
> > > > ####### checks for kdecore/kauth ###############
> > >
> > > How about setting the non-cache KAUTH_BACKEND variable in all the
> > > branches and do a
> > > set(KDE4_KAUTH_BACKEND_NAME ${KAUTH_BACKEND} ... CACHE ... )
> > > just once at the end ?
> >
> > Would it work if the user set KDE4_AUTH_BACKEND_NAME explicitely?
>
> Yes.
>
> Alex
> -- ------------------- Dario Freddi KDE Developer GPG Key Signature: 511A9A3B
Index: cmake/modules/KDE4Macros.cmake
===================================================================
--- cmake/modules/KDE4Macros.cmake (revisione 1079059)
+++ cmake/modules/KDE4Macros.cmake (copia locale)
@@ -1271,9 +1271,9 @@
# the install phase
function(KDE4_INSTALL_AUTH_ACTIONS HELPER_ID ACTIONS_FILE)
- if(APPLE)
+ 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(UNIX)
+ 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)
@@ -1285,13 +1285,7 @@
DEPENDS ${_KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP})
add_custom_target("actions for ${HELPER_ID}" ALL DEPENDS ${_output})
- if (NOT POLKITQT_FOUND)
- macro_optional_find_package(PolkitQt)
- endif (NOT POLKITQT_FOUND)
-
- if (POLKITQT_FOUND)
- install(FILES ${_output} DESTINATION ${POLKITQT_POLICY_FILES_INSTALL_DIR})
- endif (POLKITQT_FOUND)
+ install(FILES ${_output} DESTINATION ${KDE4_AUTH_POLICY_FILES_INSTALL_DIR})
endif()
endfunction(KDE4_INSTALL_AUTH_ACTIONS)
Index: CreateKDELibsDependenciesFile.cmake
===================================================================
--- CreateKDELibsDependenciesFile.cmake (revisione 1079059)
+++ CreateKDELibsDependenciesFile.cmake (copia locale)
@@ -115,3 +115,9 @@
# in order to work properly. Used by kwrited.
macro_bool_to_01(HAVE_UTEMPTER KDE4_KPTY_BUILT_WITH_UTEMPTER)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake" "set(KDE4_KPTY_BUILT_WITH_UTEMPTER ${KDE4_KPTY_BUILT_WITH_UTEMPTER})")
+
+# Append stuff needed by the KAuth framework
+file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/KDELibsDependencies.cmake" "
+set(KDE4_AUTH_BACKEND_NAME \"${KDE4_AUTH_BACKEND_NAME}\")
+set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR \"${KDE4_AUTH_POLICY_FILES_INSTALL_DIR}\")" CACHE STRING
+ "The location where policy files generated by KAuth will be installed, if the installed backend needs to")
Index: kdecore/auth/ConfigureChecks.cmake
===================================================================
--- kdecore/auth/ConfigureChecks.cmake (revisione 1079059)
+++ kdecore/auth/ConfigureChecks.cmake (copia locale)
@@ -1,8 +1,11 @@
####### checks for kdecore/kauth ###############
-set(KAUTH_BACKEND "" CACHE STRING "Specifies the KAuth backend to build. Current available options are
+set(KDE4_AUTH_BACKEND_NAME "" CACHE STRING "Specifies the KAuth backend to build. Current available options are
PolkitQt, PolkitQt-1, Fake, Apple. Not setting this variable will build the most
appropriate backend for your system")
+
+set(KAUTH_BACKEND ${KDE4_AUTH_BACKEND_NAME})
+
## Check if the user did not specify a backend to be built. If that is the case,
## we check what is the best backend to build on this system.
## 4.4: We leave polkit-0.9 having more priority over polkit-1. This will change from 4.5 on
@@ -39,15 +42,17 @@
endif(APPLE)
# Case-insensitive
- string(TOUPPER ${KAUTH_BACKEND} KAUTH_BACKEND)
+ string(TOUPPER ${KAUTH_BACKEND} KAUTH_BACKEND_UPPER)
+ set (KAUTH_BACKEND ${KAUTH_BACKEND_UPPER})
else(NOT KAUTH_BACKEND)
# Case-insensitive
- string(TOUPPER ${KAUTH_BACKEND} KAUTH_BACKEND)
+ string(TOUPPER ${KAUTH_BACKEND} KAUTH_BACKEND_UPPER)
+ set (KAUTH_BACKEND ${KAUTH_BACKEND_UPPER})
# Check if the specified backend is valid. If it is not, we fall back to the Fake one
if (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE")
message ("WARNING: The KAuth Backend ${KAUTH_BACKEND} you specified does not exist. Falling back to Fake backend")
- set (KAUTH_BACKEND "Fake")
+ set (KAUTH_BACKEND "FAKE")
endif (NOT KAUTH_BACKEND STREQUAL "OSX" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT" AND NOT KAUTH_BACKEND STREQUAL "POLKITQT-1" AND NOT KAUTH_BACKEND STREQUAL "FAKE")
# Check requirements for each backend. If not, fall back to the fake one
@@ -79,12 +84,20 @@
endif (KAUTH_BACKEND STREQUAL "POLKITQT-1")
endif(NOT KAUTH_BACKEND)
-# Add the correct libraries depending on the backend
-if(KAUTH_BACKEND STREQUAL "OSX")
+set(KDE4_AUTH_BACKEND_NAME ${KAUTH_BACKEND} CACHE STRING "Specifies the KAuth backend to build. Current available options are
+ PolkitQt, PolkitQt-1, Fake, Apple. Not setting this variable will build the most
+ appropriate backend for your system")
+
+# Add the correct libraries depending on the backend, and eventually set the policy files install location
+if(KDE4_AUTH_BACKEND_NAME STREQUAL "OSX")
find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
find_library(SECURITY_LIBRARY Security)
-elseif(KAUTH_BACKEND STREQUAL "POLKITQT")
+elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT")
include_directories(${POLKITQT_INCLUDE_DIR})
-elseif(KAUTH_BACKEND STREQUAL "POLKITQT-1")
+ set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${POLKITQT_POLICY_FILES_INSTALL_DIR} CACHE STRING
+ "Where policy files generated by KAuth will be installed" FORCE)
+elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
include_directories(${POLKITQT-1_INCLUDE_DIR})
+ set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${POLKITQT-1_POLICY_FILES_INSTALL_DIR} CACHE STRING
+ "Where policy files generated by KAuth will be installed" FORCE)
endif()
Index: kdecore/CMakeLists.txt
===================================================================
--- kdecore/CMakeLists.txt (revisione 1079059)
+++ kdecore/CMakeLists.txt (copia locale)
@@ -107,7 +107,7 @@
)
endif (UNIX)
-if (KAUTH_BACKEND STREQUAL "POLKITQT")
+if (KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT")
message(STATUS "Building PolkitQt KAuth backend")
set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS}
@@ -115,7 +115,7 @@
)
set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${POLKITQT_CORE_LIBRARY})
-elseif (KAUTH_BACKEND STREQUAL "POLKITQT-1")
+elseif (KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
message(STATUS "Building PolkitQt-1 KAuth backend")
set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS}
@@ -123,7 +123,7 @@
)
set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${POLKITQT-1_CORE_LIBRARY})
-elseif (KAUTH_BACKEND STREQUAL "OSX")
+elseif (KDE4_AUTH_BACKEND_NAME STREQUAL "OSX")
message(STATUS "Building Apple KAuth backend")
set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS}
@@ -131,7 +131,7 @@
)
set(kdecore_OPTIONAL_LIBS ${kdecore_OPTIONAL_LIBS} ${SECURITY_LIBRARY})
-elseif (KAUTH_BACKEND STREQUAL "FAKE")
+elseif (KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
message(STATUS "Building Fake KAuth backend")
message("WARNING: KAuth will be built with Fake backend. The library will not work properly unless compiled with
a working backend")
@@ -378,13 +378,13 @@
set(kauth_policy_gen_SRCS
auth/policy-gen/policy-gen.cpp )
-if(KAUTH_BACKEND STREQUAL "OSX")
+if(KDE4_AUTH_BACKEND_NAME STREQUAL "OSX")
set(kauth_policy_gen_SRCS ${kauth_policy_gen_SRCS}
auth/backends/mac/kauth-policy-gen-mac.cpp )
-elseif(KAUTH_BACKEND STREQUAL "POLKITQT")
+elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT")
set(kauth_policy_gen_SRCS ${kauth_policy_gen_SRCS}
auth/backends/policykit/kauth-policy-gen-polkit.cpp )
-elseif(KAUTH_BACKEND STREQUAL "POLKITQT-1")
+elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
set(kauth_policy_gen_SRCS ${kauth_policy_gen_SRCS}
auth/backends/polkit-1/kauth-policy-gen-polkit1.cpp )
else()
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
