[magics] 01/05: Enable Qt5.

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Aug 28 11:20:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository magics.

commit a901c8e023e7ea02d7ef29cf685d03a77c9eb141
Merge: a0458b9 9c4f62c
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Jul 29 10:36:14 2015 +0100

    Enable Qt5.

 debian/changelog         |  6 ++++
 debian/control           |  5 ++-
 debian/patches/qt5.patch | 94 ++++++++++++++++++++++++++++++++++--------------
 debian/patches/series    |  2 +-
 debian/rules             |  6 ++--
 5 files changed, 81 insertions(+), 32 deletions(-)

diff --cc debian/changelog
index 1a0d892,4689450..7dd016d
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,9 -1,3 +1,15 @@@
++magics++ (2.24.7-4) UNRELEASED; urgency=medium
++
++  * Move Qt4 -> Qt5 
++
++ -- Alastair McKinstry <mckinstry at debian.org>  Wed, 29 Jul 2015 10:36:42 +0100
++
 +magics++ (2.24.7-3) experimental; urgency=medium
 +
 +  * Build against new netcdf (4.4.0). Closes: #793882.
 +
 + -- Alastair McKinstry <mckinstry at debian.org>  Tue, 28 Jul 2015 13:32:09 +0100
 +
  magics++ (2.24.7-2) unstable; urgency=medium
  
    * Drop timestamps from headers. Closes: #792824. 
diff --cc debian/patches/qt5.patch
index ab0001a,3630537..56bfe03
--- a/debian/patches/qt5.patch
+++ b/debian/patches/qt5.patch
@@@ -1,13 -1,13 +1,13 @@@
- uthor: Alastair McKinstry <mckinstry at debian.org>
- Description: Port from Qt4 -> Qt5
- Last-Updated: 2014-10-16
+ Author: Alastair McKinstry <mckinstry at debian.org>
+ Description: Changes for Qt4 -> Qt5
 -Last-Updated: 2015-05-17
++Last-Updated: 2015-07-30
  Forwarded: no
  
- Index: magics++-2.22.7.dfsg.1/src/drivers/QtDriver.cc
+ Index: magics++-2.24.7/src/drivers/QtDriver.cc
  ===================================================================
- --- magics++-2.22.7.dfsg.1.orig/src/drivers/QtDriver.cc
- +++ magics++-2.22.7.dfsg.1/src/drivers/QtDriver.cc
- @@ -1231,12 +1231,12 @@ MAGICS_NO_EXPORT void QtDriver::renderTe
+ --- magics++-2.24.7.orig/src/drivers/QtDriver.cc
+ +++ magics++-2.24.7/src/drivers/QtDriver.cc
+ @@ -1238,12 +1238,12 @@ MAGICS_NO_EXPORT void QtDriver::renderTe
   			tr.scale(1.,-1.);
   			tr.translate(-x,-y);
   			item->setTransform(tr);
@@@ -33,24 -33,568 +33,50 @@@
   				
   				QTransform tr;
   				tr.scale(1.,-1.);
