[plasma-framework] /: Add KDETemplateMacro.cmake so I can remove it from ecm for now.

Alex Merry alex.merry at kde.org
Thu Dec 3 12:28:19 UTC 2015


Sorry, I did reply to your commit email directly, but didn't get a response from you, and then ran out of time. I have no objection to ecm having a macro like this, but the module wasn't up to scratch for ecm, and once it's in a release, we can't break compatibility. Given the module name was one of the things I wasn't happy with, keeping it out of this weekend's release was a priority for me.

ECM discussions don't need to be global, but kde-buildsystem should really be involved.

Can we revisit adding this to ecm next week?

Alex

PS: sorry for top-posting - I'm writing on my phone.

On 3 December 2015 10:12:04 GMT+00:00, Marco Martin <notmart at gmail.com> wrote:
>Hi,
>Where was the decision about this?
>
>To make it global wasn't admittedly a big discussion, but seemed quite
>agreed 
>that templates were going inside the framework themselves
>(note that this commit will break kapptemplate itself as well since was
>going 
>to not have its own macro as well)
>
>On Thursday 03 December 2015, Alex Merry wrote:
>> Git commit 2d814f049b496542dde17b4049679b8a0b7e1d9d by Alex Merry.
>> Committed on 03/12/2015 at 10:02.
>> Pushed by alexmerry into branch 'master'.
>> 
>> Add KDETemplateMacro.cmake so I can remove it from ecm for now.
>> 
>> See emails on kde-commits mailing list for rationale.
>> 
>> CCMAIL: notmart at gmail.com
>> 
>> M  +1    -1    CMakeLists.txt
>> A  +49   -0    cmake/KDETemplateMacro.cmake
>> 
>>
>http://commits.kde.org/plasma-framework/2d814f049b496542dde17b4049679b8a0b7
>> e1d9d
>> 
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index 70f8965..66fb847 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -8,7 +8,7 @@ find_package(ECM 5.16.0  NO_MODULE)
>>  set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION
>"Extra
>> CMake Modules." URL
>> "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
>> feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND
>> FATAL_ON_MISSING_REQUIRED_PACKAGES)
>> 
>> -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
>> +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}
>> ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
>> 
>> 
>>  include(GenerateExportHeader)
>> diff --git a/cmake/KDETemplateMacro.cmake
>b/cmake/KDETemplateMacro.cmake
>> new file mode 100644
>> index 0000000..796c3f1
>> --- /dev/null
>> +++ b/cmake/KDETemplateMacro.cmake
>> @@ -0,0 +1,49 @@
>> +macro(kdetemplate_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()
>> +
>> +
>> +        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()
>> +            if (_v1 AND NOT _v2 AND NOT _v3)
>> +                set(_deps ${_deps} ${_file})
>> +            endif ()
>> +        endforeach()
>> +
>> +        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
>> +                    -j -f ${_template} .
>> +                DEPENDS ${_deps}
>> +            )
>> +        endif()
>> +
>> +        install(FILES ${_template} DESTINATION
>> ${DATA_INSTALL_DIR}/kdevappwizard/templates) +       
>> set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
>> "${_template}") +
>> +    endforeach()
>> +endmacro()
>
>
>-- 
>Marco Martin

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20151203/5b58fbe2/attachment.html>


More information about the Kde-buildsystem mailing list