summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Wächter <waechter.simon@gmail.com>2016-09-06 12:12:38 (GMT)
committerSimon Wächter <waechter.simon@gmail.com>2016-09-06 12:12:38 (GMT)
commit0d1cd177f7477c0c362afffc535b4e39c650a09e (patch)
treee7e1d75750b78a5b0b41e6e606b46aae744cfa2f
parent2dc20a70374000335bdc29038c01f0db394787f6 (diff)
Switch to to the new ECM template function and clean up the preview images
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/modules/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/modules/KAppTemplateMacro.cmake49
-rw-r--r--src/templates/C++/CMakeLists.txt4
-rw-r--r--src/templates/C++/akonadiresource/akonadiresource.kdevtemplate2
-rw-r--r--src/templates/C++/akonadiresource/akonadiresource.png (renamed from src/templates/C++/akonadiresource/akonadi-resources.png)bin69059 -> 69059 bytes
-rw-r--r--src/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate2
-rw-r--r--src/templates/C++/akonadiserializer/akonadiserializer.png (renamed from src/templates/C++/akonadiserializer/akonadi-serializer.png)bin14537 -> 14537 bytes
-rw-r--r--src/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate2
-rw-r--r--src/templates/C++/kapp4-qml/kapp4-qml.png (renamed from src/templates/C++/kapp4-qml/kapp4.png)bin9750 -> 9750 bytes
-rw-r--r--src/templates/C++/ktexteditor/_ktexteditor.pngbin0 -> 85349 bytes
-rw-r--r--src/templates/C++/ktexteditor/ktexteditor.kdevtemplate1
-rw-r--r--src/templates/C++/ktexteditor/ktexteditor.pngbin0 -> 9829 bytes
-rw-r--r--src/templates/CMakeLists.txt9
14 files changed, 12 insertions, 83 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 739149d..43bd8b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
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)
diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/cmake/modules/COPYING-CMAKE-SCRIPTS
deleted file mode 100644
index 4b41776..0000000
--- a/cmake/modules/COPYING-CMAKE-SCRIPTS
+++ /dev/null
@@ -1,22 +0,0 @@
-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.
diff --git a/cmake/modules/KAppTemplateMacro.cmake b/cmake/modules/KAppTemplateMacro.cmake
deleted file mode 100644
index 03a35a7..0000000
--- a/cmake/modules/KAppTemplateMacro.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-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)
diff --git a/src/templates/C++/CMakeLists.txt b/src/templates/C++/CMakeLists.txt
index f4ee99a..0b713c4 100644
--- a/src/templates/C++/CMakeLists.txt
+++ b/src/templates/C++/CMakeLists.txt
@@ -1,4 +1,4 @@
-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})
diff --git a/src/templates/C++/akonadiresource/akonadiresource.kdevtemplate b/src/templates/C++/akonadiresource/akonadiresource.kdevtemplate
index ffa183d..c9ce2f2 100644
--- a/src/templates/C++/akonadiresource/akonadiresource.kdevtemplate
+++ b/src/templates/C++/akonadiresource/akonadiresource.kdevtemplate
@@ -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
diff --git a/src/templates/C++/akonadiresource/akonadi-resources.png b/src/templates/C++/akonadiresource/akonadiresource.png
index 8513893..8513893 100644
--- a/src/templates/C++/akonadiresource/akonadi-resources.png
+++ b/src/templates/C++/akonadiresource/akonadiresource.png
Binary files differ
diff --git a/src/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate b/src/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate
index 3ba519d..eed00e8 100644
--- a/src/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate
+++ b/src/templates/C++/akonadiserializer/akonadiserializer.kdevtemplate
@@ -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
diff --git a/src/templates/C++/akonadiserializer/akonadi-serializer.png b/src/templates/C++/akonadiserializer/akonadiserializer.png
index bad28b7..bad28b7 100644
--- a/src/templates/C++/akonadiserializer/akonadi-serializer.png
+++ b/src/templates/C++/akonadiserializer/akonadiserializer.png
Binary files differ
diff --git a/src/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate b/src/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate
index b853241..d4e5f9c 100644
--- a/src/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate
+++ b/src/templates/C++/kapp4-qml/kapp4-qml.kdevtemplate
@@ -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
diff --git a/src/templates/C++/kapp4-qml/kapp4.png b/src/templates/C++/kapp4-qml/kapp4-qml.png
index cb40c34..cb40c34 100644
--- a/src/templates/C++/kapp4-qml/kapp4.png
+++ b/src/templates/C++/kapp4-qml/kapp4-qml.png
Binary files differ
diff --git a/src/templates/C++/ktexteditor/_ktexteditor.png b/src/templates/C++/ktexteditor/_ktexteditor.png
new file mode 100644
index 0000000..2915c13
--- /dev/null
+++ b/src/templates/C++/ktexteditor/_ktexteditor.png
Binary files differ
diff --git a/src/templates/C++/ktexteditor/ktexteditor.kdevtemplate b/src/templates/C++/ktexteditor/ktexteditor.kdevtemplate
index 90e7d3b..81c4de0 100644
--- a/src/templates/C++/ktexteditor/ktexteditor.kdevtemplate
+++ b/src/templates/C++/ktexteditor/ktexteditor.kdevtemplate
@@ -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
diff --git a/src/templates/C++/ktexteditor/ktexteditor.png b/src/templates/C++/ktexteditor/ktexteditor.png
new file mode 100644
index 0000000..6237233
--- /dev/null
+++ b/src/templates/C++/ktexteditor/ktexteditor.png
Binary files differ
diff --git a/src/templates/CMakeLists.txt b/src/templates/CMakeLists.txt
index 1c308c9..6093e6b 100644
--- a/src/templates/CMakeLists.txt
+++ b/src/templates/CMakeLists.txt
@@ -1,10 +1,9 @@
-# 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)