0

I am trying to compile an really old piece of code- wireshark version 1.9.2, on Ubuntu. when i run the command cmake .. on it the following error shows up.

CMake Error at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:76 (message):
  Unknown language:

    C

  Supported languages: C, CXX.

Call Stack (most recent call first):
  cmake/modules/FindGLIB2.cmake:241 (CHECK_INCLUDE_FILES)
  CMakeLists.txt:385 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/tusharsing/wireshark-1.9.2/build/CMakeFiles/CMakeOutput.log".

Also this warning comes before it.

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:71 (if):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "C" will no longer be dereferenced when the policy is
  set to NEW.  Since the policy is not set the OLD behavior will be used.
Call Stack (most recent call first):
  cmake/modules/FindGLIB2.cmake:241 (CHECK_INCLUDE_FILES)
  CMakeLists.txt:385 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

What should I do?

1 Answers1

0

I have tried to build this_commit with cmake 3.23. The place where you have failed is passed with this cmake version. So as one option I could recommend you to use later cmake if it is possible.

A bit of further analysis

issue happens here cmake/modules/FindGLIB2.cmake:241

IF ( GLIB2_FOUND )
    # Check if system has a newer version of glib
    # which supports g_regex_match_simple
    INCLUDE( CheckIncludeFiles )
    SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
>>> CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
    CHECK_INCLUDE_FILES ( glib/gchecksum.h HAVE_GLIB_GCHECKSUM_H )
    # Reset CMAKE_REQUIRED_INCLUDES
    SET( CMAKE_REQUIRED_INCLUDES "" )
ENDIF( GLIB2_FOUND )

One can pass the language to CHECK_INCLUDE_FILES like

CHECK_INCLUDE_FILES(glib/gregex.h HAVE_GLIB_GREGEX_H LANGUAGE "C")

or with unquoted C

As the second approach it is possible to use another module CheckIncludeFile and macro it provides. Potential benefit is that it doesn't compare variable with string literal to validate proper language and uses C by default

vsh
  • 301
  • 2
  • 10