Control: tags -1 patch
Control: tags -1 pending

I investigated the bug a bit more. The problem is here, that plplot uses
(in cmake/modules/pkg-config.cmake) a CMake function that is
undocumented and internal to CMake: _pkg_check_modules_internal (WTF?)

This function changed once in 3.1, causing the need of a version
specific switch (debian/patches/cmake-3.1.diff). Now the function API
changed again, specifically in

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df97b9793#patch2

by adding an additional argument at the third-last position. We
therefore require to extend the switch mentioned above:

  if(CMAKE_VERSION VERSION_LESS "3.1")
    _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
  elseif(CMAKE_VERSION VERSION_LESS "3.6.2")
    _pkg_check_modules_internal(0 0 0 0 ${_prefix} "${_package}")
  else(CMAKE_VERSION VERSION_LESS "3.6.2")
    _pkg_check_modules_internal(0 0 0 0 0 ${_prefix} "${_package}")
  endif(CMAKE_VERSION VERSION_LESS "3.6.2")

The attached patch replaces the "cmake-3.1.diff" patch that comes with
the current Debian package.

I would try an NMU within the next days (never did that before, so
expect some glitches here ;-) ).

Cheers

Ole
Based on upstream commit 772223c638ecf5dc740c9f3dd7a6883c6d2c83d2 with a slight
tweak to make the patch apply on our version of the source.

commit 772223c638ecf5dc740c9f3dd7a6883c6d2c83d2
Author: Alan W. Irwin <air...@users.sourceforge.net>
Date:   Sun Dec 7 09:06:08 2014 -0800

    Adjust for internal CMake-3.1 pkg-config change.
    
    There is a report from Greg Jung <gvj...@gmail.com> that the
    internal CMake command
    
    _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
    
    must be changed to
    
    _pkg_check_modules_internal(0 0 0 0 ${_prefix} "${_package}")
    
    for CMake-3.1 in order to build the cairo device properly.  Accordingly, I have made that adjustment.
    
    Tested by Alan W. Irwin <airwin@users> on Linux using CMake-3.0.2
    by building the cairo device.
    
    N.B. currently untested for CMake-3.1.
    
    ToDo:
    
    Extensive tests on CMake-3.1 (once that version is closer to release)
    still need to be done since the change in the pkg-config support by
    CMake may need other adjustments as well.

--- a/cmake/modules/pkg-config.cmake
+++ b/cmake/modules/pkg-config.cmake
@@ -1,6 +1,6 @@
 # cmake/modules/pkg-config.cmake
 #
-# Copyright (C) 2006  Alan W. Irwin
+# Copyright (C) 2006-2015 Alan W. Irwin
 #
 # This file is part of PLplot.
 #
@@ -94,7 +94,14 @@
     set(_xprefix ${_prefix})
   endif(FORCE_EXTERNAL_STATIC)
   
-  _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
+  if(CMAKE_VERSION VERSION_LESS "3.1")
+    _pkg_check_modules_internal(0 0 ${_prefix} "${_package}")
+  elseif(CMAKE_VERSION VERSION_LESS "3.6.2")
+    _pkg_check_modules_internal(0 0 0 0 ${_prefix} "${_package}")
+  else(CMAKE_VERSION VERSION_LESS "3.6.2")
+    _pkg_check_modules_internal(0 0 0 0 0 ${_prefix} "${_package}")
+  endif(CMAKE_VERSION VERSION_LESS "3.6.2")
+
   if(${_prefix}_FOUND)
     cmake_link_flags(${_link_FLAGS} "${${_xprefix}_LDFLAGS}")
     # If libraries cannot be not found, then that is equivalent to whole

Reply via email to