[cmake-developers] Modules/GetPrequisites.cmake issues

Brad King brad.king at kitware.com
Wed Jul 29 09:37:14 EDT 2015


On 07/28/2015 06:02 PM, Bill Somerville wrote:
> attached is a patch that addresses some issues recently discussed on the 
> users list.

Thanks for working on this!

> As there doesn't seem to be  a reliable way of detecting MinGW callers
> of fixup_bundle() may have to set the variable gp_tool to "objdump" if
> dumpbin.exe  is  installed on  the  build  machine  to stop  it  using
> dumpbin.exe for library dependency walking.

Is there a reason not to look for objdump before dumpbin?

> This  patch  also   adds  command  status  checking   to  the  various
> execute_process() invocations  in GetPrerequisites.cmake so  that they
> don't fail silently producing invalid install packages.

If you're comfortable enough with Git, please split this part out into
a preceding patch with its own explanation in its commit message.  That
will clarify which hunks in the patch belong to which change.

> +  if(gp_cmd_filter)             # filter is for performance
> +    execute_process(
> +      COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
> +      COMMAND ${gp_grep_cmd} ${gp_cmd_filter}
> +      RESULT_VARIABLE gp_rv
> +      OUTPUT_VARIABLE gp_cmd_ov
> +      ERROR_VARIABLE gp_ev
> +      )
> +  else()
> +    execute_process(
> +      COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
> +      RESULT_VARIABLE gp_rv
> +      OUTPUT_VARIABLE gp_cmd_ov
> +      ERROR_VARIABLE gp_ev
> +      )
> +  endif()

This can be simplified as:

    execute_process(
      COMMAND ${gp_cmd} ${gp_cmd_args} ${target}
      ${gp_cmd_maybe_filter}
      RESULT_VARIABLE gp_rv
      OUTPUT_VARIABLE gp_cmd_ov
      ERROR_VARIABLE gp_ev
      )

where ``gp_cmd_maybe_filter`` is initialized to empty and later
possibly set as:

  if(gp_grep_cmd)
    set(gp_cmd_maybe_filter
      COMMAND ${gp_grep_cmd} "^[[:blank:]]*DLL Name: "
      )
  endif()

Thanks,
-Brad



More information about the cmake-developers mailing list