[CMake] FW: cmake newbie questions

Phil Smith phil at voltage.com
Wed Jul 30 14:55:09 EDT 2008


OK, next issue. I'm following (or trying to) the cross-compiler page.  Since the same source tree is to be used to generate Win32 and z/OS, I think I want to tell it "This is a z/OS run" using a flag. I thus created zcmake.bat:

cmake -DCMAKE_TOOLCHAIN_FILE:string="zos.cmake" -DCMAKE_GENERATOR:internal="Unix Makefiles"

The reason for the second -D is because otherwise it seemed to assume Visual Studio no matter what. And since Visual Studio *is* correct when building Win32, I don't want to change the CMakeLists.txt.

zos.cmake contains (comments removed):

SET(CMAKE_SYSTEM_NAME ZOS)
SET(CMAKE_C_COMPILER   "cc.bat")
SET(CMAKE_CXX_COMPILER "cxx.bat")

"zcmake ." produces these errors:

---------------------
C:\Documents and Settings\Voltage\svn\Toolkit\trunk\vtk-core>zcmake
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Check for working C compiler: c:/progra~1/dignus/cc.bat
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Check for working C compiler: c:/progra~1/dignus/cc.bat -- works
-- Detecting C compiler ABI info
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
-- Detecting C compiler ABI info - done
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeDetermine
CompilerABI.cmake:23 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CMakeDetermineCompilerA
BI_C.bin"
  cannot be read.
Call Stack (most recent call first):
  C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCCompiler.cmake:51
 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:16 (project)

-- Check for working CXX compiler: c:/progra~1/dignus/cxx.bat
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Check for working CXX compiler: c:/progra~1/dignus/cxx.bat -- works
-- Detecting CXX compiler ABI info
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeDetermine
CompilerABI.cmake:23 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CMakeDetermineCompilerA
BI_CXX.bin"
  cannot be read.
Call Stack (most recent call first):
  C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CMakeTestCXXCompiler.cmake:
44 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:16 (project)

-- Looking for sys/types.h
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Looking for sys/types.h - found
-- Looking for stdint.h
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Looking for stdint.h - found
-- Looking for stddef.h
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
-- Looking for stddef.h - not found
-- Check size of unsigned long long
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CheckTypeSize.
cmake:77 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:118 (check_type_size)

-- Check size of unsigned long long - done
-- Check size of unsigned long
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CheckTypeSize.
cmake:77 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:119 (check_type_size)

-- Check size of unsigned long - done
-- Check size of unsigned int
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CheckTypeSize.
cmake:77 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:120 (check_type_size)

-- Check size of unsigned int - done
-- Check size of unsigned short
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CheckTypeSize.
cmake:77 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:121 (check_type_size)

-- Check size of unsigned short - done
-- Check size of long long
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
CMake Error: Could not COPY_FILE
CMake Error at C:/Program Files/CMake 2.6/share/cmake-2.6/Modules/CheckTypeSize.
cmake:77 (FILE):
  file STRINGS file "C:/Documents and
  Settings/Voltage/svn/Toolkit/trunk/vtk-core/CMakeFiles/CheckTypeSize.bin"
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:122 (check_type_size)

-- Check size of long long - done
-- Configuring done
---------------------
Three issues:

1) Obviously I'm back to having implicit paths, some of which get expanded to contain embedded blanks. I would like to understand how to overcome this, although one answer, of course, is to reinstall cmake in a directory that *doesn't* contain blanks.  The various "CMAKE_xxxxx_PATH" variables that are documented aren't obviously the answer, which doesn't meant they aren't *actually* the answer.

2) The messages:
        -- The C compiler identification is unknown
        -- The CXX compiler identification is unknown
   ...seem to be generated because CMakeCXXCompilerId.cpp.in doesn't know about Dignus. Is there a nice way to override that?  I guess I *could* just document that "you'll get this message"...

3) System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake.org so it can be added to cmake

I kind of grok this in principle, but "create Platform/ZOS" doesn't mean anything to me, and I don't see it in the Wiki, the book, or Googling for what seem like the plausible strings.

Here's the especially interesting bit: after all that complaining, if I rerun zcmake, I get:

---------------------
System is unknown to cmake, create:
Platform/ZOS to use this system, please send your config file to cmake at www.cmake
.org so it can be added to cmake
You CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please send that fil
e to cmake at www.cmake.org.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Documents and Settings/Voltage/svn/Toolk
it/trunk/vtk-core
---------------------

That *looks* like it worked?!?!

...phsiii (two forward, one back)
-----Original Message-----
From: Bill Hoffman [mailto:bill.hoffman at kitware.com]
Sent: Wednesday, July 30, 2008 10:25 AM
To: Mike Jackson
Cc: Phil Smith; Cmake Mailing List
Subject: Re: [CMake] FW: cmake newbie questions

Mike Jackson wrote:
> You are going to have to look through the CMake files and determine
> where the "TEST_BIG_ENDIAN(variable)" is located. Then you will need to
> put in some sort of conditional statement that says if you are compiling
> for z/OS then set "variable" to "true".
>
>
This really sounds like a cross compiler.  In which case you should look
here:
http://www.cmake.org/Wiki/CMake_Cross_Compiling

-Bill



More information about the CMake mailing list