The second of the current minute. 60 represents a leap second. (00-60)
``%f``
+ .. versionadded:: 3.23
+
The microsecond of the current second (000000-999999).
``%U``
The old ``CPACK_PACKAGEMAKER_CHOICES`` variable is now also set to the
same content as it was before, but it is formally deprecated.
-3.23.3, 3.23.4
---------------
+3.23.3, 3.23.4, 3.23.5
+----------------------
* These versions made no changes to documented features or interfaces.
Some implementation updates were made to support ecosystem changes
;Run the uninstaller
uninst:
ClearErrors
- StrCpy $2 $0 1
- StrCmp '"' $2 0 +3 ; checks if string is quoted (CPack before v3.20.6 did not quote it)
- ExecWait '$0 /S'
- Goto +2
- ExecWait '"$0" /S'
+ # $0 should _always_ be quoted, however older versions of CMake did not
+ # do this. We'll conditionally remove the begin/end quotes.
+ # Remove first char if quote
+ StrCpy $2 $0 1 0 # copy first char
+ StrCmp $2 "$\"" 0 +2 # if char is quote
+ StrCpy $0 $0 "" 1 # remove first char
+ # Remove last char if quote
+ StrCpy $2 $0 1 -1 # copy last char
+ StrCmp $2 "$\"" 0 +2 # if char is quote
+ StrCpy $0 $0 -1 # remove last char
+
+ StrLen $2 "\@CPACK_NSIS_UNINSTALL_NAME@.exe"
+ StrCpy $3 $0 -$2 # remove "\@CPACK_NSIS_UNINSTALL_NAME@.exe" from UninstallString to get path
+ ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst
uninst_failed:
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 23)
-set(CMake_VERSION_PATCH 4)
+set(CMake_VERSION_PATCH 5)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info.
- set(git_info [==[34a6da34b8 CMake 3.23.4]==])
+ set(git_info [==[91ccfa3302 CMake 3.23.5]==])
# Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
cm_check_cxx_feature(unique_ptr)
-if (NOT CMAKE_CXX_STANDARD LESS "17"
- AND NOT MSYS # FIXME: RunCMake.cmake_path cases crash with MSYS std::filesystem
- )
+if (NOT CMAKE_CXX_STANDARD LESS "17")
if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
cm_check_cxx_feature(filesystem TRY_RUN)
else()
}
#endif
+ // If std::string is copy-on-write, the std::filesystem::path
+ // implementation may accidentally trigger a reallocation and compute
+ // an offset between two allocations, leading to undefined behavior.
+#if defined(__GLIBCXX__) && \
+ (!defined(_GLIBCXX_USE_CXX11_ABI) || !_GLIBCXX_USE_CXX11_ABI)
+ std::string p5s1 = "/path";
+ std::string p5s2 = std::move(p5s1);
+ std::filesystem::path p5 = std::string(p5s2);
+ p5.remove_filename();
+#endif
+
return 0;
}
fprintf(fout, "cmake_policy(SET CMP0126 OLD)\n");
}
+ /* Set language extensions policy to match outer project. */
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0128) !=
+ cmPolicies::NEW) {
+ fprintf(fout, "cmake_policy(SET CMP0128 OLD)\n");
+ }
+
std::string projectLangs;
for (std::string const& li : testLangs) {
projectLangs += " " + li;
return false;
}
- // New buffer size 8 MiB
- constexpr auto buildFileStreamBufferSize = 8 * 1024 * 1024;
-
- // Ensure the buffer is allocated
- if (!this->BuildFileStreamBuffer) {
- this->BuildFileStreamBuffer =
- cm::make_unique<char[]>(buildFileStreamBufferSize);
- }
-
- // Enlarge the internal buffer of the `BuildFileStream`
- this->BuildFileStream->rdbuf()->pubsetbuf(this->BuildFileStreamBuffer.get(),
- buildFileStreamBufferSize);
-
// Write a comment about this file.
*this->BuildFileStream
<< "# This file contains all the build statements describing the\n"
/// The file containing the build statement. (the relationship of the
/// compilation DAG).
std::unique_ptr<cmGeneratedFileStream> BuildFileStream;
- std::unique_ptr<char[]> BuildFileStreamBuffer;
/// The file containing the rule statements. (The action attached to each
/// edge of the compilation DAG).
std::unique_ptr<cmGeneratedFileStream> RulesFileStream;
--- /dev/null
+include(${RunCMake_SOURCE_DIR}/Intl-common.cmake)
+set(output "${RunCMake_TEST_BINARY_DIR}/${intl}-output.txt")
+if(NOT EXISTS "${output}")
+ set(RunCMake_TEST_FAILED "Expected output does not exist:\n ${output}")
+endif()
--- /dev/null
+set(intl "intl-ë®")
--- /dev/null
+include(Intl-common.cmake)
+set(input "${CMAKE_CURRENT_BINARY_DIR}/${intl}-input.txt")
+set(output "${CMAKE_CURRENT_BINARY_DIR}/${intl}-output.txt")
+file(WRITE "${input}" "${intl}\n")
+add_custom_command(OUTPUT "${output}"
+ COMMAND ${CMAKE_COMMAND} -E copy "${input}" "${output}")
+add_custom_target(drive ALL DEPENDS "${output}")
endfunction()
run_NinjaToolMissing()
+function(run_Intl)
+ run_cmake(Intl)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Intl-build)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ run_cmake_command(Intl-build ${CMAKE_COMMAND} --build .)
+endfunction()
+run_Intl()
+
function(run_NoWorkToDo)
run_cmake(NoWorkToDo)
set(RunCMake_TEST_NO_CLEAN 1)
--- /dev/null
+cmake_policy(SET CMP0128 NEW)
+set(check_cxx_std "
+#if __cplusplus > 199711L && __cplusplus <= 201103L
+# error Compiler is incorrectly in C++11 mode.
+#endif
+")
+include(CMP0128-common.cmake)
--- /dev/null
+
+set(check_cxx_std "
+#if __cplusplus <= 199711L || __cplusplus > 201103L
+# error Compiler is incorrectly not in C++11 mode.
+#endif
+")
+include(CMP0128-common.cmake)
--- /dev/null
+cmake_policy(SET CMP0067 NEW)
+enable_language(CXX)
+
+# Isolate the one try_compile below in the error log.
+set(CMakeError_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
+file(REMOVE "${CMakeError_log}")
+
+# Add our own -std= flag to the try_compile check.
+set(CMAKE_REQUIRED_FLAGS -std=c++11)
+
+# Tell CMP0128 NEW behavior to append a -std= flag (after ours).
+if(CMAKE_CXX_EXTENSIONS_DEFAULT)
+ set(CMAKE_CXX_EXTENSIONS OFF)
+else()
+ set(CMAKE_CXX_EXTENSIONS ON)
+endif()
+
+include(CheckSourceCompiles)
+check_source_compiles(CXX "
+${check_cxx_std}
+int main()
+{
+ return 0;
+}
+" SRC_COMPILED)
+if(NOT SRC_COMPILED)
+ if(EXISTS "${CMakeError_log}")
+ file(READ "${CMakeError_log}" err_log)
+ endif()
+ message("${err_log}")
+endif()
--- /dev/null
+enable_language(CXX)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" "
+set(CMAKE_CXX_EXTENSIONS_DEFAULT \"${CMAKE_CXX_EXTENSIONS_DEFAULT}\")
+")
unset(RunCMake_TEST_NO_CLEAN)
endif()
+# Lookup CMAKE_CXX_EXTENSIONS_DEFAULT.
+# FIXME: Someday we could move this to the top of the file and use it in
+# place of some of the values passed by 'Tests/RunCMake/CMakeLists.txt'.
+run_cmake(Inspect)
+include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake")
+
+# FIXME: Support more compilers and default standard levels.
+if (DEFINED CMAKE_CXX_STANDARD_DEFAULT AND
+ DEFINED CMAKE_CXX_EXTENSIONS_DEFAULT AND (
+ (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7) OR
+ (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+ ))
+ run_cmake(CMP0128-WARN)
+ if(NOT CMAKE_CXX_STANDARD_DEFAULT EQUAL 11)
+ run_cmake(CMP0128-NEW)
+ endif()
+endif()
+
if(UNIX)
run_cmake(CleanupNoFollowSymlink)
endif()
path& remove_filename()
{
-# if defined(__CYGWIN__)
- // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090.
- static_cast<void>(this->path_.data());
-# endif
auto fname = this->get_filename();
if (!fname.empty()) {
- this->path_.erase(fname.data() - this->path_.data());
+ this->path_.erase(fname.data() -
+ // Avoid C++17 non-const .data() that may reallocate.
+ static_cast<path_type const&>(this->path_).data());
}
return *this;
}
path& replace_extension(const path& replacement = path())
{
-# if defined(__CYGWIN__)
- // FIXME: Avoid crash due to CYGWIN/MSYS bug(?). See CMake Issue 22090.
- static_cast<void>(this->path_.data());
-# endif
auto ext = this->get_filename_fragment(filename_fragment::extension);
if (!ext.empty()) {
- this->path_.erase(ext.data() - this->path_.data());
+ this->path_.erase(ext.data() -
+ // Avoid C++17 non-const .data() that may reallocate.
+ static_cast<path_type const&>(this->path_).data());
}
if (!replacement.path_.empty()) {
if (replacement.path_[0] != '.') {