[cmake-developers] ExternalProject and git clone

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Thu Sep 19 04:41:40 EDT 2013


On 18/09/13 18:38, Brad King wrote:
> On 09/18/2013 12:07 PM, Daniele E. Domenichelli wrote:
>> How much is "sufficiently high"? According to "cmake --help-policy CMP0012":
>>
>>   This policy was introduced in CMake version 2.8.0.  CMake version
>>   2.8.11.20130918-g9bcf warns when the policy is not set and uses
>>   OLD behavior. Use the cmake_policy command to set it to OLD or NEW
>>   explicitly.
> 
> "Sufficiently high" is always the version of introduction, which
> is 2.8.0 in this case.  See the cmake_minimum_required and
> cmake_policy commands for an explanation of how the minimum req
> version sets policies.


I did set cmake_minimum_required, but I still had the warning, but I
found the problem now...
ExternalProject generates some cmake files, that are called during make
with "cmake -P". These files do not contain a cmake_minimum_required
call, therefore cmake complains that the policy is not set.

I added a line:

  cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})

where the scripts are generated, so that the it is set to the same
version used by the main project, and now the warning disappeared...

Do you think this is ok? Should I set it to a fixed version instead?


Cheers,
 Daniele



More information about the cmake-developers mailing list