[CMake] Observation regarding Utilities/cmliblzma/CMakeLists.txt

Custin, Jay (CSC Sw Middleware) jay.custin at hpe.com
Tue Nov 24 13:17:32 EST 2015


After some rather extensive banging of my head on my desk trying to resolve a variable definition issue I finally tracked it down to the Utilities/cmliblzma/CMakeLists.txt file.  Line 26 contains the following statement:

CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)

Absolutely nothing wrong with this EXCEPT while it CHECKS for that header file... it appears that this file never actually INCLUDES the header file later (beginning at line 79) when it starts to check type and size of data types:

CHECK_TYPE_SIZE(int16_t INT16_T)

After some digging in the documentation I spotted this in the list of variables which can get set before calling this macro:

CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include

Ultimately I worked around the compiler errors by adding the following inside a test for the OpenVMS operating system:

if( (CMAKE_CXX_PLATFORM_ID MATCHES "OpenVMS") AND HAVE_INTTYPES_H )
  SET( CMAKE_EXTRA_INCLUDE_FILES "inttypes.h" )
endif()

It seems odd to me that someone would have to do this since the CMake build procedure had already gone painstaking tests to generate the ABI.h and INT.h header files for the operating system and in so doing had already identified the available/necessary data types.

/SenseiC bows out
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151124/aa6940e1/attachment.html>


More information about the CMake mailing list