[CMake] FW: cmake newbie questions

Phil Smith phil at voltage.com
Wed Jul 30 16:15:33 EDT 2008


But then it complains that there's no CMakeLists.txt in the directory.  Anyway, I wasn't clear: the same person isn't likely to be doing z/OS and Windows on the same machine.  But since the same CMakeLists.txt is to be used, I didn't want to hard-code anything in there.  I've changed to -G -- somehow I missed that before (I did look, honest!).

The Dignus C compiler defines __SYSC__ to 1, so I added:

#elif defined(__SYSC__)
# define COMPILER_ID "Dignus"

to CMakeCCompilerId.c.in, but it made no difference.

So I added:

INCLUDE (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER   (cc.bat Dignus)
CMAKE_FORCE_CXX_COMPILER (cxx.bat Dignus)

to my toolchain file, and that fixes both the whines about the C compiler ID and the copy errors (I'm sure of this because if I comment those 3 lines out again, both the whines and the copy errors are back).

I then looked at the various platform files, and concluded that at this point, all I knew to try was:

INCLUDE(Platform/UnixPaths)
(in ZOS.cmake).

With those changes, it looks like it's working:

------------------
del CMakeCache.txt
zcmake
-- Looking for sys/types.h
-- Looking for sys/types.h - not found
-- Looking for stdint.h
-- Looking for stdint.h - not found
-- Looking for stddef.h
-- Looking for stddef.h - not found
-- Check size of unsigned long long
-- Check size of unsigned long long - failed
-- Check size of unsigned long
-- Check size of unsigned long - failed
-- Check size of unsigned int
-- Check size of unsigned int - failed
-- Check size of unsigned short
-- Check size of unsigned short - failed
-- Check size of long long
-- Check size of long long - failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Documents and Settings/Voltage/svn/Toolkit/trunk/vtk-core
------------------

Now, I'm sort of inclined to declare victory for now.  But should I? Are those "failed" messages significant?  I was brought up not to ignore errors without understanding them!

-----Original Message-----
From: Bill Hoffman [mailto:bill.hoffman at kitware.com]
Sent: Wednesday, July 30, 2008 12:15 PM
To: Phil Smith
Cc: Bill Hoffman; Cmake Mailing List
Subject: Re: [CMake] FW: cmake newbie questions

Phil Smith wrote:
>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.

You should be using out of source builds.


mkdir win32
cd win32
cmake -DCMAKE_TOOLCHAIN_FILE:string="../myproject/win32.cmake" -G"Unix
Makefiles"
make

cd ..
mkdir zOS
cd zOS
cmake -DCMAKE_TOOLCHAIN_FILE:string="../myproject/zos.cmake" -G"Unix
Makefiles"
make


-Bill


More information about the CMake mailing list