CMake: Produce correct plugindir for pkg-config
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Jan 2016 09:24:15 +0000 (10:24 +0100)
committerJoão Valverde <j@v6e.pt>
Sat, 23 Jan 2016 15:55:08 +0000 (15:55 +0000)
commit8454f2a20e250cef2c14601cf0cfc936025499db
tree15dc0348ef8d8e9752ea144aa6b18bdea49ec142
parent48267465c835f3c64b1632279d313f254892f6fd
CMake: Produce correct plugindir for pkg-config

So far the plugindir variable in the pkg-config file is set like
this:

  set( plugindir "\${libdir}/${PLUGIN_INSTALL_DIR}" )

where libdir is set to:

  set( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}" )

However, PLUGIN_INSTALL_DIR already contains
CMAKE_INSTALL_LIBDIR:

  set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/\
  ${CPACK_PACKAGE_NAME}/plugins/${CPACK_PACKAGE_VERSION}")

Therefore, if the pkg-config file is generated by cmake, the
resulting plugindir points to:

   plugindir=${libdir}/lib/wireshark/plugins/2.1.0
   libdir=${exec_prefix}/lib

This is obviously wrong as after variable substitution the
resulting path is /usr/lib/lib/wireshark/plugins/...

Change-Id: I448991284d8948434311b1c0828828fd93d0baf8
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-on: https://code.wireshark.org/review/13258
Tested-by: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
CMakeLists.txt