summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-09 14:04:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-09 14:05:41 (GMT)
commite71605dfb44c69db6fccb7d36a58b6c9f7761ed5 (patch)
treea5a9b2f71fde9a117aa66c4b51f87a4adee9f1d5
parent281113af876a9cbc52b455c61766245448b02141 (diff)
parent1ea8b8ed86628ecaa6a6e47231cefb2d68ac9e73 (diff)
downloadCMake-e71605dfb44c69db6fccb7d36a58b6c9f7761ed5.zip
CMake-e71605dfb44c69db6fccb7d36a58b6c9f7761ed5.tar.gz
CMake-e71605dfb44c69db6fccb7d36a58b6c9f7761ed5.tar.bz2
Merge topic 'BSD'
1ea8b8ed86 BSD: Set CMAKE_HOST_BSD variable on a BSD host 288f72efea BSD: Only use BSD as variable for target BSD system Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7648
-rw-r--r--Help/manual/cmake-variables.7.rst5
-rw-r--r--Help/release/dev/BSD.rst8
-rw-r--r--Help/release/dev/bsd-variables.rst9
-rw-r--r--Help/variable/BSD.rst3
-rw-r--r--Help/variable/CMAKE_HOST_BSD.rst7
-rw-r--r--Help/variable/DRAGONFLYBSD.rst6
-rw-r--r--Help/variable/FREEBSD.rst6
-rw-r--r--Help/variable/NETBSD.rst6
-rw-r--r--Help/variable/OPENBSD.rst6
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake1
-rw-r--r--Modules/Platform/DragonFly.cmake3
-rw-r--r--Modules/Platform/FreeBSD.cmake3
-rw-r--r--Modules/Platform/NetBSD.cmake3
-rw-r--r--Modules/Platform/OpenBSD.cmake3
-rw-r--r--Source/cmStateSnapshot.cxx14
15 files changed, 37 insertions, 46 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index ad6bfbc..22fae08 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -309,6 +309,7 @@ Variables that Describe the System
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
+ /variable/CMAKE_HOST_BSD
/variable/CMAKE_HOST_SOLARIS
/variable/CMAKE_HOST_SYSTEM
/variable/CMAKE_HOST_SYSTEM_NAME
@@ -324,8 +325,6 @@ Variables that Describe the System
/variable/CMAKE_SYSTEM_PROCESSOR
/variable/CMAKE_SYSTEM_VERSION
/variable/CYGWIN
- /variable/DRAGONFLYBSD
- /variable/FREEBSD
/variable/GHSMULTI
/variable/IOS
/variable/LINUX
@@ -344,8 +343,6 @@ Variables that Describe the System
/variable/MSVC_TOOLSET_VERSION
/variable/MSVC_VERSION
/variable/MSYS
- /variable/NETBSD
- /variable/OPENBSD
/variable/UNIX
/variable/WIN32
/variable/WINCE
diff --git a/Help/release/dev/BSD.rst b/Help/release/dev/BSD.rst
new file mode 100644
index 0000000..cd2352b
--- /dev/null
+++ b/Help/release/dev/BSD.rst
@@ -0,0 +1,8 @@
+Variables
+---------
+
+* The :variable:`BSD` variable is set to a string value when the target system is BSD.
+ This value can be one of the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
+
+* The :variable:`CMAKE_HOST_BSD` variable is set to a string value when the host system is BSD.
+ This value can be one of the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
diff --git a/Help/release/dev/bsd-variables.rst b/Help/release/dev/bsd-variables.rst
deleted file mode 100644
index 9d59edc..0000000
--- a/Help/release/dev/bsd-variables.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-bsd-variables
--------------
-
-* The :variable:`BSD` variable is set to true when the target system
- is BSD (DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD)
-* The :variable:`DRAGONFLYBSD` variable is set to true when the target system is DragonFlyBSD.
-* The :variable:`FREEBSD` variable is set to true when the target system is FreeBSD.
-* The :variable:`NETBSD` variable is set to true when the target system is NetBSD.
-* The :variable:`OPENBSD` variable is set to true when the target system is OpenBSD.
diff --git a/Help/variable/BSD.rst b/Help/variable/BSD.rst
index 0b3e5dc..fdfe5ec 100644
--- a/Help/variable/BSD.rst
+++ b/Help/variable/BSD.rst
@@ -3,4 +3,5 @@ BSD
.. versionadded:: 3.25
-Set to true when the target system is BSD (DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD)
+Set to a string value when the target system is BSD. This value can be one of
+the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
diff --git a/Help/variable/CMAKE_HOST_BSD.rst b/Help/variable/CMAKE_HOST_BSD.rst
new file mode 100644
index 0000000..d3554f9
--- /dev/null
+++ b/Help/variable/CMAKE_HOST_BSD.rst
@@ -0,0 +1,7 @@
+CMAKE_HOST_BSD
+--------------
+
+.. versionadded:: 3.25
+
+Set to a string value when the host system is BSD. This value can be one of
+the following: DragonFlyBSD, FreeBSD, OpenBSD, or NetBSD.
diff --git a/Help/variable/DRAGONFLYBSD.rst b/Help/variable/DRAGONFLYBSD.rst
deleted file mode 100644
index f006156..0000000
--- a/Help/variable/DRAGONFLYBSD.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-DRAGONFLYBSD
-------------
-
-.. versionadded:: 3.25
-
-Set to true when the target system is DragonFlyBSD.
diff --git a/Help/variable/FREEBSD.rst b/Help/variable/FREEBSD.rst
deleted file mode 100644
index 9990948..0000000
--- a/Help/variable/FREEBSD.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-FREEBSD
--------
-
-.. versionadded:: 3.25
-
-Set to true when the target system is FreeBSD.
diff --git a/Help/variable/NETBSD.rst b/Help/variable/NETBSD.rst
deleted file mode 100644
index e7965f8..0000000
--- a/Help/variable/NETBSD.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-NETBSD
-------
-
-.. versionadded:: 3.25
-
-Set to true when the target system is NetBSD.
diff --git a/Help/variable/OPENBSD.rst b/Help/variable/OPENBSD.rst
deleted file mode 100644
index dd9b23d..0000000
--- a/Help/variable/OPENBSD.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-OPENBSD
--------
-
-.. versionadded:: 3.25
-
-Set to true when the target system is OpenBSD.
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index e045932..319b0bb 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -16,6 +16,7 @@ set(UNIX )
set(CYGWIN )
set(MSYS )
set(WIN32 )
+set(BSD )
function(_cmake_record_install_prefix )
set(_CMAKE_SYSTEM_PREFIX_PATH_INSTALL_PREFIX_VALUE "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake
index d8bc05a..994ba79 100644
--- a/Modules/Platform/DragonFly.cmake
+++ b/Modules/Platform/DragonFly.cmake
@@ -3,8 +3,7 @@
# see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361
include(Platform/FreeBSD)
-unset(FREEBSD)
-set(DRAGONFLYBSD 1)
+set(BSD "DragonFlyBSD")
# DragonFly BSD requires -z origin to enable $ORIGIN expansion in RPATH.
# This is not required for FreeBSD since 10.2-RELEASE.
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index e968a78..9cd9399 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -1,5 +1,4 @@
-set(FREEBSD 1)
-set(BSD 1)
+set(BSD "FreeBSD")
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index a64bf0b..52c6594 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -1,5 +1,4 @@
-set(NETBSD 1)
-set(BSD 1)
+set(BSD "NetBSD")
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index f6b955a..51ea60d 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -1,6 +1,5 @@
include(Platform/NetBSD)
-unset(NETBSD)
-set(OPENBSD 1)
+set(BSD "OpenBSD")
# On OpenBSD, the compile time linker does not share it's configuration with
# the runtime linker. This will extract the library search paths from the
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index f73df8f..102d1ce 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -317,6 +317,20 @@ void cmStateSnapshot::SetDefaultDefinitions()
this->SetDefinition("CMAKE_HOST_SOLARIS", "1");
#endif
+#if defined(__OpenBSD__)
+ this->SetDefinition("BSD", "OpenBSD");
+ this->SetDefinition("CMAKE_HOST_BSD", "OpenBSD");
+#elif defined(__FreeBSD__)
+ this->SetDefinition("BSD", "FreeBSD");
+ this->SetDefinition("CMAKE_HOST_BSD", "FreeBSD");
+#elif defined(__NetBSD__)
+ this->SetDefinition("BSD", "NetBSD");
+ this->SetDefinition("CMAKE_HOST_BSD", "NetBSD");
+#elif defined(__DragonFly__)
+ this->SetDefinition("BSD", "DragonFlyBSD");
+ this->SetDefinition("CMAKE_HOST_BSD", "DragonFlyBSD");
+#endif
+
this->SetDefinition("CMAKE_MAJOR_VERSION",
std::to_string(cmVersion::GetMajorVersion()));
this->SetDefinition("CMAKE_MINOR_VERSION",