<div dir="auto">cmake -P usually do the right thing. Here you ignore the error because you only message (STATUS ...)<div dir="auto">Try adding message (ERROR ...) or message (FATAL_ERROR ...) when execute_process producer error and tout custom command should faim.</div></div><div class="gmail_extra"><br><div class="gmail_quote">Le 26 févr. 2018 20:19, "Michael Jackson" <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In our CMake based project I generate a *.cmake file which I call with the following bit of code:<br>
<br>
add_custom_target(DREAM3D_MKDO<wbr>CS_GENERATION ALL<br>
COMMAND "${CMAKE_COMMAND}" -P "${docsCmakeFile}"<br>
COMMENT "using mkdocs to generate the documentation"<br>
)<br>
<br>
Inside the generated file is the following cmake command:<br>
<br>
message(STATUS "Starting mkdocs execution. This can take a while.....")<br>
execute_process(COMMAND "/path/to/mkdocs" build<br>
OUTPUT_VARIABLE mkdocs_gen_output<br>
RESULT_VARIABLE mkdocs_gen_result<br>
ERROR_VARIABLE mkdocs_gen_error<br>
WORKING_DIRECTORY "/Users/mjackson/DREAM3D-Dev/D<wbr>REAM3D-Build/Debug/Documentati<wbr>on/mkdocs"<br>
)<br>
message(STATUS "mkdocs_gen_result: ${mkdocs_gen_result}")<br>
message(STATUS "mkdocs_gen_error: ${mkdocs_gen_error}")<br>
message(STATUS "*****************************<wbr>******************************<wbr>***************")<br>
message(STATUS "mkdocs_gen_output: ${mkdocs_gen_output}")<br>
message(STATUS "*****************************<wbr>******************************<wbr>***************")<br>
<br>
<br>
The issue that I am having is that if the mkdocs command fails, the build does NOT show the failure. Is there a way to have the "cmake -P" command pick up the fact that the cmake script failed so that the build fails or throws a warning/error?<br>
<br>
Thanks<br>
Mike Jackson<br>
<br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/list<wbr>info/cmake</a><br>
</blockquote></div></div>