[cmake-developers] speed up package with mingw on Windows host

Brad King brad.king at kitware.com
Mon Jun 20 10:48:48 EDT 2016


On 06/18/2016 12:10 PM, laurent wrote:
> I would like to share my experience about speed up package with BundleUtilities
> on Windows host using mingw32 env.

Thanks.  Please provide a

  Full Name <email at address>

format name for the commit authorship record.

> -    find_program(gp_grep_cmd grep)
> +    if(WIN32)
> +      find_program(gp_grep_cmd findstr)
> +    else()
> +      find_program(gp_grep_cmd grep)
> +    endif()

Good.  Is `findstr` command-line compatible with `grep` for the use case
in question?

> +    GET_PROPERTY(MyLocalVariable GLOBAL PROPERTY MY_PREREQUISE)
> +    list(APPEND analysed ${MyLocalVariable} ${target})
> +    list(REMOVE_DUPLICATES analysed) 
> +    SET_PROPERTY(GLOBAL PROPERTY MY_PREREQUISE ${analysed})

Rather than maintaining and searching a list in CMake code, please try
recording each target in a dedicated variable or property name, e.g.
`GET_PREREQUISITES_ANALYZED_${target}`.

Thanks,
-Brad



More information about the cmake-developers mailing list