--- plplot-5.13.0/CMakeLists.txt.orig 2017-08-26 10:43:25.000000000 +0800 +++ plplot-5.13.0/CMakeLists.txt 2018-07-27 15:36:03.549980000 +0800 @@ -126,6 +126,29 @@ # Use configured variables to process configurable top-level files. +# Installation paths +# +SET(BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to.") +SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.") +SET(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.") + +# Set a couple variables to be substituted inside the .pc file. +# We can't just use LIB_INSTALL_DIR in the .pc file, as passing them as absolue +# or relative paths is both valid and supported by cmake. +SET (PKGCONFIG_PREFIX ${CMAKE_INSTALL_PREFIX}) + +IF(IS_ABSOLUTE ${LIB_INSTALL_DIR}) + SET (PKGCONFIG_LIBDIR ${LIB_INSTALL_DIR}) +ELSE(IS_ABSOLUTE ${LIB_INSTALL_DIR}) + SET (PKGCONFIG_LIBDIR "\${prefix}/${LIB_INSTALL_DIR}") +ENDIF (IS_ABSOLUTE ${LIB_INSTALL_DIR}) + +IF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR}) + SET (PKGCONFIG_INCLUDEDIR ${INCLUDE_INSTALL_DIR}) +ELSE(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR}) + SET (PKGCONFIG_INCLUDEDIR "\${prefix}/${INCLUDE_INSTALL_DIR}") +ENDIF(IS_ABSOLUTE ${INCLUDE_INSTALL_DIR}) + # This CMake-configured template file is processed further by sed for # abi-compliance-checker. configure_file( --- a/cmake/modules/qt.cmake +++ b/cmake/modules/qt.cmake @@ -229,7 +229,7 @@ # from Nils Gladitz that that policy only # excludes using _build_ target LOCATION properties and not # _imported_ target LOCATION properties like this one): - get_target_property(Qt5_library_fullpath ${Qt5_library_fullpath} LOCATION) + get_target_property(Qt5_library_fullpath ${Qt5_library_fullpath} IMPORTED_IMPLIB_RELEASE) if(Qt5_library_fullpath) list(APPEND pc_qt_LIBRARIES_LIST ${Qt5_library_fullpath}) endif(Qt5_library_fullpath) --- plplot-5.13.0/pkgcfg/plplot-template.pc.in.orig 2017-08-26 10:43:25.000000000 +0800 +++ plplot-5.13.0/pkgcfg/plplot-template.pc.in 2018-07-27 15:43:39.324758100 +0800 @@ -1,6 +1,7 @@ -libdir=@LIB_DIR@ -includedir=@INCLUDE_DIR@ -drvdir=@LIB_DIR@/plplot@PLPLOT_VERSION@/drivers +prefix="@PKGCONFIG_PREFIX@" +libdir=@PKGCONFIG_LIBDIR@ +includedir=@PKGCONFIG_INCLUDEDIR@/plplot +drvdir=@PKGCONFIG_LIBDIR@/plplot@PLPLOT_VERSION@/drivers Name: PLplot @PC_SHORT_NAME@ Description: Scientific plotting library (@PC_PRECISION@@PC_LONG_NAME@) --- a/bindings/fortran/CMakeLists.txt +++ b/bindings/fortran/CMakeLists.txt @@ -187,5 +187,5 @@ ) # Configure pkg-config *.pc file corresponding to libplplotfortran - pkg_config_file("fortran" "Fortran" " Fortran binding" "plplotfortran" "-I\"${FORTRAN_MOD_DIR}\"" "-lplplot" "") + pkg_config_file("fortran" "Fortran" " Fortran binding" "plplotfortran" "-I\"\${prefix}/${FORTRAN_MOD_DIR}\"" "-lplplot" "") endif(ENABLE_fortran)