[CMake] FW: cmake newbie questions

Bill Hoffman bill.hoffman at kitware.com
Wed Jul 30 15:14:40 EDT 2008


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