1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
From: Christian Kastner <ckk@debian.org>
Date: Fri, 25 Sep 2015 10:39:42 +0200
Subject: cmake: Configurable pkgconfig install destination
Don't hard-code the destination; allow it to be overridden, just as for the
other targets.
Forwarded: not-needed
Last-Update: 2015-09-25
---
CMakeLists.txt | 4 +---
cmake/Modules/DefineInstallationPaths.cmake | 6 ++++++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b91f6fb..68bf7c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,11 +16,9 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/src/include/)
configure_file( ${CMAKE_SOURCE_DIR}/cmake/fann.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/fann.pc @ONLY )
-SET(PKGCONFIG_INSTALL_DIR /lib/pkgconfig)
-
########### install files ###############
-INSTALL_FILES( ${PKGCONFIG_INSTALL_DIR} FILES fann.pc )
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/fann.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} )
ADD_SUBDIRECTORY( src )
diff --git a/cmake/Modules/DefineInstallationPaths.cmake b/cmake/Modules/DefineInstallationPaths.cmake
index 644cf1b..2c8e0a4 100644
--- a/cmake/Modules/DefineInstallationPaths.cmake
+++ b/cmake/Modules/DefineInstallationPaths.cmake
@@ -45,6 +45,12 @@ if (UNIX)
FORCE
)
+ SET(PKGCONFIG_INSTALL_DIR
+ "${LIB_INSTALL_DIR}/pkgconfig"
+ CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/lib)"
+ FORCE
+ )
+
SET(LIBEXEC_INSTALL_DIR
"${EXEC_INSTALL_PREFIX}/libexec"
CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is prefix/libexec)"
|