From 90c9ad165392b4082fd9d3950225c512914380c2 Mon Sep 17 00:00:00 2001
From: Bienchen <stefanbienert@me.com>
Date: Mon, 17 Feb 2020 10:56:20 +0100
Subject: [PATCH] SCHWED-4649: Enforce new policy to get rid of -L in CMake
 calls

---
 CMakeLists.txt          | 14 ++++++++++++--
 modules/doc/install.rst | 12 +++++++-----
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3908e11f6..f49d1ba83 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,15 @@
 # Author: Marco Biasini
 #-------------------------------------------------------------------------------
 
-cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.12.1 FATAL_ERROR)
+
+# Set CMake policies
+# Behaviour of target_link_libraries, always link by full path. CMP0060 can
+# disable this to stay compatible with old projects. We want the new behaviour
+# since before we needed to provide the full path ourselves, that is: we
+# manually forced CMake to the new scheme.
+cmake_policy(SET CMP0060 NEW)
+
 project(OpenStructure CXX C)
 set (CMAKE_EXPORT_COMPILE_COMMANDS 1)
 set (OST_VERSION_MAJOR 1)
@@ -262,7 +270,7 @@ if (ENABLE_GUI)
   find_package(Qt5Widgets REQUIRED)
   find_package(Qt5OpenGL REQUIRED)
   set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::Widgets Qt5::Core)
-  ost_find_python_module(sip)
+  ost_find_python_module(PyQt5.sip)
   ost_find_python_module(PyQt5)
 endif()
 
@@ -362,3 +370,5 @@ message(STATUS
         "   Debian/Ubuntu directory layout (-DUBUNTU_LAYOUT) : ${_UBUNTU_LAYOUT}"
         ${HIDDEN_VIS_MSG})
 
+
+# LocalWords:  CMake CMP
diff --git a/modules/doc/install.rst b/modules/doc/install.rst
index 7d342fd6f..9d59fbed5 100644
--- a/modules/doc/install.rst
+++ b/modules/doc/install.rst
@@ -28,7 +28,7 @@ a bunch of open-source libraries. If you haven't already installed them, please
 install them now! Where appropriate, the minimally required version is given in 
 parentheses.
 
-* `CMake <http://cmake.org>`_ (2.6.4)
+* `CMake <http://cmake.org>`_ (3.12.1)
 * `Python3 <http://python.org>`_ (3.6)
 * `Boost <http://boost.org>`_ (1.65)
 * `zlib <https://zlib.net/>`_ (usually comes with Boost or system)
@@ -317,11 +317,13 @@ version of OpenStructure.
           -DOPTIMIZE=ON
 
 
-**macOS (Mojave/ High Sierra) with Homebrew**
+**macOS (Catalina) with Homebrew**
 
 `Homebrew <https://brew.sh/>`_ can be used to conveniently install all
-dependencies. The current Boost version, as of writing these instructions, is
-1.70.0 but works so far. Do not forget to also install `boost-python`.
+dependencies. The current Python version, as of writing these instructions, is
+3.7.6 but works so far. Boost comes as 1.72.0 which seems to be OK. Do not
+forget to also install `boost-python3`. Eigen and SQLite also seem to be
+unproblematic concerning higher version numbers.
 
 If you want to build the info module or the graphical user interface, make sure
 you have the Xcode app installed. Just the Xcode command line tools which are
@@ -398,4 +400,4 @@ in your terminal. This will fetch the newest changes.
 ..  LocalWords:  Homebrew cmake CMake zlib SQLite FFTW libtiff libpng PyQt
 ..  LocalWords:  SSL macOS Makefiles PDB qmake PNG libz libsqlite OPTIMIZE
 ..  LocalWords:  DNDEBUG RPATH rpath SHADER shader SPNAV DConnexion profiler
-..  LocalWords:  DOPTIMIZE DENABLE DOPEN DPYTHON DBOOST DSYS Xcode
+..  LocalWords:  DOPTIMIZE DENABLE DOPEN DPYTHON DBOOST DSYS Xcode Eigen
-- 
GitLab