commit 962b49caff4fe4db3919c083242e13f662ead6bc
parent 5cba909863e516e0e0df53ba379da26b67cc24c6
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 29 Aug 2016 16:46:42 +0200
Look for the Clipper pkgconfig wrt CMAKE_PREFIX_PATH
Diffstat:
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
@@ -8,11 +8,13 @@ respectively.
The library uses [CMake](http://www.cmake.org) and the
[RCMake](https://gitlab.com/vaplv/rcmake/#tab-readme) package to build. It also
-depends on the [RSys](https://gitlab.com/vaplv/rsys/#tab-readme), and the
-[Polygon](https://gitlab.Com/vaplv/polygon/#tab-readme) libraries.
+depends on the
+[Clipper](http://www.angusj.com/delphi/clipper.php),
+[Polygon](https://gitlab.Com/vaplv/polygon/#tab-readme) and
+[RSys](https://gitlab.com/vaplv/rsys/#tab-readme) libraries.
First ensure that CMake is installed on your system. Then install the RCMake
-package as well as all the RSys and Polygon prerequisites. Then generate the
+package as well as all the aforementioned prerequisites. Then generate the
project from the `cmake/CMakeLists.txt` file by appending to the
`CMAKE_PREFIX_PATH` variable the install directories of its dependencies.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.1)
project(cpr C CXX)
enable_testing()
@@ -22,6 +22,20 @@ option(NO_TEST "Do not compile the test pograms" OFF)
set(CPR_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src)
################################################################################
+# Setup the PkgConfig cmake module
+################################################################################
+set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
+
+# The PkgConfig CMake module does not support relative prefix paths. Ensure
+# that the provided prefix paths are absolute
+set(_cmake_prefix_path)
+foreach(_prefix ${CMAKE_PREFIX_PATH})
+ get_filename_component(_prefix ${_prefix} ABSOLUTE)
+ list(APPEND _cmake_prefix_path ${_prefix})
+endforeach()
+set(CMAKE_PREFIX_PATH ${_cmake_prefix_path})
+
+################################################################################
# Dependencies
################################################################################
find_package(RCMake REQUIRED)