From 186673ba0b89edaffc2325630ed1be126eec768d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 24 Oct 2023 09:09:17 -0400 Subject: [PATCH] cmGlobalGenerator: hint about missing extensions on Windows Discussed on Discourse: https://discourse.cmake.org/t/cross-compiling-from-a-windows-host-targeting-raspbian-32-bits-arm/9250 --- Source/cmGlobalGenerator.cxx | 6 +++++- Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt | 3 ++- .../RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt | 3 ++- Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt | 3 ++- .../RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt | 3 ++- .../CompilerNotFound/BadCompilerCXX-stderr-NMake.txt | 3 ++- Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt | 3 ++- .../CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt | 6 ++++-- .../CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt | 6 ++++-- .../RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt | 6 ++++-- 10 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index e798d3e904..ef0f40f054 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -874,7 +874,11 @@ void cmGlobalGenerator::EnableLanguage( noCompiler << "The " << compilerName << ":\n" " " << *compilerFile << "\n" - "is not a full path and was not found in the PATH.\n" + "is not a full path and was not found in the PATH." +#ifdef _WIN32 + " Perhaps the extension is missing?" +#endif + "\n" ; /* clang-format on */ } else if (!cmSystemTools::FileExists(*compilerFile)) { diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt index b7db7eb58d..bc5d9eaa67 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the JOM generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt index 03c5933407..80d8a21238 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the NMake generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt index c98842d976..96d02de17d 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt index 4b42ea6ffd..d1087870ca 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the JOM generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt index 1bfcdcc418..d3c0ccd749 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the NMake generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt index 7ef4f5e7c9..79db41df40 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt index f25a267a66..360a8c2a77 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the JOM generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is @@ -21,7 +22,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the JOM generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt index ffcdce8689..8438d0e6c4 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the NMake generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is @@ -21,7 +22,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? To use the NMake generator with Visual C\+\+, cmake must be run from a shell that can use the compiler cl from the command line. This environment is diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt index eecff54fd6..cba0db2cee 100644 --- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt +++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt @@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-C-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? Tell CMake where to find the compiler by setting either the environment variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to @@ -16,7 +17,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\): no-CXX-compiler - is not a full path and was not found in the PATH. + is not a full path and was not found in the PATH.( Perhaps the extension is + missing\?)? Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path