Bug#695370: dpkg-cross: sets PKG_CONFIG_LIBDIR rather than telling cmake about a cross pkg-config executable
Package: dpkg-cross
Version: 2.6.7
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch raring
I noticed that /etc/dpkg-cross/cmake/CMakeCross.txt sets
PKG_CONFIG_LIBDIR. Once the wrapper script from #631275 lands (or for
anyone who's using that already), it's better to use the wrapper: this
also has the effect of using the appropriate multiarch pkg-config paths.
The following patch should make this work without breaking previous
behaviour.
Index: config/cmake/CMakeCross.txt
===================================================================
--- config/cmake/CMakeCross.txt (revision 8410)
+++ config/cmake/CMakeCross.txt (working copy)
@@ -24,7 +24,15 @@
MESSAGE("CROSS COMPILING for ${CMAKE_C_COMPILER}")
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_FIND_ROOT_PATH}/include)
#Make pkg-config look in the right place
- SET(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig/)
+ FIND_PROGRAM(DPKG_CROSS_PKG_CONFIG $ENV{DEB_HOST_GNU_TYPE}-pkg-config)
+ IF (DPKG_CROSS_PKG_CONFIG)
+ # for UsePkgConfig
+ SET(PKGCONFIG_EXECUTABLE ${DPKG_CROSS_PKG_CONFIG})
+ # for FindPkgConfig
+ SET(PKG_CONFIG_EXECUTABLE ${DPKG_CROSS_PKG_CONFIG})
+ ELSE ()
+ SET(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig/)
+ ENDIF ()
ELSE (CMAKE_CROSSCOMPILING)
MESSAGE("Native Compile")
ENDIF (CMAKE_CROSSCOMPILING)
Thanks,
--
Colin Watson [cjwatson@ubuntu.com]
Reply to: