From 69d9c26e6ed7389cac3273b3eea1134b33912942 Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Tue, 29 Mar 2016 12:41:13 -0700 Subject: [PATCH] pkg_config: Update mraa.pc.cmake to use new install dir LIB_SUFFIX is no longer used. Replaced with LIB_INSTALL_DIR which provides the correct lib dir with arch suffix. Moved the call to include(GNUInstallDirs) prior to checking the CMAKE_INSTALL_LIBDIR - which is set by include(GNUInstallDirs). Tested with cmake 2.8 and cmake 3.5. Signed-off-by: Noel Eck Signed-off-by: Brendan Le Foll --- CMakeLists.txt | 6 ++++-- src/mraa.pc.cmake | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2280a0fb..bfd40000e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,14 +5,16 @@ FIND_PACKAGE (Threads REQUIRED) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fno-omit-frame-pointer ") set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall ") + +# Set CMAKE_INSTALL_LIBDIR if not defined +include(GNUInstallDirs) + # Older cmake might not pick CMAKE_INSTALL_LIBDIR right if (CMAKE_INSTALL_LIBDIR) set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries") else () set (LIB_INSTALL_DIR "lib" CACHE PATH "Installation path for libraries") endif () -# Set CMAKE_LIB_INSTALL_DIR if not defined -include(GNUInstallDirs) # By default, build shared object libraries on linux if (UNIX AND NOT APPLE) diff --git a/src/mraa.pc.cmake b/src/mraa.pc.cmake index fb5c0b10d..33de3af17 100644 --- a/src/mraa.pc.cmake +++ b/src/mraa.pc.cmake @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${exec_prefix}/lib@LIB_SUFFIX@ +libdir=${exec_prefix}/@LIB_INSTALL_DIR@ includedir=${prefix}/include Name: mraa