[cmake-developers] [CMake 0012471]: CMake add_custom_command problem when triggering a FATAL_ERROR in MSVC

Mantis Bug Tracker mantis at public.kitware.com
Wed Sep 21 09:09:41 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12471 
====================================================================== 
Reported By:                Hauke Heibel
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12471
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-09-21 09:09 EDT
Last Modified:              2011-09-21 09:09 EDT
====================================================================== 
Summary:                    CMake add_custom_command problem when triggering a
FATAL_ERROR in MSVC
Description: 
If have multiple custom commands which call

  message(FATAL_ERROR "Some message")

in case of errors. If you do this and encounter such a case MSVC generates many
MSB3073 errors. I think this issue is somewhat related to
http://public.kitware.com/Bug/view.php?id=11938.

The problem is that the MSVC's error message hides the one generated by CMake.
It were nice, if CMake could terminate the script without issuing multiple
MSB3073 errors.

Steps to Reproduce: 
Create any custom command via

add_custom_command(TARGET FooCommand 
  COMMAND ${CMAKE_COMMAND}
  -P BarScript.cmake
)

and call

message(FATAL_ERROR "Some message")

from within the BarScript.cmake
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-09-21 09:09 Hauke Heibel   New Issue                                    
2011-09-21 09:09 Hauke Heibel   File Added: msvc_error_output.txt               
    
======================================================================




More information about the cmake-developers mailing list