Merge lp:~millihenrik/hashit/pkgconfig-dir-option into lp:hashit

Proposed by Henrik Holst
Status: Merged
Approved by: David Gómez
Approved revision: 31
Merged at revision: 31
Proposed branch: lp:~millihenrik/hashit/pkgconfig-dir-option
Merge into: lp:hashit
Diff against target: 45 lines (+8/-3)
2 files modified
CMakeLists.txt (+4/-2)
INSTALL (+4/-1)
To merge this branch: bzr merge lp:~millihenrik/hashit/pkgconfig-dir-option
Reviewer Review Type Date Requested Status
David Gómez Approve
Review via email: mp+325106@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Henrik Holst (millihenrik) wrote :

Forgot to mention that I also removed the ADD_DEPENDENCIES line from CmakeLists.txt since it's #1 not needed by cmake and #2 makes cmake give lots of warnings.

Revision history for this message
David Gómez (dabisu) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2010-03-12 13:19:03 +0000
3+++ CMakeLists.txt 2017-06-05 20:23:59 +0000
4@@ -12,10 +12,12 @@
5 MESSAGE (FATAL_ERROR "pkg-config not found...")
6 ENDIF (NOT PKG_CONFIG_FOUND)
7
8+set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig"
9+ CACHE PATH "Installation directory for pkgconfig (.pc) files")
10+
11 ADD_DEFINITIONS (-DDATADIR=\\\"${CMAKE_INSTALL_PREFIX}/share\\\")
12
13 ADD_LIBRARY (hashit SHARED src/hashit.c src/hfunctions.c)
14-ADD_DEPENDENCIES (hashit src/hashit.c src/hfunctions.c src/hashit.h src/hfunctions.h)
15
16 FILE(WRITE libhashit.pc "prefix=${CMAKE_INSTALL_PREFIX}\n")
17 FILE(APPEND libhashit.pc "libdir=${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}\n")
18@@ -28,7 +30,7 @@
19
20 INSTALL (TARGETS hashit LIBRARY DESTINATION lib${LIB_SUFFIX})
21 INSTALL (FILES src/hashit.h DESTINATION include)
22-INSTALL (FILES libhashit.pc DESTINATION lib${LIB_SUFFIX}/pkg-config)
23+INSTALL (FILES libhashit.pc DESTINATION ${INSTALL_PKGCONFIG_DIR})
24
25 SET_TARGET_PROPERTIES (hashit PROPERTIES VERSION 1.0 SOVERSION 1)
26 SET (LIBRARY_OUTPUT_PATH src)
27
28=== modified file 'INSTALL'
29--- INSTALL 2008-12-18 18:56:03 +0000
30+++ INSTALL 2017-06-05 20:23:59 +0000
31@@ -13,11 +13,14 @@
32
33 $ cmake -DCMAKE_INSTALL_PREFIX=/usr .
34
35- Use CMAKE_BUILD_TYPE=Debug or CMAKE_BUILD_TYPE=Release if you
36+ Use -DCMAKE_BUILD_TYPE=Debug or -DCMAKE_BUILD_TYPE=Release if you
37 wish to select the build type. Default is Release.
38
39 By default hashit is installed /usr/local.
40
41+ Use -DINSTALL_PKGCONFIG_DIR=<path> to install the pkgconfig file to
42+ '<path>/libhashit.pc' instead of the default.
43+
44 hashit includes a pkg-config file, therefore you only need to use the
45 pkg-config utility in the usual way to link your binary to hashit.
46

Subscribers

People subscribed via source and target branches

to all changes: