summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/command/if.rst19
-rw-r--r--Modules/GNUInstallDirs.cmake4
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmTimestamp.cxx2
-rw-r--r--Source/cmcldeps.cxx3
5 files changed, 22 insertions, 8 deletions
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 6ff8852..5dba13e 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -56,12 +56,23 @@ Basic Expressions
``NO``, ``FALSE``, ``N``, ``IGNORE``, ``NOTFOUND``, the empty string,
or ends in the suffix ``-NOTFOUND``. Named boolean constants are
case-insensitive. If the argument is not one of these specific
- constants, it is treated as a variable or string and the following
- signature is used.
+ constants, it is treated as a variable or string (see `Variable Expansion`_
+ further below) and one of the following two forms applies.
-``if(<variable|string>)``
+``if(<variable>)``
True if given a variable that is defined to a value that is not a false
- constant. False otherwise. (Note macro arguments are not variables.)
+ constant. False otherwise, including if the variable is undefined.
+ Note that macro arguments are not variables.
+ Environment variables also cannot be tested this way, e.g.
+ ``if(ENV{some_var})`` will always evaluate to false.
+
+``if(<string>)``
+ A quoted string always evaluates to false unless:
+
+ * The string's value is one of the true constants, or
+ * Policy :policy:`CMP0054` is not set to ``NEW`` and the string's value
+ happens to be a variable name that is affected by :policy:`CMP0054`'s
+ behavior.
Logic Operators
"""""""""""""""
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 851943d..4e7f87b 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -255,7 +255,9 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
elseif(DEFINED ENV{CONDA_PREFIX})
set(conda_prefix "$ENV{CONDA_PREFIX}")
cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
- if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix)
+ if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix AND
+ NOT ("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" OR
+ "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$"))
set(__system_type_for_install "conda")
endif()
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 6d720cc..52b3ed0 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 22)
-set(CMake_VERSION_PATCH 20211130)
+set(CMake_VERSION_PATCH 20211201)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index c8f5a4b..3826577 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -197,7 +197,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag,
#ifdef __MINGW32__
/* See a bug in MinGW: https://sourceforge.net/p/mingw-w64/bugs/793/. A work
* around is to try to use strftime() from ucrtbase.dll. */
- using T = size_t(WINAPI*)(char*, size_t, const char*, const struct tm*);
+ using T = size_t(__cdecl*)(char*, size_t, const char*, const struct tm*);
auto loadUcrtStrftime = []() -> T {
auto handle =
LoadLibraryExA("ucrtbase.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 5c27ac1..8921aa0 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -294,7 +294,8 @@ int main()
return exit_code;
// compile rc file with rc.exe
- return process(srcfilename, "", objfile, prefix, binpath + " " + rest);
+ return process(srcfilename, "", objfile, prefix, binpath + " " + rest,
+ std::string(), true);
}
usage("Invalid language specified.");