Fwd: Re: [cmake-developers] [PATCH] cmCMakePolicyCommand: New PARENT_SCOPE argument

David Faure faure at kde.org
Sat Aug 15 07:56:08 UTC 2015


On Wednesday 05 August 2015 09:11:59 Brad King wrote:
> On 08/04/2015 08:42 AM, Brad King wrote:
> > The compatibility model for policies is that the authors of a
> > project should be aware of changes to CMake's preferred behavior
> > before their project is affected by it.  They indicate so by
> > updating their own source to set the policy to NEW.  If your
> > dependents want to defer this decision to you and accept the
> > risk of the broken compatibility model then they can include
> > you with NO_POLICY_SCOPE.  That is our model.
> 
> That said, you may still be able to hack this without updating
> your dependents by setting CMAKE_POLICY_DEFAULT_CMP0063 to NEW:
> 
>  http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html
> 
> The variable is meant for end users to set in their local cache
> to quiet policy warnings without modifying the project.  The
> variable documents that it should not be set by project code,
> but you could abuse it for your use case.  Setting it won't
> override policy settings made by your dependents but can set
> the default when they don't set the policy at all.  This still
> breaks our compatibility model, but it is an option you have.

Thanks for the suggestion, however I can't make it work. Am I doing it wrong?

 
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -198,6 +198,7 @@ endif()
 # Default to hidden visibility for symbols
 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
 set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+set(CMAKE_POLICY_DEFAULT_CMP0063 NEW PARENT_SCOPE) # don't let cmake >= 3.3 warn about the above
 
 if (UNIX AND NOT APPLE)
     # Enable adding DT_RUNPATH, which means that LD_LIBRARY_PATH takes precedence


I still get warnings like this for each and every target:

CMake Warning (dev) at autotests/CMakeLists.txt:4 (add_executable):
  Policy CMP0063 is not set: Honor visibility properties for all target
  types.  Run "cmake --help-policy CMP0063" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "krossqtstest" of type "EXECUTABLE" has the following visibility
  properties set for CXX:

    CXX_VISIBILITY_PRESET
    VISIBILITY_INLINES_HIDDEN

  For compatibility CMake is not honoring them for this target.
This warning is for project developers.  Use -Wno-dev to suppress it.



-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-buildsystem mailing list