From adaa6ead5160fa69eb707c63210d6995846de3de Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 13 May 2019 00:59:14 +0000 Subject: [PATCH] cmake modules review Signed-off-by: Ivailo Monev --- cmake/modules/FindDBus.cmake | 2 +- cmake/modules/FindFontconfig.cmake | 2 +- cmake/modules/FindGLib2.cmake | 2 +- cmake/modules/FindHarfBuzz.cmake | 2 +- cmake/modules/FindICU.cmake | 2 +- cmake/modules/FindIconv.cmake | 2 +- cmake/modules/FindMNG.cmake | 2 +- cmake/modules/FindMySQL.cmake | 2 +- cmake/modules/FindNIS.cmake | 2 +- cmake/modules/FindNSL.cmake | 2 +- cmake/modules/FindODBC.cmake | 2 +- cmake/modules/FindPCRE.cmake | 2 +- cmake/modules/FindResolv.cmake | 2 +- cmake/modules/FindShiboken.cmake | 4 ++++ cmake/modules/FindSqlite.cmake | 2 +- cmake/modules/KatieBuildMacros.cmake | 4 ++-- cmake/modules/KatieMacros.cmake | 20 ++++++++++---------- cmake/modules/OptimizeHeaders.cmake | 3 +++ 18 files changed, 33 insertions(+), 26 deletions(-) diff --git a/cmake/modules/FindDBus.cmake b/cmake/modules/FindDBus.cmake index 67407c342..477482457 100644 --- a/cmake/modules/FindDBus.cmake +++ b/cmake/modules/FindDBus.cmake @@ -6,7 +6,7 @@ # DBUS_ARCH_INCLUDES - the D-Bus message bus architecture include directory # DBUS_LIBRARIES - The libraries needed to use D-Bus message bus system # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindFontconfig.cmake b/cmake/modules/FindFontconfig.cmake index 4c3162307..14094a31a 100644 --- a/cmake/modules/FindFontconfig.cmake +++ b/cmake/modules/FindFontconfig.cmake @@ -5,7 +5,7 @@ # FONTCONFIG_INCLUDES - the Fontconfig include directory # FONTCONFIG_LIBRARIES - The libraries needed to use Fontconfig # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindGLib2.cmake b/cmake/modules/FindGLib2.cmake index e5689ed76..80736045b 100644 --- a/cmake/modules/FindGLib2.cmake +++ b/cmake/modules/FindGLib2.cmake @@ -6,7 +6,7 @@ # GLIB2_CONFIG_INCLUDES - the GLib2 config include directory # GLIB2_LIBRARIES - The libraries needed to use GLib2 # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindHarfBuzz.cmake b/cmake/modules/FindHarfBuzz.cmake index 737dec1fc..ad94d6eaa 100644 --- a/cmake/modules/FindHarfBuzz.cmake +++ b/cmake/modules/FindHarfBuzz.cmake @@ -5,7 +5,7 @@ # HARFBUZZ_INCLUDES - the HarfBuzz include directory # HARFBUZZ_LIBRARIES - The libraries needed to use HarfBuzz # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindICU.cmake b/cmake/modules/FindICU.cmake index 8fee52740..6f23c8231 100644 --- a/cmake/modules/FindICU.cmake +++ b/cmake/modules/FindICU.cmake @@ -5,7 +5,7 @@ # ICU_INCLUDES - the ICU include directory # ICU_LIBRARIES - The libraries needed to use ICU # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindIconv.cmake b/cmake/modules/FindIconv.cmake index 97eb634ae..cd455859f 100644 --- a/cmake/modules/FindIconv.cmake +++ b/cmake/modules/FindIconv.cmake @@ -5,7 +5,7 @@ # ICONV_INCLUDES - the Iconv include directory # ICONV_LIBRARIES - The libraries needed to use Iconv # -# Copyright (c) 2016, Ivailo Monev, +# Copyright (c) 2016-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindMNG.cmake b/cmake/modules/FindMNG.cmake index b633f60c7..64593f76f 100644 --- a/cmake/modules/FindMNG.cmake +++ b/cmake/modules/FindMNG.cmake @@ -5,7 +5,7 @@ # MNG_INCLUDES - the libmng include directory # MNG_LIBRARIES - The libraries needed to use libmng # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindMySQL.cmake b/cmake/modules/FindMySQL.cmake index 11724ff10..87c03c91c 100644 --- a/cmake/modules/FindMySQL.cmake +++ b/cmake/modules/FindMySQL.cmake @@ -5,7 +5,7 @@ # MYSQL_INCLUDES - the MySQL include directory # MYSQL_LIBRARIES - The libraries needed to use MySQL # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindNIS.cmake b/cmake/modules/FindNIS.cmake index 822a92408..3f0128acd 100644 --- a/cmake/modules/FindNIS.cmake +++ b/cmake/modules/FindNIS.cmake @@ -5,7 +5,7 @@ # NIS_INCLUDES - the NIS include directory # NIS_LIBRARIES - The libraries needed to use NIS # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindNSL.cmake b/cmake/modules/FindNSL.cmake index 10e0be5ba..2ef8c1d2e 100644 --- a/cmake/modules/FindNSL.cmake +++ b/cmake/modules/FindNSL.cmake @@ -5,7 +5,7 @@ # NSL_INCLUDES - the NSL include directory # NSL_LIBRARIES - The libraries needed to use NSL # -# Copyright (c) 2016, Ivailo Monev, +# Copyright (c) 2016-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindODBC.cmake b/cmake/modules/FindODBC.cmake index f0485b04f..a65a58648 100644 --- a/cmake/modules/FindODBC.cmake +++ b/cmake/modules/FindODBC.cmake @@ -5,7 +5,7 @@ # ODBC_INCLUDES - the ODBC include directory # ODBC_LIBRARIES - The libraries needed to use ODBC # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindPCRE.cmake b/cmake/modules/FindPCRE.cmake index ca5bd2908..e1c8fbab0 100644 --- a/cmake/modules/FindPCRE.cmake +++ b/cmake/modules/FindPCRE.cmake @@ -5,7 +5,7 @@ # PCRE_INCLUDES - the PCRE include directory # PCRE_LIBRARIES - The libraries needed to use PCRE # -# Copyright (c) 2016, Ivailo Monev, +# Copyright (c) 2016-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindResolv.cmake b/cmake/modules/FindResolv.cmake index 3cd913a0f..55e58dd65 100644 --- a/cmake/modules/FindResolv.cmake +++ b/cmake/modules/FindResolv.cmake @@ -5,7 +5,7 @@ # RESOLV_INCLUDES - the resolv include directory # RESOLV_LIBRARIES - The libraries needed to use resolv # -# Copyright (c) 2016, Ivailo Monev, +# Copyright (c) 2016-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/FindShiboken.cmake b/cmake/modules/FindShiboken.cmake index 58d03b5f2..b8166b13b 100644 --- a/cmake/modules/FindShiboken.cmake +++ b/cmake/modules/FindShiboken.cmake @@ -6,6 +6,10 @@ # SHIBOKEN_LIBRARIES - the libraries needed to use Shiboken # SHIBOKEN_BINARY - the binary needed to use Shiboken # SHIBOKEN_VERSION - the Shiboken version +# +# Copyright (c) 2019, Ivailo Monev, +# +# Redistribution and use is allowed according to the terms of the BSD license. if(SHIBOKEN_INCLUDES AND SHIBOKEN_LIBRARIES AND SHIBOKEN_BINARY) set(SHIBOKEN_FIND_QUIETLY TRUE) diff --git a/cmake/modules/FindSqlite.cmake b/cmake/modules/FindSqlite.cmake index 152178b0b..9bada09c4 100644 --- a/cmake/modules/FindSqlite.cmake +++ b/cmake/modules/FindSqlite.cmake @@ -5,7 +5,7 @@ # SQLITE_INCLUDES - the SQL database engine include directory # SQLITE_LIBRARIES - The libraries needed to use SQL database engine # -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/cmake/modules/KatieBuildMacros.cmake b/cmake/modules/KatieBuildMacros.cmake index 5979e5ab9..3c6a5e80b 100644 --- a/cmake/modules/KatieBuildMacros.cmake +++ b/cmake/modules/KatieBuildMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # Redistribution and use is allowed according to the terms of the BSD license. set(KATIE_UIC "uic") @@ -164,7 +164,7 @@ function(KATIE_SETUP_TARGET FORTARGET) file(READ "${resource}" rsccontent) if("${rsccontent}" MATCHES "(Q_OBJECT|Q_OBJECT_FAKE|Q_GADGET)") set(rscout "${rscpath}/moc_${rscname}${rscext}") - set(targetresources ${targetresources} ${rscout}) + set(targetresources "${targetresources} ${rscout}") get_directory_property(dirdefs COMPILE_DEFINITIONS) get_directory_property(dirincs INCLUDE_DIRECTORIES) set(mocargs) diff --git a/cmake/modules/KatieMacros.cmake b/cmake/modules/KatieMacros.cmake index 321468051..8cf320b0b 100644 --- a/cmake/modules/KatieMacros.cmake +++ b/cmake/modules/KatieMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2015, Ivailo Monev, +# Copyright (c) 2015-2019, Ivailo Monev, # Redistribution and use is allowed according to the terms of the BSD license. macro(KATIE_RESOURCES RESOURCES) @@ -11,7 +11,7 @@ macro(KATIE_RESOURCES RESOURCES) get_filename_component(rscpath ${resource} PATH) string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" rscpath "${rscpath}") if("${rscext}" STREQUAL ".ui") - set(rscout ${rscpath}/ui_${rscname}.h) + set(rscout "${rscpath}/ui_${rscname}.h") make_directory(${rscpath}) add_custom_command( COMMAND ${KATIE_UIC} "${resource}" -o "${rscout}" @@ -19,7 +19,7 @@ macro(KATIE_RESOURCES RESOURCES) MAIN_DEPENDENCY ${resource} ) elseif("${rscext}" STREQUAL ".qrc") - set(rscout ${rscpath}/qrc_${rscname}.cpp) + set(rscout "${rscpath}/qrc_${rscname}.cpp") make_directory(${rscpath}) add_custom_command( COMMAND ${KATIE_RCC} "${resource}" -o "${rscout}" -name "${rscname}" @@ -27,11 +27,11 @@ macro(KATIE_RESOURCES RESOURCES) MAIN_DEPENDENCY ${resource} ) set_property(SOURCE ${resource} APPEND PROPERTY OBJECT_DEPENDS ${rscout}) - elseif("${rscext}" MATCHES "(.h|.cpp|.mm)") + elseif("${rscext}" MATCHES "(.h|.hpp|.cc|.cpp)") file(READ "${resource}" rsccontent) # this can be simpler if continue() was supported by old CMake versions if("${rsccontent}" MATCHES "(Q_OBJECT|Q_OBJECT_FAKE|Q_GADGET)") - set(rscout ${rscpath}/moc_${rscname}${rscext}) + set(rscout "${rscpath}/moc_${rscname}${rscext}") get_directory_property(dirdefs COMPILE_DEFINITIONS) get_directory_property(dirincs INCLUDE_DIRECTORIES) set(mocargs) @@ -56,8 +56,8 @@ endmacro() macro(KATIE_DBUS_ADAPTOR SRCDEP SRCIN OUTNAME) get_filename_component(resource ${SRCIN} ABSOLUTE) - set(rscout ${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}.h) - set(mocout ${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}.moc) + set(rscout "${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}.h") + set(mocout "${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}.moc") add_custom_command( COMMAND "${KATIE_QDBUSXML2CPP}" -m "${resource}" -a "${rscout}" -p "${OUTNAME}" ${ARGN} COMMAND "${KATIE_MOC}" -nw "${rscout}" -o "${mocout}" -i @@ -69,9 +69,9 @@ endmacro() macro(KATIE_DBUS_INTERFACE SRCIN) string(REGEX MATCH ".*\\.(.*)\\.xml" ${SRCIN} OUTNAME) string(TOLOWER ${SRCIN} SRCIN) - set(rscout ${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}ineterface.h) + set(rscout "${CMAKE_CURRENT_BINARY_DIR}/${OUTNAME}interface.h") add_custom_command( - COMMAND "${KATIE_QDBUSXML2CPP}" -m "${SRCIN}" -a "${rscout}" -p "${OUTNAME}ineterface" ${ARGN} + COMMAND "${KATIE_QDBUSXML2CPP}" -m "${SRCIN}" -a "${rscout}" -p "${OUTNAME}interface" ${ARGN} OUTPUT "${rscout}" ) set_property(SOURCE ${SRCIN} APPEND PROPERTY OBJECT_DEPENDS ${rscout}) @@ -86,7 +86,7 @@ macro(KATIE_TRANSLATIONS TRANSLATIONS) get_filename_component(trdir ${translation} DIRECTORY) string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" trdir ${trdir}) make_directory(${trdir}) - set(trout ${trdir}/${trname}.qm) + set(trout "${trdir}/${trname}.qm") add_custom_target( ${trname}_translation ALL COMMAND "${KATIE_LRELEASE}" "${translation}" -qm "${trout}" diff --git a/cmake/modules/OptimizeHeaders.cmake b/cmake/modules/OptimizeHeaders.cmake index c8f07a16a..4cfc72d13 100644 --- a/cmake/modules/OptimizeHeaders.cmake +++ b/cmake/modules/OptimizeHeaders.cmake @@ -1,3 +1,6 @@ +# Copyright (c) 2015-2019, Ivailo Monev, +# Redistribution and use is allowed according to the terms of the BSD license. + # UNIFDEF_EXECUTABLE, HEADERS_DIRECTORY and HEADERS_DEFINITIONS origin from the macro call file(GLOB headers "$ENV{DESTDIR}/${HEADERS_DIRECTORY}/*.h")