Thanks, applied as 7b0eaf35f9a01a047a345c3b053f663a3b838cf5.

Michael

[sent from post-receive hook]

On Fri, 29 Jul 2022 08:23:43 +0200, Alexander Dahl <[email protected]> wrote:
> Most things in that 'CMakeLists.txt' were out of date and/or
> distracting.  Rework towards a sane minimal modern version:
> 
> - bump minimum required CMake version (3.1 has most things you need for
> "Modern CMake", 3.0 lacks some useful things for that)
> - add recommended 'project' command
> - avoid source file globbing
> - throw out all comments (especially those relating to Qt4)
> 
> Additionally the source file which contained C code only, was renamed to
> .c so CMake can call a C compiler for that (instead of the heavy C++
> stuff).
> 
> Signed-off-by: Alexander Dahl <[email protected]>
> Message-Id: <[email protected]>
> Signed-off-by: Michael Olbrich <[email protected]>
> 
> diff --git a/rules/templates/src-cmake-prog/@[email protected] 
> b/rules/templates/src-cmake-prog/@[email protected]
> similarity index 100%
> rename from rules/templates/src-cmake-prog/@[email protected]
> rename to rules/templates/src-cmake-prog/@[email protected]
> diff --git a/rules/templates/src-cmake-prog/CMakeLists.txt 
> b/rules/templates/src-cmake-prog/CMakeLists.txt
> index bc81d861c721..8baf3f64ec0f 100644
> --- a/rules/templates/src-cmake-prog/CMakeLists.txt
> +++ b/rules/templates/src-cmake-prog/CMakeLists.txt
> @@ -1,34 +1,8 @@
> -
> -cmake_minimum_required(VERSION 2.6.0)
> -
> -#SET(QT_MIN_VERSION "4.5.0")
> -#FIND_PACKAGE(Qt4 REQUIRED)
> -
> -file (GLOB SRC_FILES *.cpp)
> -
> -#set (FILES_TO_TRANSLATE ${SRC_FILES})
> -#file (GLOB TRANSLATIONS_FILES *.ts)
> -#
> -#option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts
> -#files(WARNING: make clean will delete the source .ts files! Danger!)")
> -#
> -#if(UPDATE_TRANSLATIONS)
> -#  qt4_create_translation(QM_FILES ${FILES_TO_TRANSLATE} 
> ${TRANSLATIONS_FILES})
> -#else(UPDATE_TRANSLATIONS)
> -#  qt4_add_translation(QM_FILES ${TRANSLATIONS_FILES})
> -#endif(UPDATE_TRANSLATIONS)
> +cmake_minimum_required(VERSION 3.1)
> +project(@name@)
>  
>  add_executable(@name@
> -     ${SRC_FILES}
> -#    ${QM_FILES}
> +     @[email protected]
>  )
>  
> -#target_link_libraries(@name@
> -#    ${QT_QTCORE_LIBRARY}
> -#    ${QT_QTGUI_LIBRARY}
> -#)
> -#
> -#include_directories(${QT_INCLUDE_DIR})
> -
>  install(TARGETS @name@ RUNTIME DESTINATION bin)
> -
> diff --git a/rules/templates/src-cmake-prog/wizard.sh 
> b/rules/templates/src-cmake-prog/wizard.sh
> index 253eedca9cce..8f2903bf0f24 100644
> --- a/rules/templates/src-cmake-prog/wizard.sh
> +++ b/rules/templates/src-cmake-prog/wizard.sh
> @@ -7,11 +7,11 @@ if [ -z "$NAME" ]; then
>  fi
>  NAME_UP="$(echo $NAME | tr '[a-z-]' '[A-Z_]')"
>  
> -mv "@[email protected]" "${NAME}.cpp"
> +mv "@[email protected]" "${NAME}.c"
>  
>  for i in \
>       CMakeLists.txt \
> -     "${NAME}.cpp" \
> +     "${NAME}.c" \
>  ; do
>       sed -i -e "s/\@name\@/${NAME}/g" \
>              -e "s/\@NAME\@/${NAME_UP}/g" $i

Reply via email to