MantisBT - CMake
View Issue Details
0010774CMakeCMakepublic2010-05-28 14:172010-10-06 13:47
Yaakov (Cygwin Ports) 
Brad King 
normalminorhave not tried
closedfixed 
CMake-2-8 
CMake 2.8.3CMake 2.8.3 
0010774: CMAKE_SYSTEM_PROCESSOR on Cygwin
CMakeDetermineSystem.cmake uses `uname -p` to set CMAKE_SYSTEM_PROCESSOR on all platforms except Linux, where `uname -m` is used (commit d7b5020).

POSIX[1] requires uname -m but not -p, and indeed Cygwin uname -p returns "unknown". I gather the reason Linux is special-cased is that its uname(1) manpage[2] also says that -p may return "unknown" (git log isn't clear on the exact reason).

I see two possible solutions:

1) Special-case Cygwin together with linux, IOW change the
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") conditional to
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*"), or:

2) Catch "unknown" from uname -p, changing the
IF("${val}" GREATER 0) conditional for the -m fallback to
IF("${val}" GREATER 0 OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "unknown").

[1] http://www.opengroup.org/onlinepubs/9699919799/utilities/uname.html [^]
[2] http://linux.die.net/man/1/uname [^]
No tags attached.
Issue History
2010-05-28 14:17Yaakov (Cygwin Ports)New Issue
2010-09-21 17:37Brad KingStatusnew => assigned
2010-09-21 17:37Brad KingAssigned To => Brad King
2010-09-21 17:38Brad KingNote Added: 0022309
2010-09-21 17:38Brad KingStatusassigned => closed
2010-09-21 17:38Brad KingResolutionopen => fixed
2010-10-06 13:47David ColeFixed in Version => CMake 2.8.3
2010-10-06 13:47David ColeTarget Version => CMake 2.8.3

Notes
(0022309)
Brad King   
2010-09-21 17:38   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2412d9bc [^]