[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#788559: [Help] Cmake detection problem (Was: Bug#788559: vxl: FTBFS: fatal error: libc.h: No such file or directory)



Control: tag -1 patch

Eureka!

On 25.06.2015 11:27, Andreas Tille wrote:
> I've checked this issue and i boils down to the fact that the header
> file in question is included only conditional.  Unfortunately this
> condition is not properly set.  Cmake is supposed to detect an existing
> libc.h header file in dcmtk:
> 
> $ grep -R HAVE_LIBC_H | grep CHECK_INCLUDE_FILE
> v3p/dcmtk/CMakeLists.txt:CHECK_INCLUDE_FILE( libc.h        DCMTK_HAVE_LIBC_H )
> 
> But this does not seem to work properly.  Any idea what might went
> wrong here?

The problem is not limited to DCMTK_HAVE_LIBC_H:
  # The configuration has changed, so reset the stored variables to
  # force them to be recomputed
  #
  FOREACH( var
        DCMTK_DCM_DICT_DEFAULT_PATH
[...]
        DCMTK_HAVE_LIBC_H
[...]
        HAVE_DCMTK_SIZEOF_LONG )  # Created indirectly by CHECK_TYPE_SIZE
    SET( ${var} ${var} )  #  <-- This is the problem!
  ENDFOREACH( var )

It tries to reset the variables, but it sets their value to their name.
Apparently this worked (accidentally?) with previous cmake versions, but
doesn't work anymore.
Instead I think it should just unset the variables.
A patch doing that (and thus fixing the FTBFS) is attached.

Best regards,
Andreas

--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ opencl_kfreebsd.patch
 shared-lib-without-dependency-information.patch
 #compflags.patch
 libav10.patch
+unset-cmake-variables.patch
--- /dev/null
+++ b/debian/patches/unset-cmake-variables.patch
@@ -0,0 +1,19 @@
+Description: Unset Cmake variables on configuration change
+ Previously they have been set to arbitrary values, but that confuses
+ recent versions of cmake.
+
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Bug-Debian: https://bugs.debian.org/788559
+Last-Update: <2015-07-15>
+
+--- a/v3p/dcmtk/CMakeLists.txt
++++ b/v3p/dcmtk/CMakeLists.txt
+@@ -113,7 +113,7 @@ ELSE( ${DCMTK_CONFIG_SERIAL_CURRENT} MAT
+         DCMTK_SIZEOF_LONG
+         DCMTK_CMAKE_COMPILER_IS_GNUCXX_2XX
+         HAVE_DCMTK_SIZEOF_LONG )  # Created indirectly by CHECK_TYPE_SIZE
+-    SET( ${var} ${var} )
++    UNSET( ${var} )
+   ENDFOREACH( var )
+ 
+   # Record that we've done the new config.

Reply to: