summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineSystem.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-03-11 17:02:13 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-03-15 18:41:42 (GMT)
commitad19da011d5702da3407a17bf45f3d39ec651639 (patch)
treea8c4440732b29c0ac4ef71ce42087d2f0b5c1b2b /Modules/CMakeDetermineSystem.cmake
parent336c57edd08354ecbda007491a1820b6371911b2 (diff)
downloadCMake-ad19da011d5702da3407a17bf45f3d39ec651639.zip
CMake-ad19da011d5702da3407a17bf45f3d39ec651639.tar.gz
CMake-ad19da011d5702da3407a17bf45f3d39ec651639.tar.bz2
Refactor: Add cmSystemTools::GetSystemName()
And use it for CMAKE_HOST_SYSTEM_NAME and CMAKE_SYSTEM_NAME.
Diffstat (limited to 'Modules/CMakeDetermineSystem.cmake')
-rw-r--r--Modules/CMakeDetermineSystem.cmake39
1 files changed, 8 insertions, 31 deletions
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index bae270d..c3f2b74 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -158,37 +158,14 @@ endif()
include(Platform/${CMAKE_SYSTEM_NAME}-Determine OPTIONAL)
-macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
- if(NOT ${_PREFIX}_NAME)
- set(${_PREFIX}_NAME "UnknownOS")
- endif()
-
- # fix for BSD/OS , remove the /
- if(${_PREFIX}_NAME MATCHES BSD.OS)
- set(${_PREFIX}_NAME BSDOS)
- endif()
-
- # fix for GNU/kFreeBSD, remove the GNU/
- if(${_PREFIX}_NAME MATCHES kFreeBSD)
- set(${_PREFIX}_NAME kFreeBSD)
- endif()
-
- # fix for CYGWIN which has windows version in it
- if(${_PREFIX}_NAME MATCHES CYGWIN)
- set(${_PREFIX}_NAME CYGWIN)
- endif()
-
- # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
- set(${_PREFIX} ${${_PREFIX}_NAME})
- # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
- if(${_PREFIX}_VERSION)
- set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
- endif()
-
-endmacro()
-
-ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
-ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
+set(CMAKE_SYSTEM ${CMAKE_SYSTEM_NAME})
+if(CMAKE_SYSTEM_VERSION)
+ string(APPEND CMAKE_SYSTEM -${CMAKE_SYSTEM_VERSION})
+endif()
+set(CMAKE_HOST_SYSTEM ${CMAKE_HOST_SYSTEM_NAME})
+if(CMAKE_HOST_SYSTEM_VERSION)
+ string(APPEND CMAKE_HOST_SYSTEM -${CMAKE_HOST_SYSTEM_VERSION})
+endif()
# this file is also executed from cpack, then we don't need to generate these files
# in this case there is no CMAKE_BINARY_DIR