[CMake] Cross-compiling for z/OS -- linker question

Phil Smith phil at voltage.com
Thu Aug 7 18:59:33 EDT 2008


>Well, the initial tests for the compiler should work without the
>CMakeForceCompiler stuff. If this works, then CMakeC[XX]CompilerId.c.in cmake
>should be able to detect that it's the Dignus compiler, and set
>CMAKE_C_COMPILER_ID to "Dignus". Once this is works, it then tries to load
>Modules/Platform/ZOS-Dignus-C.cmake (and ZOS-Dignus-CXX.cmake).
>These files should then contain the settings which are specific for that
>combination of operating system, and compiler.
>E.g CMAKE_C_LINK_EXECUTABLE and maybe more.

Ok, we got it all working. My colleague had something funky with the path on his machine, and ... well, it's past now.


Now I'm trying to reconcile doing this the "right" way. I invoke CMAKE with a Toolchain file:

cmake -DCMAKE_TOOLCHAIN_FILE:string="zosport.cmake" -G"Unix Makefiles" <path_to_source>

and zosport.cmake contains (comments/whitespace stripped):

SET(CMAKE_SYSTEM_NAME "ZOS")
SET(CMAKE_C_COMPILER   "c:/progra~1/dignus/cc.bat" "-fasciiout")
SET(CMAKE_CXX_COMPILER "c:/progra~1/dignus/cxx.bat" "-fasciiout")
SET(CMAKE_CXX_LINK_EXECUTABLE "c:/progra~1/dignus/plink.exe \"-Sc:/progra~1/dignus/objs_rent/&M\" <OBJECTS> -o <TARGET>")
SET(CMAKE_C_LINK_EXECUTABLE   "c:/progra~1/dignus/plink.exe \"-Sc:/progra~1/dignus/objs_rent/&M\" <OBJECTS> -o <TARGET>")



More information about the CMake mailing list