Repository: ledger/ledger (language: cpp)

Issue:
CMake warning about deprecated policy related to RPATH
CMake 3.11.2 warns:

    CMake Deprecation Warning at CMakeLists.txt:4 (cmake_policy):
      The OLD behavior for policy CMP0042 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.

The triggering code was added in commit ac5fd3afd3826a9b0fadcb270900cf42c5ee6e39 with the intention:

    Set CMake policy CMP0042
    
    to remove the warning below when running cmake.
    In the long run changing the CMake rules to set MACOSX_RPATH
    might be the better option.
    
      CMake Warning (dev):
        Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
        --help-policy CMP0042" for policy details.  Use the cmake_policy
        command to set the policy and suppress this warning.
        MACOSX_RPATH is not specified for the following targets:
    
         libledger
    
      This warning is for project developers.  Use -Wno-dev to suppress it.

[Policy CMP0042](https://cmake.org/cmake/help/latest/policy/CMP0042.html) is (AFAIUI) irrelevant to Linux where CMake 3.11.2 seems to do Almost The Right Thing™ by default (set `RPATH` for `ledger` to source directory when building and testing and to (for example) `/usr/lib64` when installing; some/most distributions will want to clear that field when installing by setting `CMAKE_SKIP_INSTALL_RPATH`).  So my instinct would be to remove the four lines from `CMakeLists.txt` and the one line from `src/CMakeLists.txt` that relate to `RPATH`.

But I do not know how this plays out under macOS.  I assume the default there is reasonable as well, but I have no way of testing this.


Discussion / hints:
@afh @xnox @scfc any comments on this?
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
@scfc ... ?
@xnox any help?
@q3aiml any chance you could look at this issue?
@scfc @q3aiml can someone submit a patch for this?  It sounds like this needs to be fixed.
The lines from ac5fd3afd3826a9b0fadcb270900cf42c5ee6e39 were already dropped in 6d4cd58cd4b1b2f3906889009da7b71931645e93 so I think this is already resolved anyway?
It looks like @xnox has taken care of this issue in #1839 already.  @tbm I think you can close this issue.

Just to make sure, I was not able to reproduce the warning in the OP anymore, either.

Fix patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f7e4ca5c..63e5efa1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.5)
+cmake_minimum_required(VERSION 3.0)
 
 PROJECT(ledger)
 


Test patch: