(从这个问题衍生出来)
假设我尝试配置一个使用 CUDA 的项目,即调用
enable_language(CUDA)
在CMakeLists.txt中,配置时,我被告知:
... etc. etc. ...
CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineCompilerId.cmake:838 (message):
Compiling the CUDA compiler identification source file
"CMakeCUDACompilerId.cu" failed.
Compiler:
Build flags:
Id flags: --keep;--keep-dir;tmp -v`
"CMakeCUDACompilerId.cu" failed.
Compiler: C:/Program Files/NVIDIA GPU Computing
Toolkit/CUDA/v11.6/bin/nvcc.exe
Build flags:
Id flags: --keep;--keep-dir;tmp -v
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
C:/Program Files/CMake/share/cmake-3.30/Modules/CMakeDetermineCUDACompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:34 (enable_language)
好吧,公平地说,这是一个错误 - 但我需要知道错误是什么!在哪里可以找到该编译尝试的错误日志或标准错误流?假设我用 cmake -B C:\Path\To\BuildDir
构建。
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml为了完整起见,在 CMake 3.25 之前,错误记录在名为
CMakeError.log
的文件中。请参阅此问题了解更多信息。