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?
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:241One can pass the language to
CHECK_INCLUDE_FILESlikeor with unquoted
CAs 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