c1007c1918
[ci skip]
30 lines
1.6 KiB
Diff
30 lines
1.6 KiB
Diff
--- cmake/KF5AuthMacros.cmake 2018-08-26 14:57:02.703186769 +0200
|
|
+++ cmake/KF5AuthMacros.cmake 2018-08-26 14:58:26.469054620 +0200
|
|
@@ -63,12 +63,21 @@
|
|
set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy)
|
|
get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE)
|
|
|
|
- add_custom_command(OUTPUT ${_output}
|
|
- COMMAND KF5::kauth-policy-gen ${_input} ${_output}
|
|
- MAIN_DEPENDENCY ${_input}
|
|
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
- COMMENT "Generating ${HELPER_ID}.policy"
|
|
- DEPENDS KF5::kauth-policy-gen)
|
|
+ if(CMAKE_CROSSCOMPILING)
|
|
+ add_custom_command(OUTPUT ${_output}
|
|
+ COMMAND "/usr/lib/libexec/kauth/kauth-policy-gen" ${_input} ${_output}
|
|
+ MAIN_DEPENDENCY ${_input}
|
|
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
+ COMMENT "Generating ${HELPER_ID}.policy"
|
|
+ DEPENDS KF5::kauth-policy-gen)
|
|
+ else()
|
|
+ add_custom_command(OUTPUT ${_output}
|
|
+ COMMAND KF5::kauth-policy-gen ${_input} ${_output}
|
|
+ MAIN_DEPENDENCY ${_input}
|
|
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
+ COMMENT "Generating ${HELPER_ID}.policy"
|
|
+ DEPENDS KF5::kauth-policy-gen)
|
|
+ endif()
|
|
add_custom_target(${HELPER_ID}.policy-customtarget ALL COMMENT "actions for ${HELPER_ID}" DEPENDS ${_output})
|
|
|
|
install(FILES ${_output} DESTINATION ${KAUTH_POLICY_FILES_INSTALL_DIR})
|