Commit 0d1cd177 authored by Simon Wächter's avatar Simon Wächter
Browse files

Switch to to the new ECM template function and clean up the preview images

parent 2dc20a70
cmake_minimum_required(VERSION 2.8.12)
project(kapptemplate)
find_package(ECM REQUIRED NO_MODULE)
find_package(ECM 5.17.0 NO_MODULE REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
include(ECMInstallIcons)
......@@ -9,8 +9,8 @@ include(ECMAddTests)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(KDEPackageAppTemplates)
include(FeatureSummary)
include(KAppTemplateMacro)
find_package(Qt5 REQUIRED COMPONENTS Test)
find_package(KF5 REQUIRED COMPONENTS CoreAddons ConfigWidgets Completion Archive KIO I18n DocTools)
......
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.
macro(kapptemplate_add_app_templates _templateNames)
foreach(_templateName ${ARGV})
get_filename_component(_tmp_file ${_templateName} ABSOLUTE)
get_filename_component(_baseName ${_tmp_file} NAME_WE)
if(WIN32)
set(_template ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.zip)
else(WIN32)
set(_template ${CMAKE_CURRENT_BINARY_DIR}/${_baseName}.tar.bz2)
endif(WIN32)
file(GLOB _files "${CMAKE_CURRENT_SOURCE_DIR}/${_templateName}/*")
set(_deps)
foreach(_file ${_files})
get_filename_component(_fileName ${_file} NAME)
string(COMPARE NOTEQUAL ${_fileName} .kdev_ignore _v1)
string(REGEX MATCH "\\.svn" _v2 ${_fileName})
if(WIN32)
string(REGEX MATCH "_svn" _v3 ${_fileName})
else(WIN32)
set(_v3 FALSE)
endif(WIN32)
if (_v1 AND NOT _v2 AND NOT _v3)
set(_deps ${_deps} ${_file})
endif (_v1 AND NOT _v2 AND NOT _v3)
endforeach(_file)
add_custom_target(${_baseName} ALL DEPENDS ${_template})
if(WIN32)
add_custom_command(OUTPUT ${_template}
COMMAND 7za ARGS a -r -tzip ${_template} ${CMAKE_CURRENT_SOURCE_DIR}/${_templateName}/*
DEPENDS ${_deps}
)
else(WIN32)
add_custom_command(OUTPUT ${_template}
COMMAND tar ARGS -c -C ${CMAKE_CURRENT_SOURCE_DIR}/${_templateName}
--exclude .kdev_ignore --exclude .svn --owner=root --group=root --numeric-owner
-j -f ${_template} .
DEPENDS ${_deps}
)
endif(WIN32)
install(FILES ${_template} DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/templates)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_template}")
endforeach(_templateName)
endmacro(kapptemplate_add_app_templates)
set(apptemplate_DIRS
set(APPTEMPLATE_DIRS
kapp4-qml
kde-frameworks5-simple
kde-frameworks5
......@@ -8,4 +8,4 @@ set(apptemplate_DIRS
akonadiserializer
)
kapptemplate_add_app_templates(${apptemplate_DIRS})
kde_package_app_templates(TEMPLATES ${APPTEMPLATE_DIRS} INSTALL_DIR ${KDE_INSTALL_KTEMPLATESDIR})
......@@ -80,4 +80,4 @@ Comment[x-test]=xxAkonadi Resource Template. A template for an Akonadi PIM data
Comment[zh_CN]=Akonadi 资源模板。Akonadi 个人信息管理数据资源的模板
Comment[zh_TW]=Akonadi 資源樣本。Akonadi PIM 資料資源的樣本。
Category=KDE/Akonadi Resource
Icon=akonadi-resources.png
Icon=akonadiresource.png
......@@ -79,4 +79,4 @@ Comment[x-test]=xxAkonadi Serializer Template. A template for an Akonadi data se
Comment[zh_CN]=Akonadi 数据转换器模板。Akonadi 数据转换器插件的模板
Comment[zh_TW]=Akonadi 序列器樣本。Akonadi 資料序列器外掛程式樣本
Category=KDE/Akonadi Serializer
Icon=akonadi-serializer.png
Icon=akonadiserializer.png
......@@ -76,5 +76,5 @@ Comment[x-test]=xxKDE4 simple template based on CMake, inherits from XMLGuiWindo
Comment[zh_CN]=基于 CMake,继承自 XMLGuiWindow 和演示如何使用 KConfig XT 和 QML 的 KDE4 简单模板
Comment[zh_TW]=KDE4 使用者介面的應用程式。基於 CMake 的 KDE4 簡單應用程式樣本,從 XMLGuiWindow 繼承而來,用於展示如何使用 KConfig XT 與 QML
Category=KDE/Graphical
Icon=kapp4.png
Icon=kapp4-qml.png
ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
......@@ -78,3 +78,4 @@ Comment[x-test]=xxKTextEditor Plugin Template. A KTextEditor plugin template to
Comment[zh_CN]=KTextEditor 插件模板。用于向 KWrite、Kate、KDevelop 中的文本进行特殊操作的 KTextEditor 插件模板(工程名称请使用 ThisFormat)
Comment[zh_TW]=KTextEditor 外掛程式樣本,用於 KWrite、Kate、KDevelop 等對文字的特殊操作。(專案名稱請使用此格式)
Category=KDE/Kate Plugin
Icon=ktexteditor.png
# TODO Move all templates to the templates "root" directory and update/improve the kapptemplate_add_app_templates
add_subdirectory(C++)
install(FILES C++/kapp4-qml/kapp4.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/kapp4-qml/kapp4-qml.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/kde-frameworks5-simple/kde-frameworks5-simple.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/kde-frameworks5/kde-frameworks5.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/kpartapp/kpartapp.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/akonadiresource/akonadi-resources.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/akonadiserializer/akonadi-serializer.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/akonadiresource/akonadiresource.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/akonadiserializer/akonadiserializer.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
install(FILES C++/ktexteditor/ktexteditor.png DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/template_previews)
Supports Markdown
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