Skip to content

Commit

Permalink
GeneratePkgConfig: use CMAKE_INSTALL_* variables.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 1054a674f8bdf54d1d45dfe6e439811116f344c4
  • Loading branch information
levlam committed Oct 12, 2020
1 parent 162b87e commit 9390cd2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMake/GeneratePkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ function(generate_pkgconfig TARGET DESCRIPTION)

file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/${TARGET}.pc" CONTENT
"prefix=${PREFIX}
includedir=\${prefix}/include
libdir=\${prefix}/lib
includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}
libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}
Name: ${TARGET}
Description: ${DESCRIPTION}
Version: ${PROJECT_VERSION}
CFlags: -I\${includedir}
Libs: -L\${libdir} -l${TARGET}${REQUIRES}${LIBRARIES}")
Libs: -L\${libdir} -l${TARGET}${REQUIRES}${LIBRARIES}
")

install(FILES "pkgconfig/${TARGET}.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
install(FILES "pkgconfig/${TARGET}.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endfunction()

0 comments on commit 9390cd2

Please sign in to comment.