[PATCH] [CMake] Update required version to 2.8.12 to improve build time with target_link_libraries(INTERFACE)

Brad King brad.king at kitware.com
Tue Feb 25 06:05:22 PST 2014


On 02/25/2014 08:59 AM, NAKAMURA Takumi wrote:
> Brad, thanks. It could be applied more easily.
> I have a question:
> 
> - I am afraid the keyword INTERFACE &c. might require (CMP0022 NEW).
>   Should I put cmake_policy() conditionally?
>   cmake_policy(SET CMP0022 NEW) or (VERSION 2.8.12)

Use code like this:

 if(POLICY CMP0022)
   cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
 endif()

just after any cmake_minimum_required command.

Note however that this will also bump the required version of CMake
used to build applications to 2.8.12 when LLVM was built with 2.8.12
or higher.  This is necessary because the CMake running on the apps
will need to understand the INTERFACE library dependencies.

-Brad




More information about the cfe-commits mailing list