[CMake] CMake still broken post-2.8.1

Phil Smith phil at voltage.com
Tue Oct 25 11:48:36 EDT 2011


OK, but it should then reject the extra parameters, since it used to work.

In any case, I've changed the toolchain file:
----------------------------------------
# This is a CMake Toolchain file, required for cross-compiling using
# the Dignus cross-compilers on Windows, compiling for z/OS.

# Tell CMAKE the target system name
SET(CMAKE_SYSTEM_NAME "IBM_ZOS")

# Specify the cross-compilers
SET(CMAKE_C_COMPILER   "regina")
SET(CMAKE_C_FLAGS "cc.rex dcc.exe")

SET(CMAKE_CXX_COMPILER "regina")
SET(CMAKE_CXX_FLAGS "cc.rex dcc.exe")

SET(CMAKE_C_CREATE_STATIC_LIBRARY "DAR -rv <TARGET> <OBJECTS>")

SET(CMAKE_CXX_LINK_EXECUTABLE "plink.exe \"-S$ENV{DIGNUS_PROGRAM}/objs_norent/&M\" <OBJECTS> -o <TARGET>")
SET(CMAKE_C_LINK_EXECUTABLE   "plink.exe \"-S$ENV{DIGNUS_PROGRAM}/objs_norent/&M\" <OBJECTS> -o <TARGET>")
----------------------------------------
...and the behavior persists:
C:/Program Files/Regina/regina.exe  cc.rex;dcc.exe  CMakeCCompilerId.c

So it's not clear that that's a solution. I can't wrap the regina call because what will I wrap it in? BAT is criminally busted -- it eats equals signs. So later calls with -fwhatever=value will be broken.

If I comment out line 29 in CMakeDetermineCompilerId.cmake, it works with my old toolchain file, but fails later with the new one, because it appears to call "the compiler" without the "flags", and regina with no arguments produces Help and exits.

Why are the semicolons being inserted? If I wanted semicolons between the parameters, why wouldn't I just specify them?

Brad, your comment in the thread says:
>Teach compiler identification to support values such as
>  export CC='gcc -g -O2'
>by separating the arguments on spaces.

Not sure what "on spaces" means, but again, it seems wrong to me that anything is messing with my option format.

...phsiii
-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com] 
Sent: Tuesday, October 25, 2011 9:14 AM
To: Phil Smith
Cc: Eric Noulard; cmake at cmake.org; Bill Hoffman; David Cole
Subject: Re: [CMake] CMake still broken post-2.8.1

On 10/25/2011 5:00 AM, Eric Noulard wrote:
> 2011/10/25 Phil Smith<phil at voltage.com>:
>> # Specify the cross-compilers
>> SET(CMAKE_C_COMPILER   "regina.exe" "cc.rex dcc.exe")
>> SET(CMAKE_CXX_COMPILER "regina.exe" "cc.rex dcxx.exe")
>
> I think CMAKE_[C|CXX]_COMPILER vars are supposed to contain
> a command not command + list of args.
> If I'm wrong please someone (Alex, Bill,...) just tell me.

Correct.  Those variables always hold only the compiler name.
When they are built from environment variables like CC and CXX
we split the arguments out into a separate variable.  I think
the change in behavior came from this thread's change:

  http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/27857
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd38eda9

Read my first message in that thread for an explanation.

-Brad


More information about the CMake mailing list