Modules/*Compiler: reword errors about invalid variable settings

The prior wording could be confusing if "compiler set" is detected as a
noun rather than "set" as a verb.

See: https://discourse.cmake.org/t/cmake-3-29-can-not-find-compiler-set-for-intel-ifx/11712
This commit is contained in:
Ben Boeckel committed 2026-02-20 09:03:23 -05:00
1 parent ff0cd9500e
commit 108d86f28d
13 files changed
+20 -20

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_FLAGS_ENV_INIT}" CACHE STRING "Arguments to ASM${ASM_DIALECT} compiler")
endif()
if(NOT EXISTS ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ASM${ASM_DIALECT}:\n$ENV{ASM${ASM_DIALECT}}.")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable ASM${ASM_DIALECT}:\n$ENV{ASM${ASM_DIALECT}}.")
endif()
endif()
+1 -1
View File
@@ -45,7 +45,7 @@ else()
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "Arguments to C compiler")
endif()
if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable CC:\n$ENV{CC}.")
endif()
endif()
+3 -3
View File
@@ -26,7 +26,7 @@ else()
set(CMAKE_CUDA_COMPILER_ARG1 "${CMAKE_CUDA_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CUDA compiler")
endif()
if(NOT EXISTS ${CMAKE_CUDA_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CUDACXX:\n$ENV{CUDACXX}.\n${CMAKE_CUDA_COMPILER_INIT}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable CUDACXX:\n$ENV{CUDACXX}.\n${CMAKE_CUDA_COMPILER_INIT}")
endif()
endif()
@@ -48,7 +48,7 @@ else()
if(NOT $ENV{CUDAHOSTCXX} STREQUAL "")
get_filename_component(CMAKE_CUDA_HOST_COMPILER $ENV{CUDAHOSTCXX} PROGRAM)
if(NOT EXISTS ${CMAKE_CUDA_HOST_COMPILER})
message(FATAL_ERROR "Could not find compiler set in environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CMAKE_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CMAKE_CUDA_HOST_COMPILER}")
endif()
elseif(CMAKE_CUDA_HOST_COMPILER)
# We get here if CMAKE_CUDA_HOST_COMPILER was specified by the user or toolchain file.
@@ -64,7 +64,7 @@ else()
unset(_CMAKE_CUDA_HOST_COMPILER_PATH)
endif()
if(NOT EXISTS "${CMAKE_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find compiler set in variable CMAKE_CUDA_HOST_COMPILER:\n ${CMAKE_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the variable CMAKE_CUDA_HOST_COMPILER:\n ${CMAKE_CUDA_HOST_COMPILER}")
endif()
# If the value was cached, update the cache entry with our modifications.
get_property(_CMAKE_CUDA_HOST_COMPILER_CACHED CACHE CMAKE_CUDA_HOST_COMPILER PROPERTY TYPE)
+1 -1
View File
@@ -44,7 +44,7 @@ else()
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CXX compiler")
endif()
if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
endif()
endif()
+1 -1
View File
@@ -30,7 +30,7 @@ else()
endif()
if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
else()
message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable FC:\n$ENV{FC}.")
endif()
endif()
+3 -3
View File
@@ -48,7 +48,7 @@ if(NOT CMAKE_HIP_COMPILER)
set(CMAKE_HIP_COMPILER_ARG1 "${CMAKE_HIP_FLAGS_ENV_INIT}" CACHE STRING "Arguments to CXX compiler")
endif()
if(NOT EXISTS ${CMAKE_HIP_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable HIPCXX:\n$ENV{HIPCXX}.\n${CMAKE_HIP_COMPILER_INIT}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable HIPCXX:\n$ENV{HIPCXX}.\n${CMAKE_HIP_COMPILER_INIT}")
endif()
endif()
@@ -113,7 +113,7 @@ if(NOT CMAKE_HIP_COMPILER_ID_RUN)
if(NOT CMAKE_HIP_HOST_COMPILER AND NOT $ENV{HIPHOSTCXX} STREQUAL "")
get_filename_component(CMAKE_HIP_HOST_COMPILER $ENV{HIPHOSTCXX} PROGRAM)
if(NOT EXISTS "${CMAKE_HIP_HOST_COMPILER}")
message(FATAL_ERROR "Could not find compiler set in environment variable HIPHOSTCXX:\n$ENV{HIPHOSTCXX}.\n${CMAKE_HIP_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable HIPHOSTCXX:\n$ENV{HIPHOSTCXX}.\n${CMAKE_HIP_HOST_COMPILER}")
endif()
elseif(CMAKE_HIP_HOST_COMPILER)
# We get here if CMAKE_HIP_HOST_COMPILER was specified by the user or toolchain file.
@@ -129,7 +129,7 @@ if(NOT CMAKE_HIP_COMPILER_ID_RUN)
unset(_CMAKE_HIP_HOST_COMPILER_PATH)
endif()
if(NOT EXISTS "${CMAKE_HIP_HOST_COMPILER}")
message(FATAL_ERROR "Could not find compiler set in variable CMAKE_HIP_HOST_COMPILER:\n ${CMAKE_HIP_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the variable CMAKE_HIP_HOST_COMPILER:\n ${CMAKE_HIP_HOST_COMPILER}")
endif()
# If the value was cached, update the cache entry with our modifications.
get_property(_CMAKE_HIP_HOST_COMPILER_CACHED CACHE CMAKE_HIP_HOST_COMPILER PROPERTY TYPE)
+1 -1
View File
@@ -29,7 +29,7 @@ if(NOT CMAKE_ISPC_COMPILER)
set(CMAKE_ISPC_COMPILER_ARG1 "${CMAKE_ISPC_FLAGS_ENV_INIT}" CACHE STRING "First argument to ISPC compiler")
endif()
if(NOT EXISTS ${CMAKE_ISPC_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ISPC:\n$ENV{ISPC}.")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable ISPC:\n$ENV{ISPC}.")
endif()
endif()
+3 -3
View File
@@ -14,21 +14,21 @@ if(NOT CMAKE_Java_COMPILER)
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Java compiler")
endif()
if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
message(SEND_ERROR "Could not find the compiler specified in the environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
endif()
endif()
if(NOT $ENV{JAVA_RUNTIME} STREQUAL "")
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
message(SEND_ERROR "Could not find the compiler specified in the environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
endif()
endif()
if(NOT $ENV{JAVA_ARCHIVE} STREQUAL "")
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
message(SEND_ERROR "Could not find the compiler specified in the environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
endif()
endif()
+1 -1
View File
@@ -40,7 +40,7 @@ else()
set(CMAKE_OBJC_COMPILER_ARG1 "${CMAKE_OBJC_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Objective-C compiler")
endif()
if(NOT EXISTS ${CMAKE_OBJC_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ${var}:\n $ENV{${var}}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable ${var}:\n $ENV{${var}}")
endif()
break()
endif()
+1 -1
View File
@@ -42,7 +42,7 @@ else()
set(CMAKE_OBJCXX_COMPILER_ARG1 "${CMAKE_OBJCXX_FLAGS_ENV_INIT}" CACHE STRING "Arguments to Objective-C++ compiler")
endif()
if(NOT EXISTS ${CMAKE_OBJCXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable ${var}:\n $ENV{${var}}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable ${var}:\n $ENV{${var}}")
endif()
break()
endif()
+1 -1
View File
@@ -17,7 +17,7 @@ if(NOT CMAKE_RC_COMPILER)
endif()
if(EXISTS ${CMAKE_RC_COMPILER_INIT})
else()
message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable RC:\n$ENV{RC}.")
endif()
endif()
+1 -1
View File
@@ -37,7 +37,7 @@ elseif("${CMAKE_GENERATOR}" MATCHES "^Ninja")
STRING "Arguments to the Swift compiler")
endif()
if(NOT EXISTS ${CMAKE_Swift_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable SWIFTC\n$ENV{SWIFTC}.\n${CMAKE_Swift_COMPILER_INIT}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable SWIFTC\n$ENV{SWIFTC}.\n${CMAKE_Swift_COMPILER_INIT}")
endif()
endif()
+2 -2
View File
@@ -706,7 +706,7 @@ else()
if(NOT $ENV{CUDAHOSTCXX} STREQUAL "")
get_filename_component(CUDAToolkit_CUDA_HOST_COMPILER $ENV{CUDAHOSTCXX} PROGRAM)
if(NOT EXISTS ${CUDAToolkit_CUDA_HOST_COMPILER})
message(FATAL_ERROR "Could not find compiler set in environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CUDAToolkit_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CUDAToolkit_CUDA_HOST_COMPILER}")
endif()
elseif(CUDAToolkit_CUDA_HOST_COMPILER)
# We get here if CUDAToolkit_CUDA_HOST_COMPILER was specified by the user or toolchain file.
@@ -722,7 +722,7 @@ else()
unset(_CUDAToolkit_CUDA_HOST_COMPILER_PATH)
endif()
if(NOT EXISTS "${CUDAToolkit_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find compiler set in variable CUDAToolkit_CUDA_HOST_COMPILER:\n ${CUDAToolkit_CUDA_HOST_COMPILER}")
message(FATAL_ERROR "Could not find the compiler specified in the variable CUDAToolkit_CUDA_HOST_COMPILER:\n ${CUDAToolkit_CUDA_HOST_COMPILER}")
endif()
# If the value was cached, update the cache entry with our modifications.
get_property(_CUDAToolkit_CUDA_HOST_COMPILER_CACHED CACHE CUDAToolkit_CUDA_HOST_COMPILER PROPERTY TYPE)