MantisBT - CMake
View Issue Details
0015913CMakeCMakepublic2016-01-12 16:292016-06-10 14:21
Gregory M. Baumgardner 
 
normalminoralways
closedno change required 
CYGWIN-2.3.1(0.291/5/3)Windows 7
CMake 3.3.2 
 
0015913: CMAKE_SYSTEM_NAME is not being set on cmake 3.3.2 Cygwin
I installed cmake 3.3.2 directly from the Cygwin distribution, but for some reason I cannot get the if(CYGWIN) to work properly. It is probably related to the fact that the the CMAKE_SYSTEM_NAME is not being set. I have confirmed this with a quick test, but have no idea what is wrong or why I cannot detect Cygwin. The --system-information shows that the CMAKE_SYSTEM_NAME=CYGWIN, but it is not being set the same when I run cmake against my CMakeLists.txt file. It would be nice to have this feature worked as advertised.
Run "cmake ." using supplied CMakeLists.txt file. Output is:

-- Hello World
-- Cygwin is and CMAKE_COMPILER_IS_CYGWIN = and CMAKE_SYSTEM_NAME =

I expected that it should read:

-- Hello World
-- Cygwin is 1 and CMAKE_COMPILER_IS_CYGWIN = 1 and CMAKE_SYSTEM_NAME = CYGWIN
Avoid ctest truncation of output: CTEST_FULL_OUTPUT
========================================================
=== MAIN VARIABLES
========================================================
CMAKE_STATIC_LIBRARY_PREFIX == "lib"
CMAKE_STATIC_LIBRARY_SUFFIX == ".a"
CMAKE_SHARED_LIBRARY_PREFIX == "cyg"
CMAKE_SHARED_LIBRARY_SUFFIX == ".dll"
CMAKE_SHARED_MODULE_PREFIX == "cyg"
CMAKE_SHARED_MODULE_SUFFIX == ".dll"


CMAKE_DL_LIBS == "dl"
CMAKE_LIBRARY_PATH_FLAG == "-L"
CMAKE_LINK_LIBRARY_FLAG == "-l"
CMAKE_SKIP_RPATH == "NO"
CMAKE_SYSTEM_INFO_FILE == "Platform/CYGWIN"
CMAKE_SYSTEM_NAME == "CYGWIN"
CMAKE_SYSTEM == "CYGWIN-2.3.1(0.291/5/3)"
CMAKE_CXX_COMPILER == "/usr/bin/c++.exe"
CMAKE_C_COMPILER == "/usr/bin/cc"
CMAKE_COMPILER_IS_GNUCC == "1"
CMAKE_COMPILER_IS_GNUCXX == "1"

....
CMAKE_COMPILER_IS_CYGWIN "1"
CYGWIN "1"

No tags attached.
txt CMakeLists.txt (244) 2016-01-12 16:29
https://public.kitware.com/Bug/file/5609/CMakeLists.txt
Issue History
2016-01-12 16:29Gregory M. BaumgardnerNew Issue
2016-01-12 16:29Gregory M. BaumgardnerFile Added: CMakeLists.txt
2016-01-12 17:43Nils GladitzNote Added: 0040212
2016-01-13 08:52Gregory M. BaumgardnerNote Added: 0040215
2016-01-13 09:13Brad KingStatusnew => resolved
2016-01-13 09:13Brad KingResolutionopen => no change required
2016-06-10 14:21Kitware RobotNote Added: 0041292
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040212)
Nils Gladitz   
2016-01-12 17:43   
Try moving your project() call before message().

project() is what initializes platform and compiler information.
(0040215)
Gregory M. Baumgardner   
2016-01-13 08:52   
Ok. I was unaware of that. It makes sense now. This issue can be closed.
(0041292)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.