소스 검색

Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin

The CMAKE_SYSTEM_NAME is "CYGWIN", but we also define a variable
named "CYGWIN" to "1".  Avoid allowing if() to expand the "CYGWIN"
string as a variable.
Brad King 11 년 전
부모
커밋
858d5a0b3e
4개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      CMakeCPack.cmake
  2. 1 1
      CMakeLists.txt
  3. 1 1
      Source/CMakeLists.txt
  4. 1 1
      Tests/CMakeLists.txt

+ 1 - 1
CMakeCPack.cmake

@@ -50,7 +50,7 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   if(NOT DEFINED CPACK_SYSTEM_NAME)
     # make sure package is not Cygwin-unknown, for Cygwin just
     # cygwin is good for the system name
-    if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
+    if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
       set(CPACK_SYSTEM_NAME Cygwin)
     else()
       set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})

+ 1 - 1
CMakeLists.txt

@@ -381,7 +381,7 @@ macro (CMAKE_BUILD_UTILITIES)
   # Use curses?
   if (UNIX)
     # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
-    if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+    if(NOT CMAKE_SYSTEM_NAME MATCHES syllable)
       set(CURSES_NEED_NCURSES TRUE)
       find_package(Curses QUIET)
       if (CURSES_LIBRARY)

+ 1 - 1
Source/CMakeLists.txt

@@ -451,7 +451,7 @@ if (WIN32)
 endif ()
 
 # Watcom support
-if(WIN32 OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
   set_property(SOURCE cmake.cxx APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_USE_WMAKE)
   list(APPEND SRCS
     cmGlobalWatcomWMakeGenerator.cxx

+ 1 - 1
Tests/CMakeLists.txt

@@ -1392,7 +1392,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     )
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
 
-  if("${CMAKE_SYSTEM_NAME}" MATCHES syllable)
+  if(CMAKE_SYSTEM_NAME MATCHES syllable)
 
 # RPATH isn't supported under Syllable, so the tests don't
 # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR