[CMake] FW: cmake newbie questions

Phil Smith phil at voltage.com
Thu Jul 31 18:57:00 EDT 2008


Sure, here are two files:
ctsc.fascii   -- CheckTypeSizeC.c compiled with the Dignus -fascii option
ctsc.nofascii -- CheckTypeSizeC.c compiled without the Dignus -fascii option

So TRY_COMPILE not only compiles, but linkedits?  That wasn't at all intuitive.
-----Original Message-----
From: Alexander Neundorf [mailto:a.neundorf-work at gmx.net]
Sent: Thursday, July 31, 2008 1:49 PM
To: Phil Smith
Cc: cmake at cmake.org
Subject: Re: [CMake] FW: cmake newbie questions

On Thursday 31 July 2008, Phil Smith wrote:
> There are executables with z/OS, but they're linkedited and certainly won't
> run on Windows *at all*.
>
> Since I've never had to understand the format of an object file on Windows,
> I'm not sure how to answer the second question.  Here's a screenshot of
> what the CheckTypeSizeC object file looks like after it's been transferred
> to an EBCDIC system (unprintable characters rendered as blanks):
>
> XSD               ;            @CRT0
> 00000001 XSD                           Ð@CHECKTY
>     00000002 XSD                       ^    @checkty
>         00000003 XSD                            main
>             00000004 XSD                       ^    info_sizeof
>                 00000005 TXT               ;main        DCC        î   Ç
>                     00000006 TXT            °Ö} ì\} ì{}   ì^{  \\Çí\{ å ^
> °ó   K õì0{   åØ{  0  å0{ 00000007 TXT   ø           ^ 0  P } } ì}} ì{} ì^{
> í{^ ì\} q }  þ&0} & } ì0} ì00 00000008 TXT   y        å00
>                                   00000009 TXT   ^        ñ+ã| ËÑ:Á?Ã$
> )                                      00000010 RLD
>                   ø                        00000011 END
>        1DASM01    800508213                    00000012

I'd still be interested in the original file. Can you please send it to me ?

> Note that the "info_sizeof" in this case isn't even followed by a legible
> length, because the rest of the eyecatcher was still generated in ASCII.
> But if I force the -fasciiout flag, I see the "info_sizeof[00008]" in the
> object.
>
> Hmm, I hacked CheckTypeSize.cmake to force the -fasciiout flag, and
> verified that it's passing it, but it still fails the same way.  The error
> is a bit funky:
>
>   file STRINGS file "C:/Documents and
> Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
> cannot be read.
>
> It isn't at all clear to me where a ".bin" file would come from. I'd expect
> a .o or something?  What does this error really mean?  I can't seem to find
> anything on it.

That's the code from CheckTypeSize.cmake:

TRY_COMPILE(HAVE_${VARIABLE}
    ${CMAKE_BINARY_DIR}
    "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSizeC.c"
    COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
    CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
    "${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
    "${CHECK_TYPE_SIZE_ADD_INCLUDES}"
    OUTPUT_VARIABLE OUTPUT
   COPY_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize.bin" )

This means TRY_COMPILE() copies the executable (well, the file which would be
an executable on other systems) to the file CheckTypeSize.bin and then (tries
to) extract the strings from it:

IF(HAVE_${VARIABLE})
  FILE(STRINGS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize.bin"
        CMAKE_CHECKTYPESIZE_STRINGS LIMIT_COUNT 2 REGEX "INFO:sizeof")

This command e.g. also recognizes if the file is an Intel hex file and handles
it accordingly.

Did you set the CMAKE_EXECUTABLE_SUFFIX appropriately for z/OS ?

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctsc.fascii
Type: application/octet-stream
Size: 960 bytes
Desc: ctsc.fascii
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080731/c8eea7f4/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctsc.nofascii
Type: application/octet-stream
Size: 960 bytes
Desc: ctsc.nofascii
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080731/c8eea7f4/attachment-0003.obj>


More information about the CMake mailing list