Cannot set CMP0022 to OLD

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot set CMP0022 to OLD

Andreas Pakulat-2
Hi,

I've been quite annoyed by the warnings from CMP0022 in a project I use (http://quickgit.kde.org/?p=kdevplatform.git) and wanted to set the policy to OLD to hide the warnings (porting the code is not an option as that would require to enforce CMake 2.8.11 which is too new for this project).

Unfortunately no matter where I put either a cmake_policy(VERSION 2.8.6) or even cmake_policy(SET CMP0022 OLD) I still get the warnings all the time.

I'm using CMake 2.8.12.1 here and was wondering wether anybody else run into this already? I've tried to come up with a small example, but can't seem to get it to trigger the CMP warning at all.

Andreas

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set CMP0022 to OLD

Stephen Kelly-2
Andreas Pakulat wrote:
> I'm using CMake 2.8.12.1 here and was wondering wether anybody else run
> into this already? I've tried to come up with a small example, but can't
> seem to get it to trigger the CMP warning at all.

An example shows that it works for me too.

What prevents you from reducing the kdevplatform build to an example by
iterative removal of code?

Thanks,

Steve.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set CMP0022 to OLD

Andreas Pakulat-2
Hi,

On Fri, Dec 13, 2013 at 11:55 AM, Stephen Kelly <[hidden email]> wrote:
Andreas Pakulat wrote:
> I'm using CMake 2.8.12.1 here and was wondering wether anybody else run
> into this already? I've tried to come up with a small example, but can't
> seem to get it to trigger the CMP warning at all.

An example shows that it works for me too.

What prevents you from reducing the kdevplatform build to an example by
iterative removal of code?

Mostly just lack of time and willingness yesterday evening and the hope someone had stumbled across this already.

Anyway, I've now stripped it down as much as I can (without diving into the wilderness of FindKDE4Internal) and also added the observations I've made while stripping it. So its definetly somewhat related to the magics that the KDE4 module does.

Andreas 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

cmp0022_example.zip (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set CMP0022 to OLD

Stephen Kelly-2
Andreas Pakulat wrote:

> Anyway, I've now stripped it down as much as I can (without diving into
> the wilderness of FindKDE4Internal) and also added the observations I've
> made while stripping it. So its definetly somewhat related to the magics
> that the KDE4 module does.

It's related to the scope of the policy and the context of the macro, which
is a bit counterintuitive.

Your options are:

1)
Set the policy in KDE4Internal.cmake, like the rest of the policies.

2)
Apply a patch equivalent to:

 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index b93f190..134181c 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 2.8)
  project(KDevPlatform)
  cmake_policy(SET CMP0022 OLD)
  find_package(KDE4 4.7.0 REQUIRED)
 +include(KDE4Macros NO_POLICY_SCOPE)


Thanks,

Steve.



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set CMP0022 to OLD

Stephen Kelly-2
Stephen Kelly wrote:

> Your options are:

Option 3 is to depend on CMake 2.8.9+ and port away from the use of
target_link_libraries with LINK_INTEFACE_LIBRARIES and use LINK_PUBLIC and
LINK_PRIVATE instead:

 @@ -17,10 +18,9 @@ cmake_policy(SET CMP0022 OLD)
  kde4_add_library(sublime SHARED ${sublime_LIB_SRCS})
  cmake_policy(SET CMP0022 OLD)
  target_link_libraries(sublime
 +  LINK_PRIVATE
          ${KDE4_KDEUI_LIBS}
 -        ${KDE4_KPARTS_LIBS})
 -cmake_policy(SET CMP0022 OLD)
 -target_link_libraries(sublime LINK_INTERFACE_LIBRARIES
 +  LINK_PUBLIC
          ${KDE4_KPARTS_LIBS})


Thanks,

Steve.


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set CMP0022 to OLD

Andreas Pakulat-2
In reply to this post by Stephen Kelly-2
Hi,

On Sat, Dec 14, 2013 at 2:58 PM, Stephen Kelly <[hidden email]> wrote:
Andreas Pakulat wrote:

> Anyway, I've now stripped it down as much as I can (without diving into
> the wilderness of FindKDE4Internal) and also added the observations I've
> made while stripping it. So its definetly somewhat related to the magics
> that the KDE4 module does.

It's related to the scope of the policy and the context of the macro, which
is a bit counterintuitive.

Your options are:

1)
Set the policy in KDE4Internal.cmake, like the rest of the policies.

2)
Apply a patch equivalent to:

 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index b93f190..134181c 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -5,6 +5,7 @@ cmake_minimum_required(VERSION 2.8)
  project(KDevPlatform)
  cmake_policy(SET CMP0022 OLD)
  find_package(KDE4 4.7.0 REQUIRED)
 +include(KDE4Macros NO_POLICY_SCOPE)

Thanks for taking the time to analyze this and enlighten me about the options. I'll see what the KDevelop team prefers.

Andreas

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake