Commit 9e807e16 authored by Camilo higuita's avatar Camilo higuita

fixes and updates for mauikit

parent f8830fd8
breeze-icons @ cc72e254
Subproject commit cc72e254a34e24e07e62148e5b2ce91326a43f2b
{
"phabricator.uri" : "https://phabricator.kde.org/"
}
[Dolphin]
Timestamp=2018,9,12,11,52,3
Version=4
cmake_minimum_required(VERSION 3.0)
set(KF5_VERSION "5.45.0") # handled by release scripts
set(KF5_DEP_VERSION "5.45.0") # handled by release scripts
project(kirigami2 VERSION ${KF5_VERSION})
set(REQUIRED_QT_VERSION 5.8.0)
SET(CMAKE_CXX_STANDARD 11)
################# Disallow in-source build #################
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "kirigami requires an out of source build. Please create a separate build directory and run 'cmake path_to_kirigami [options]' there.")
endif()
option(BUILD_SHARED_LIBS "Build a shared module" ON)
option(DESKTOP_ENABLED "Build and install The Desktop style" ON)
option(STATIC_LIBRARY "Build as a static library (deprecated, use BUILD_SHARED_LIBS instead)" OFF)
option(BUILD_EXAMPLES "Build and install examples" OFF)
if(NOT BUILD_SHARED_LIBS)
set(STATIC_LIBRARY 1)
elseif(STATIC_LIBRARY)
set(BUILD_SHARED_LIBS 0)
endif()
# Make CPack available to easy generate binary packages
include(CPack)
include(FeatureSummary)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Gui Svg QuickControls2)
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
set(CMAKE_AUTOMOC ON)
set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.kirigami)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(STATIC_LIBRARY)
add_definitions(-DKIRIGAMI_BUILD_TYPE_STATIC)
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_STATICPLUGIN=1)
else(STATIC_LIBRARY)
add_subdirectory(autotests)
endif(STATIC_LIBRARY)
################# set KDE specific information #################
find_package(ECM 5.45.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(CMakePackageConfigHelpers)
include(ECMPoQmTools)
include(ECMQMLModules)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddQch)
include(KDECompilerSettings NO_POLICY_SCOPE)
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Kirigami2")
option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF)
add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5Kirigami2Config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2Config.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
PATH_VARS KF5_INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2ConfigVersion.cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/KF5Kirigami2Macros.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5Kirigami2Targets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KF5Kirigami2Targets.cmake
NAMESPACE KF5::
)
ecm_setup_version(${KF5_VERSION}
VARIABLE_PREFIX KIRIGAMI2
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kirigami_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5Kirigami2ConfigVersion.cmake"
SOVERSION 5
)
if(BUILD_EXAMPLES AND CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION} REQUIRED)
endif()
ecm_find_qmlmodule(QtGraphicalEffects 1.0)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(src)
if (BUILD_EXAMPLES AND NOT STATIC_LIBRARY)
add_subdirectory(examples)
endif()
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
ecm_install_po_files_as_qm(po)
endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt5Core @REQUIRED_QT_VERSION@)
# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file.
include("${CMAKE_CURRENT_LIST_DIR}/KF5Kirigami2Targets.cmake")
set(Kirigami2_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
#set(Kirigami2_LIBRARIES KF5::Kirigami2)
include("${CMAKE_CURRENT_LIST_DIR}/KF5Kirigami2Macros.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
include(CMakeParseArguments)
include(ExternalProject)
function(kirigami_package_breeze_icons)
set(_multiValueArgs ICONS)
cmake_parse_arguments(ARG "" "" "${_multiValueArgs}" ${ARGN} )
if(NOT ARG_ICONS)
message(FATAL_ERROR "No ICONS argument given to kirigami_package_breeze_icons")
endif()
#include icons used by Kirigami components themselves
set(ARG_ICONS ${ARG_ICONS} go-next go-previous go-up handle-left handle-right go-next-symbolic go-next-symbolic-rtl go-previous-symbolic go-previous-symbolic-rtl overflow-menu)
function(_find_breeze_icon icon varName)
#HACKY
SET(path "")
file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/48/${icon}.svg )
#seach in other sizes as well
if (NOT EXISTS ${path})
file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/32/${icon}.svg )
if (NOT EXISTS ${path})
file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/22/${icon}.svg )
endif()
endif()
if (NOT EXISTS ${path})
file(GLOB_RECURSE path ${_BREEZEICONS_DIR}/icons/*/symbolic/${icon}.svg )
endif()
if (NOT EXISTS ${path})
return()
endif()
get_filename_component(path "${path}" REALPATH)
SET(${varName} ${path} PARENT_SCOPE)
endfunction()
if (BREEZEICONS_DIR AND NOT EXISTS ${BREEZEICONS_DIR})
message(FATAL_ERROR "BREEZEICONS_DIR variable does not point to existing dir: \"${BREEZEICONS_DIR}\"")
endif()
set(_BREEZEICONS_DIR "${BREEZEICONS_DIR}")
#FIXME: this is a terrible hack
if(NOT _BREEZEICONS_DIR)
set(_BREEZEICONS_DIR "${CMAKE_BINARY_DIR}/breeze-icons/src/breeze-icons")
# replacement for ExternalProject_Add not yet working
# first time config?
if (NOT EXISTS ${_BREEZEICONS_DIR})
find_package(Git)
execute_process(COMMAND ${GIT_EXECUTABLE} clone --depth 1 git://anongit.kde.org/breeze-icons.git ${_BREEZEICONS_DIR})
endif()
# external projects are only pulled at make time, not configure time
# so this is too late to work with the _find_breeze_icon() method
# _find_breeze_icon() would need to be turned into a target/command
if (FALSE)
ExternalProject_Add(
breeze-icons
PREFIX breeze-icons
GIT_REPOSITORY git://anongit.kde.org/breeze-icons.git
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)
endif()
endif()
message (STATUS "Found external breeze icons:")
foreach(_iconName ${ARG_ICONS})
set(_iconPath "")
_find_breeze_icon(${_iconName} _iconPath)
message (STATUS ${_iconPath})
if (EXISTS ${_iconPath})
install(FILES ${_iconPath} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2/icons/ RENAME ${_iconName}.svg)
endif()
endforeach()
endfunction()
This diff is collapsed.
/*
This file is part of Kirigami
Copyright (C) 2016 Marco Martin <mart@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2, or
(at your option) any later version.
This program 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 Library General Public License for more details
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the
Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/