- Index: magics++-2.22.7.dfsg.1/CMakeLists.txt
 -Index: magics++-2.24.7/cmake/Qt5Macros.cmake
 -===================================================================
 ---- /dev/null
 -+++ magics++-2.24.7/cmake/Qt5Macros.cmake
 -@@ -0,0 +1,509 @@
 -+#.rst:
 -+# Qt5Macros
 -+# ---------
 -+#
 -+#
 -+#
 -+# This file is included by FindQt5.cmake, don't include it directly.
 -+
 -+#=============================================================================
 -+# Copyright 2005-2009 Kitware, Inc.
 -+#
 -+# Distributed under the OSI-approved BSD License (the "License");
 -+# see accompanying file Copyright.txt for details.
 -+#
 -+# This software is distributed WITHOUT ANY WARRANTY; without even the
 -+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 -+# See the License for more information.
 -+#=============================================================================
 -+# (To distribute this file outside of CMake, substitute the full
 -+#  License text for the above reference.)
 -+
 -+
 -+######################################
 -+#
 -+#       Macros for building Qt files
 -+#
 -+######################################
 -+
 -+
 -+macro (QT5_EXTRACT_OPTIONS _qt5_files _qt5_options _qt5_target)
 -+  set(${_qt5_files})
 -+  set(${_qt5_options})
 -+  set(_QT5_DOING_OPTIONS FALSE)
 -+  set(_QT5_DOING_TARGET FALSE)
 -+  foreach(_currentArg ${ARGN})
 -+    if ("x${_currentArg}" STREQUAL "xOPTIONS")
 -+      set(_QT5_DOING_OPTIONS TRUE)
 -+    elseif ("x${_currentArg}" STREQUAL "xTARGET")
 -+      set(_QT5_DOING_TARGET TRUE)
 -+    else ()
 -+      if(_QT5_DOING_TARGET)
 -+        set(${_qt5_target} "${_currentArg}")
 -+      elseif(_QT5_DOING_OPTIONS)
 -+        list(APPEND ${_qt5_options} "${_currentArg}")
 -+      else()
 -+        list(APPEND ${_qt5_files} "${_currentArg}")
 -+      endif()
 -+    endif ()
 -+  endforeach()
 -+endmacro ()
 -+
 -+
 -+# macro used to create the names of output files preserving relative dirs
 -+macro (QT5_MAKE_OUTPUT_FILE infile prefix ext outfile )
 -+  string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
 -+  string(LENGTH ${infile} _infileLength)
 -+  set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
 -+  if(_infileLength GREATER _binlength)
 -+    string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
 -+    if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
 -+      file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
 -+    else()
 -+      file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
 -+    endif()
 -+  else()
 -+    file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
 -+  endif()
 -+  if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path
 -+    set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
 -+  endif()
 -+  set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
 -+  string(REPLACE ".." "__" _outfile ${_outfile})
 -+  get_filename_component(outpath ${_outfile} PATH)
 -+  get_filename_component(_outfile ${_outfile} NAME_WE)
 -+  file(MAKE_DIRECTORY ${outpath})
 -+  set(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
 -+endmacro ()
 -+
 -+
 -+macro (QT5_GET_MOC_FLAGS _moc_flags)
 -+  set(${_moc_flags})
 -+  get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
 -+
 -+  foreach(_current ${_inc_DIRS})
 -+    if("${_current}" MATCHES "\\.framework/?$")
 -+      string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
 -+      set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
 -+    else()
 -+      set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
 -+    endif()
 -+  endforeach()
 -+
 -+  get_directory_property(_defines COMPILE_DEFINITIONS)
 -+  foreach(_current ${_defines})
 -+    set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
 -+  endforeach()
 -+
 -+  if(Q_WS_WIN)
 -+    set(${_moc_flags} ${${_moc_flags}} -DWIN32)
 -+  endif()
 -+
 -+endmacro()
 -+
 -+
 -+# helper macro to set up a moc rule
 -+function (QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
 -+  # For Windows, create a parameters file to work around command line length limit
 -+  # Pass the parameters in a file.  Set the working directory to
 -+  # be that containing the parameters file and reference it by
 -+  # just the file name.  This is necessary because the moc tool on
 -+  # MinGW builds does not seem to handle spaces in the path to the
 -+  # file given with the @ syntax.
 -+  get_filename_component(_moc_outfile_name "${outfile}" NAME)
 -+  get_filename_component(_moc_outfile_dir "${outfile}" PATH)
 -+  if(_moc_outfile_dir)
 -+    set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
 -+  endif()
 -+  set (_moc_parameters_file ${outfile}_parameters)
 -+  set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
 -+  string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
 -+
 -+  if(moc_target)
 -+    set (_moc_parameters_file ${_moc_parameters_file}$<$<BOOL:$<CONFIGURATION>>:_$<CONFIGURATION>>)
 -+    set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
 -+    set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
 -+
 -+    set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>")
 -+    set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>")
 -+
 -+    file (GENERATE
 -+      OUTPUT ${_moc_parameters_file}
 -+      CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
 -+    )
 -+
 -+    set(targetincludes)
 -+    set(targetdefines)
 -+  else()
 -+    set(CMAKE_CONFIGURABLE_FILE_CONTENT "${_moc_parameters}")
 -+    configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
 -+                   "${_moc_parameters_file}" @ONLY)
 -+  endif()
 -+
 -+  set(_moc_extra_parameters_file @${_moc_parameters_file})
 -+  add_custom_command(OUTPUT ${outfile}
 -+                      COMMAND Qt5::moc ${_moc_extra_parameters_file}
 -+                      DEPENDS ${infile} ${_moc_parameters_file}
 -+                      ${_moc_working_dir}
 -+                      VERBATIM)
 -+endfunction ()
 -+
 -+
 -+macro (QT5_GENERATE_MOC infile outfile )
 -+# get include dirs and flags
 -+   QT5_GET_MOC_FLAGS(moc_flags)
 -+   get_filename_component(abs_infile ${infile} ABSOLUTE)
 -+   set(_outfile "${outfile}")
 -+   if(NOT IS_ABSOLUTE "${outfile}")
 -+     set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
 -+   endif()
 -+
 -+   if ("x${ARGV2}" STREQUAL "xTARGET")
 -+      set(moc_target ${ARGV3})
 -+   endif()
 -+   QT5_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
 -+   set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE)  # dont run automoc on this file
 -+endmacro ()
 -+
 -+
 -+# QT5_WRAP_CPP(outfiles inputfile ... )
 -+
 -+macro (QT5_WRAP_CPP outfiles )
 -+  # get include dirs
 -+  QT5_GET_MOC_FLAGS(moc_flags)
 -+  QT5_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
 -+
 -+  foreach (it ${moc_files})
 -+    get_filename_component(it ${it} ABSOLUTE)
 -+    QT5_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
 -+    QT5_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
 -+    set(${outfiles} ${${outfiles}} ${outfile})
 -+  endforeach()
 -+
 -+endmacro ()
 -+
 -+
 -+# QT5_WRAP_UI(outfiles inputfile ... )
 -+
 -+macro (QT5_WRAP_UI outfiles )
 -+  QT5_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
 -+
 -+  foreach (it ${ui_files})
 -+    get_filename_component(outfile ${it} NAME_WE)
 -+    get_filename_component(infile ${it} ABSOLUTE)
 -+    set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
 -+    add_custom_command(OUTPUT ${outfile}
 -+      COMMAND Qt5::uic
 -+      ARGS ${ui_options} -o ${outfile} ${infile}
 -+      MAIN_DEPENDENCY ${infile} VERBATIM)
 -+    set(${outfiles} ${${outfiles}} ${outfile})
 -+  endforeach ()
 -+
 -+endmacro ()
 -+
 -+
 -+# QT5_ADD_RESOURCES(outfiles inputfile ... )
 -+
 -+macro (QT5_ADD_RESOURCES outfiles )
 -+  QT5_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
 -+
 -+  foreach (it ${rcc_files})
 -+    get_filename_component(outfilename ${it} NAME_WE)
 -+    get_filename_component(infile ${it} ABSOLUTE)
 -+    get_filename_component(rc_path ${infile} PATH)
 -+    set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
 -+
 -+    set(_RC_DEPENDS)
 -+    if(EXISTS "${infile}")
 -+      #  parse file for dependencies
 -+      #  all files are absolute paths or relative to the location of the qrc file
 -+      file(READ "${infile}" _RC_FILE_CONTENTS)
 -+      string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
 -+      foreach(_RC_FILE ${_RC_FILES})
 -+        string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
 -+        if(NOT IS_ABSOLUTE "${_RC_FILE}")
 -+          set(_RC_FILE "${rc_path}/${_RC_FILE}")
 -+        endif()
 -+        set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
 -+      endforeach()
 -+      unset(_RC_FILES)
 -+      unset(_RC_FILE_CONTENTS)
 -+      # Since this cmake macro is doing the dependency scanning for these files,
 -+      # let's make a configured file and add it as a dependency so cmake is run
 -+      # again when dependencies need to be recomputed.
 -+      QT5_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
 -+      configure_file("${infile}" "${out_depends}" COPYONLY)
 -+    else()
 -+      # The .qrc file does not exist (yet). Let's add a dependency and hope
 -+      # that it will be generated later
 -+      set(out_depends)
 -+    endif()
 -+
 -+    add_custom_command(OUTPUT ${outfile}
 -+      COMMAND Qt5::rcc
 -+      ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
 -+      MAIN_DEPENDENCY ${infile}
 -+      DEPENDS ${_RC_DEPENDS} "${out_depends}" VERBATIM)
 -+    set(${outfiles} ${${outfiles}} ${outfile})
 -+  endforeach ()
 -+
 -+endmacro ()
 -+
 -+
 -+macro(QT5_ADD_DBUS_INTERFACE _sources _interface _basename)
 -+  get_filename_component(_infile ${_interface} ABSOLUTE)
 -+  set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
 -+  set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
 -+  set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
 -+
 -+  get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
 -+  if(_nonamespace)
 -+    set(_params -N -m)
 -+  else()
 -+    set(_params -m)
 -+  endif()
 -+
 -+  get_source_file_property(_classname ${_interface} CLASSNAME)
 -+  if(_classname)
 -+    set(_params ${_params} -c ${_classname})
 -+  endif()
 -+
 -+  get_source_file_property(_include ${_interface} INCLUDE)
 -+  if(_include)
 -+    set(_params ${_params} -i ${_include})
 -+  endif()
 -+
 -+  add_custom_command(OUTPUT "${_impl}" "${_header}"
 -+      COMMAND Qt5::qdbusxml2cpp ${_params} -p ${_basename} ${_infile}
 -+      DEPENDS ${_infile} VERBATIM)
 -+
 -+  set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
 -+
 -+  QT5_GENERATE_MOC("${_header}" "${_moc}")
 -+
 -+  list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
 -+  MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 -+
 -+endmacro()
 -+
 -+
 -+macro(QT5_ADD_DBUS_INTERFACES _sources)
 -+  foreach (_current_FILE ${ARGN})
 -+    get_filename_component(_infile ${_current_FILE} ABSOLUTE)
 -+    get_filename_component(_basename ${_current_FILE} NAME)
 -+    # get the part before the ".xml" suffix
 -+    string(TOLOWER ${_basename} _basename)
 -+    string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
 -+    QT5_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
 -+  endforeach ()
 -+endmacro()
 -+
 -+
 -+macro(QT5_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
 -+  QT5_EXTRACT_OPTIONS(_customName _qt5_dbus_options _qt5_dbus_target ${ARGN})
 -+
 -+  get_filename_component(_in_file ${_header} ABSOLUTE)
 -+  get_filename_component(_basename ${_header} NAME_WE)
 -+
 -+  if (_customName)
 -+    if (IS_ABSOLUTE ${_customName})
 -+      get_filename_component(_containingDir ${_customName} PATH)
 -+      if (NOT EXISTS ${_containingDir})
 -+        file(MAKE_DIRECTORY "${_containingDir}")
 -+      endif()
 -+      set(_target ${_customName})
 -+    else()
 -+      set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
 -+    endif()
 -+  else ()
 -+    set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
 -+  endif ()
 -+
 -+  add_custom_command(OUTPUT ${_target}
 -+      COMMAND Qt5::qdbuscpp2xml ${_qt5_dbus_options} ${_in_file} -o ${_target}
 -+      DEPENDS ${_in_file} VERBATIM
 -+  )
 -+endmacro()
 -+
 -+
 -+macro(QT5_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
 -+  get_filename_component(_infile ${_xml_file} ABSOLUTE)
 -+
 -+  set(_optionalBasename "${ARGV4}")
 -+  if (_optionalBasename)
 -+    set(_basename ${_optionalBasename} )
 -+  else ()
 -+    string(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
 -+    string(TOLOWER ${_basename} _basename)
 -+  endif ()
 -+
 -+  set(_optionalClassName "${ARGV5}")
 -+  set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h")
 -+  set(_impl   "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp")
 -+  set(_moc    "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
 -+
 -+  if(_optionalClassName)
 -+    add_custom_command(OUTPUT "${_impl}" "${_header}"
 -+       COMMAND Qt5::qdbusxml2cpp -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
 -+       DEPENDS ${_infile} VERBATIM
 -+    )
 -+  else()
 -+    add_custom_command(OUTPUT "${_impl}" "${_header}"
 -+       COMMAND Qt5::qdbusxml2cpp -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
 -+       DEPENDS ${_infile} VERBATIM
 -+     )
 -+  endif()
 -+
 -+  QT5_GENERATE_MOC("${_header}" "${_moc}")
 -+  set_source_files_properties("${_impl}" PROPERTIES SKIP_AUTOMOC TRUE)
 -+  MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
 -+
 -+  list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
 -+endmacro()
 -+
 -+
 -+macro(QT5_AUTOMOC)
 -+  if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
 -+    message(DEPRECATION "The qt5_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.")
 -+  endif()
 -+  QT5_GET_MOC_FLAGS(_moc_INCS)
 -+
 -+  set(_matching_FILES )
 -+  foreach (_current_FILE ${ARGN})
 -+
 -+    get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
 -+    # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
 -+    # This is required to make uic work correctly:
 -+    # we need to add generated .cpp files to the sources (to compile them),
 -+    # but we cannot let automoc handle them, as the .cpp files don't exist yet when
 -+    # cmake is run for the very first time on them -> however the .cpp files might
 -+    # exist at a later run. at that time we need to skip them, so that we don't add two
 -+    # different rules for the same moc file
 -+    get_source_file_property(_skip ${_abs_FILE} SKIP_AUTOMOC)
 -+
 -+    if ( NOT _skip AND EXISTS ${_abs_FILE} )
 -+
 -+      file(READ ${_abs_FILE} _contents)
 -+
 -+      get_filename_component(_abs_PATH ${_abs_FILE} PATH)
 -+
 -+      string(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
 -+      if(_match)
 -+        foreach (_current_MOC_INC ${_match})
 -+          string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
 -+
 -+          get_filename_component(_basename ${_current_MOC} NAME_WE)
 -+          if(EXISTS ${_abs_PATH}/${_basename}.hpp)
 -+            set(_header ${_abs_PATH}/${_basename}.hpp)
 -+          else()
 -+            set(_header ${_abs_PATH}/${_basename}.h)
 -+          endif()
 -+          set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
 -+          QT5_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "")
 -+          MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
 -+        endforeach ()
 -+      endif()
 -+    endif ()
 -+  endforeach ()
 -+endmacro()
 -+
 -+
 -+macro(QT5_CREATE_TRANSLATION _qm_files)
 -+   QT5_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
 -+   set(_my_sources)
 -+   set(_my_dirs)
 -+   set(_my_tsfiles)
 -+   set(_ts_pro)
 -+   foreach (_file ${_lupdate_files})
 -+     get_filename_component(_ext ${_file} EXT)
 -+     get_filename_component(_abs_FILE ${_file} ABSOLUTE)
 -+     if(_ext MATCHES "ts")
 -+       list(APPEND _my_tsfiles ${_abs_FILE})
 -+     else()
 -+       if(NOT _ext)
 -+         list(APPEND _my_dirs ${_abs_FILE})
 -+       else()
 -+         list(APPEND _my_sources ${_abs_FILE})
 -+       endif()
 -+     endif()
 -+   endforeach()
 -+   foreach(_ts_file ${_my_tsfiles})
 -+     if(_my_sources)
 -+       # make a .pro file to call lupdate on, so we don't make our commands too
 -+       # long for some systems
 -+       get_filename_component(_ts_name ${_ts_file} NAME_WE)
 -+       set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
 -+       set(_pro_srcs)
 -+       foreach(_pro_src ${_my_sources})
 -+         set(_pro_srcs "${_pro_srcs} \\\n  \"${_pro_src}\"")
 -+       endforeach()
 -+       set(_pro_includes)
 -+       get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
 -+       list(REMOVE_DUPLICATES _inc_DIRS)
 -+       foreach(_pro_include ${_inc_DIRS})
 -+         get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
 -+         set(_pro_includes "${_pro_includes} \\\n  \"${_abs_include}\"")
 -+       endforeach()
 -+       file(WRITE ${_ts_pro} "SOURCES =${_pro_srcs}\nINCLUDEPATH =${_pro_includes}\n")
 -+     endif()
 -+     add_custom_command(OUTPUT ${_ts_file}
 -+        COMMAND Qt5::lupdate
 -+        ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
 -+        DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
 -+   endforeach()
 -+   QT5_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
 -+endmacro()
 -+
 -+
 -+macro(QT5_ADD_TRANSLATION _qm_files)
 -+  foreach (_current_FILE ${ARGN})
 -+    get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
 -+    get_filename_component(qm ${_abs_FILE} NAME_WE)
 -+    get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
 -+    if(output_location)
 -+      file(MAKE_DIRECTORY "${output_location}")
 -+      set(qm "${output_location}/${qm}.qm")
 -+    else()
 -+      set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
 -+    endif()
 -+
 -+    add_custom_command(OUTPUT ${qm}
 -+       COMMAND Qt5::lrelease
 -+       ARGS ${_abs_FILE} -qm ${qm}
 -+       DEPENDS ${_abs_FILE} VERBATIM
 -+    )
 -+    set(${_qm_files} ${${_qm_files}} ${qm})
 -+  endforeach ()
 -+endmacro()
 -+
 -+function(qt5_use_modules _target _link_type)
 -+  if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
 -+    message(DEPRECATION "The qt5_use_modules function is obsolete. Use target_link_libraries with IMPORTED targets instead.")
 -+  endif()
 -+  if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE")
 -+    set(modules ${ARGN})
 -+    set(link_type ${_link_type})
 -+  else()
 -+    set(modules ${_link_type} ${ARGN})
 -+  endif()
 -+  foreach(_module ${modules})
 -+    string(TOUPPER ${_module} _ucmodule)
 -+    set(_targetPrefix QT_QT${_ucmodule})
 -+    if (_ucmodule STREQUAL QAXCONTAINER OR _ucmodule STREQUAL QAXSERVER)
 -+      if (NOT QT_Q${_ucmodule}_FOUND)
 -+        message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
 -+      endif()
 -+      set(_targetPrefix QT_Q${_ucmodule})
 -+    else()
 -+      if (NOT QT_QT${_ucmodule}_FOUND)
 -+        message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
 -+      endif()
 -+      if ("${_ucmodule}" STREQUAL "MAIN")
 -+        message(FATAL_ERROR "Can not use \"${_module}\" module with qt5_use_modules.")
 -+      endif()
 -+    endif()
 -+    target_link_libraries(${_target} ${link_type} ${${_targetPrefix}_LIBRARIES})
 -+    set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${${_targetPrefix}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default)
 -+    set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${${_targetPrefix}_COMPILE_DEFINITIONS})
 -+  endforeach()
 -+endfunction()
+ Index: magics++-2.24.7/CMakeLists.txt
  ===================================================================
- --- magics++-2.22.7.dfsg.1.orig/CMakeLists.txt
- +++ magics++-2.22.7.dfsg.1/CMakeLists.txt
- @@ -185,7 +185,7 @@ endif()
-  if( ENABLE_METVIEW )
-      set ( metview yes)
-      unset(MAGICS_ONLY)
+ --- magics++-2.24.7.orig/CMakeLists.txt
+ +++ magics++-2.24.7/CMakeLists.txt
+ @@ -210,16 +210,6 @@ if( ENABLE_METVIEW_NO_QT )
+  	unset(MAGICS_ONLY)
+  endif()
+  
+ -if( ENABLE_METVIEW )
+ -    set ( metview yes)
+ -    unset(MAGICS_ONLY)
  -    find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml )
- +    find_package(Qt5 5.3.1 REQUIRED Core Gui Xml XmlPatterns Widgets X11Extras )
-      if( QT_FOUND )
-  		  include( ${QT_USE_FILE} )
-  		  set( MAGICS_QT 1)
- Index: magics++-2.22.7.dfsg.1/src/CMakeLists.txt
+ -    if( QT_FOUND )
+ -		  include( ${QT_USE_FILE} )
+ -		  set( MAGICS_QT 1)
+ -		  set( qt yes)
+ -    endif()
+ -endif()
+  
+  ecbuild_declare_project()
+  
 -@@ -277,6 +267,21 @@ endif()
++@@ -277,6 +267,17 @@ endif()
+  
+  set( MAGICS_LIBRARIES    MagPlus )
+  
+ +if( ENABLE_METVIEW )
+ +    set ( metview yes)
+ +    unset(MAGICS_ONLY)
 -+    # FIXME: these 3 lines probably unnecessary
+ +    find_package(Qt5Core REQUIRED)
+ +    find_package(Qt5Widgets REQUIRED)
+ +    find_package(Qt5Xml REQUIRED)
 -+    #target_link_libraries(MAGICS Qt5::Core Qt5::Widgets Qt5::Xml)
 -+    # FIXME: Investigate removing line below
+ +    set( QT_FOUND yes )
 -+    # include( ${QT_USE_FILE} )
+ +    set( MAGICS_QT 1)
+ +    set( qt yes)
+ +endif()
+ +
+  foreach( _tpl ${MAGICS_TPLS} )
+      string( TOUPPER ${_tpl} TPL )
+      list( APPEND MAGICS_EXTRA_DEFINITIONS   ${${TPL}_DEFINITIONS}  )
+ Index: magics++-2.24.7/src/CMakeLists.txt
  ===================================================================
- --- magics++-2.22.7.dfsg.1.orig/src/CMakeLists.txt
- +++ magics++-2.22.7.dfsg.1/src/CMakeLists.txt
- @@ -53,7 +53,7 @@ if ( metview )
+ --- magics++-2.24.7.orig/src/CMakeLists.txt
+ +++ magics++-2.24.7/src/CMakeLists.txt
+ @@ -75,7 +75,7 @@ if ( metview )
   
        if(qt)
           SET(qt_drivers_HEADERS drivers/MgQ/MgQPlotScene.h)
@@@ -59,10 -603,10 +85,26 @@@
           list( APPEND drivers_srcs  drivers/MgQ/MgQPlotScene.cc  ${qt_drivers_HEADERS_MOC})
        endif()
   
- Index: magics++-2.22.7.dfsg.1/src/drivers/CMakeLists.txt
++@@ -146,6 +146,7 @@ SET_TARGET_PROPERTIES(MagPlusShared PROP
++ SET_TARGET_PROPERTIES(MagPlusDoubleShared PROPERTIES OUTPUT_NAME "MagPlusDouble" VERSION 3.0.0 SOVERSION 3)
++ SET_TARGET_PROPERTIES(MagPlusSingleShared PROPERTIES OUTPUT_NAME "MagPlusSingle" VERSION 3.0.0 SOVERSION 3)
++ 
+++target_link_libraries(MagPlusShared Qt5::Core Qt5::Widgets Qt5::Xml)
++ 
++ 
++ 
++@@ -212,6 +213,7 @@ if( metview )
++                         ${MAGICS_EXTRA_LIBRARIES}
++                     TYPE STATIC		
++                     )
+++   target_link_libraries(MagWrapper Qt5::Core Qt5::Widgets Qt5::Xml Qt5::Gui)
++    list( APPEND attributes_include
++ 				OutputHandlerAttributes.h 
++ 				FortranRootSceneNodeAttributes.h  
+ Index: magics++-2.24.7/src/drivers/CMakeLists.txt
  ===================================================================
- --- magics++-2.22.7.dfsg.1.orig/src/drivers/CMakeLists.txt
- +++ magics++-2.22.7.dfsg.1/src/drivers/CMakeLists.txt
+ --- magics++-2.24.7.orig/src/drivers/CMakeLists.txt
+ +++ magics++-2.24.7/src/drivers/CMakeLists.txt
  @@ -37,7 +37,7 @@ if( MAGICS_QT )
      
      
diff --cc debian/rules
index 6f81ef9,d4fd6fa..815630b
--- a/debian/rules
+++ b/debian/rules
@@@ -10,10 -13,9 +13,9 @@@ LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH
  AUTOGENERATED:= libmagplus3.links libmagics++-dev.links libmagplus3.install
  # Uncomment this to turn on verbose mode.
  # export DH_VERBOSE=1
- export QT_SELECT=4
  
 -QI=/usr/include/$(DEB_HOST_MULTIARCH)/qt5
 -QTINCS=-I$(QI) -I$(QI)/QtCore -I$(QI)/QtWidgets -I$(QI)/QtGui -I$(QI)/QtX11Extras -I$(QI)/QtXml -I$(QI)/QtXmlPatterns
 +#QI=/usr/include/$(DEB_HOST_MULTIARCH)/qt5
 +#QTINCS=-I$(QI) -I$(QI)/QtCore -I$(QI)/QtWidgets -I$(QI)/QtGui -I$(QI)/QtX11Extras -I$(QI)/QtXml -I$(QI)/QtXmlPatterns
  
  %:
  	dh $@  --with python2 --with-buildsystem=cmake --builddirectory=$(BUILDDIR)
@@@ -66,8 -68,8 +68,8 @@@ export extra_flags += 
  	-DENABLE_GRIB=ON \
  	-DENABLE_METVIEW=ON \
  	-DENABLE_NETCDF=ON \
--	-DCMAKE_CXX_FLAGS='$(CXXFLAGS) -I/usr/include/terralib -I/usr/include/terralib/kernel $(QTINCS)' \
 -	-DMAGICS_EXTRA_LIBRARIES='-lterralib -lgd -lQt5Gui -lQt5Xml -lQt5Widgets'
++	-DCMAKE_CXX_FLAGS='$(CXXFLAGS) -I/usr/include/terralib -I/usr/include/terralib/kernel' \
 +	-DMAGICS_EXTRA_LIBRARIES='-lterralib -lgd'
  
  export LD_LIBRARY_PATH:=$(CURDIR)/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git



More information about the debian-science-commits mailing list