Commit 3b3842d1 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Add error message if intltool-merge is not found

Users of the kaccounts_add_* macros are supposed to do a
find_package(Intltool REQUIRED), but if they don't the build fails with
a rather obscure message (`make install` fails because the service or
provider file was not generated).

This error message will at least make the life of packagers a bit
easier.

BUG: 378932

Differential Revision: https://phabricator.kde.org/D6114
parent 38fe8ffb
......@@ -5,6 +5,10 @@ function(kaccounts_add_provider provider_in_file)
get_filename_component(provider_filename ${provider_in_file} NAME_WE)
set(provider_file ${CMAKE_CURRENT_BINARY_DIR}/${provider_filename}.provider)
find_program(INTLTOOL_MERGE intltool-merge)
if(NOT INTLTOOL_MERGE)
message(FATAL_ERROR "Could not find required intltool-merge executable.")
endif()
execute_process(COMMAND intltool-merge -x -u --no-translations ${provider_in_file} ${provider_file} ERROR_VARIABLE intltool_error)
if(intltool_error)
message(FATAL_ERROR "error processing ${provider_in_file}: ${intltool_error}")
......@@ -20,6 +24,10 @@ function(kaccounts_add_service service_file_in)
get_filename_component(service_filename ${service_file_in} NAME_WE)
set(service_file ${CMAKE_CURRENT_BINARY_DIR}/${service_filename}.service)
find_program(INTLTOOL_MERGE intltool-merge)
if(NOT INTLTOOL_MERGE)
message(FATAL_ERROR "Could not find required intltool-merge executable.")
endif()
execute_process(COMMAND intltool-merge -x -u --no-translations ${service_file_in} ${service_file} ERROR_VARIABLE intltool_error)
if(intltool_error)
message(FATAL_ERROR "error processing ${service_file_in}: ${intltool_error}")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment