[cmake-developers] Should try_run have a timeout value?

Brad King brad.king at kitware.com
Thu Jun 12 09:15:41 EDT 2014


On 06/12/2014 08:59 AM, David Cole wrote:
> #   Should try_run have a timeout value, defaulting to a few seconds (or
> #   something more reasonable than NEVER) or is there a way for CMake to
> #   detect this condition and kill it as an unsuccessful try_run...?
> #
> cmake_minimum_required(VERSION 3.0)
> project(subtle_pointer_error C)

Nice literate programming!

> # OMG - long bracket argument syntax is beautiful for including
> # unescaped entire other http://sscce.org/ files within a
> # CMakeLists.txt!!

Thanks.  That's one reason I added them.  You could also use bracket
comments for your prose instead of prefixing every line with '#'.

>   a failed try_run due to excessive attempted run time would

Yes.  I think we could have an argument to try_run for this.  When
it is not present we can check a variable to see if the local user
set a default, e.g. CMAKE_TRY_RUN_TIMEOUT.  Of course the timeout
would apply to running the binary after compilation, not to the
build step.

-Brad




More information about the cmake-developers mailing list