Commit 85899798 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port disbaled providers to kaccounts macros

Probably no one will ever care, but it allows us to get rid of the direct intltool usage and the FindAccountsFileDir in kaccounts-integration.

Also introduce a cmake option for enabling the disabled providers
parent f779aed3
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.12)
find_package(ECM 1.0.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 5.2.0 CONFIG REQUIRED Core Widgets DBus)
find_package(KF5 5.11 REQUIRED KCMUtils KIO I18n WidgetsAddons Codecs CoreAddons ConfigWidgets IconThemes ItemViews)
......@@ -21,7 +21,6 @@ set(IS_KTP_INTERNAL_MODULE TRUE)
find_package (TelepathyQt5 REQUIRED)
find_package (KAccounts REQUIRED)
find_package (Intltool REQUIRED) #needed to generate service and provider files
set(CMAKE_MODULE_PATH ${KACCOUNTS_MACROS_PATH} ${CMAKE_MODULE_PATH}) #for KAccountsMacros
......@@ -44,6 +43,8 @@ add_definitions (
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src
${TELEPATHY_QT5_INCLUDE_DIR})
option(BUILD_DISABLED_PROVIDERS "Build providers that are disabled by default" OFF)
add_subdirectory (src)
add_subdirectory (data)
add_subdirectory (plugins)
......
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# cmake/Intltool.cmake
# Copyright (C) 2013, Valama development team
#
# Valama is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Valama is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
##
find_program(INTLTOOL_EXTRACT_EXECUTABLE intltool-extract)
find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge)
mark_as_advanced(INTLTOOL_EXTRACT_EXECUTABLE)
mark_as_advanced(INTLTOOL_MERGE_EXECUTABLE)
if(INTLTOOL_EXTRACT_EXECUTABLE)
execute_process(
COMMAND
${INTLTOOL_EXTRACT_EXECUTABLE} "--version"
OUTPUT_VARIABLE
intltool_version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(intltool_version MATCHES "^intltool-extract \\(.*\\) [0-9]")
string(REGEX REPLACE "^intltool-extract \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" INTLTOOL_VERSION_STRING "${intltool_version}")
endif()
unset(intltool_version)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Intltool
REQUIRED_VARS
INTLTOOL_EXTRACT_EXECUTABLE
INTLTOOL_MERGE_EXECUTABLE
VERSION_VAR
INTLTOOL_VERSION_STRING
)
set(INTLTOOL_OPTIONS_DEFAULT
"--quiet"
)
\ No newline at end of file
......@@ -7,3 +7,7 @@ file(GLOB provider_in_files *.provider.in)
foreach(provider_in_file ${provider_in_files})
kaccounts_add_provider(${provider_in_file})
endforeach()
if(${BUILD_DISABLED_PROVIDERS})
add_subdirectory(disabled)
endif()
cmake_minimum_required(VERSION 2.8.12)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/modules ${CMAKE_MODULE_PATH})
find_package (AccountsFileDir REQUIRED)
find_package (Intltool REQUIRED) #needed to generate service and provider files
include(FeatureSummary)
file(GLOB provider_in_files *.provider.in)
foreach(provider_in_file ${provider_in_files})
kaccounts_add_provider(${provider_in_file})
endforeach()
file(GLOB service_files_in *.service.in)
foreach(service_file_in ${service_files_in})
get_filename_component(service_filename ${service_file_in} NAME_WE)
set(service_file ${CMAKE_CURRENT_BINARY_DIR}/${service_filename}.service)
execute_process(COMMAND intltool-merge -x -u --no-translations ${service_file_in} ${service_file})
install(FILES ${service_file} DESTINATION ${ACCOUNTS_SERVICES_DIR})
endforeach()
file(GLOB provider_in_files *.provider.in)
foreach(provider_in_file ${provider_in_files})
get_filename_component(provider_filename ${provider_in_file} NAME_WE)
set(provider_file ${CMAKE_CURRENT_BINARY_DIR}/${provider_filename}.provider)
execute_process(COMMAND intltool-merge -x -u --no-translations ${provider_in_file} ${provider_file})
install(FILES ${provider_file} DESTINATION ${ACCOUNTS_PROVIDERS_DIR})
kaccounts_add_service(${service_file_in})
endforeach()
......@@ -2,9 +2,8 @@ This folder contains provider/service files for services or accounts that are
either currently broken or not properly supported. You can install these at
your own risk and play around, but please don't report any bugs for these.
You can install these by executing:
You can install these by adding -DBUILD_DISABLED_PROVIDERS=On to your cmake call.
mkdir -p build && cd build && cmake .. && make install
===============================================================================
......
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