Hi Michael,
you probably figured this out by now, but for future reference: You have to
log to stderr to make the script fail.
This example works (as in /does not build/ ;) ):
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/skript.cmake"
CONTENT "message(FATAL_ERROR \"Script failed!
-Original Message-
From: "Alan W. Irwin"
Date: Monday, February 26, 2018 at 6:02 PM
To: Michael Jackson
Cc: CMake Mail List
Subject: Re: [CMake] Return an Error Code (or something) from a CMake Script.
On 2018-02-26 14:19-0500 Michael Jackson wrote:
> In ou
On 2018-02-26 14:19-0500 Michael Jackson wrote:
In our CMake based project I generate a *.cmake file which I call with the
following bit of code:
add_custom_target(DREAM3D_MKDOCS_GENERATION ALL
COMMAND "${CMAKE_COMMAND}" -P "${docsCmakeFile}"
COMMENT "using mkdocs to generate the docume
cmake -P usually do the right thing. Here you ignore the error because you
only message (STATUS ...)
Try adding message (ERROR ...) or message (FATAL_ERROR ...) when
execute_process producer error and tout custom command should faim.
Le 26 févr. 2018 20:19, "Michael Jackson" a
écrit :
> In our
In our CMake based project I generate a *.cmake file which I call with the
following bit of code:
add_custom_target(DREAM3D_MKDOCS_GENERATION ALL
COMMAND "${CMAKE_COMMAND}" -P "${docsCmakeFile}"
COMMENT "using mkdocs to generate the documentation"
)
Inside the generated file is t