GeneratePkgConfig: fix CMake 3.0 compatibility.

GitOrigin-RevId: 20aad92a716731d09d55c946bf5655e9f388a6d1
This commit is contained in:
levlam 2020-10-12 22:31:02 +03:00
parent 647250bcb4
commit 885a9d8e9c

View File

@ -31,16 +31,17 @@ function(generate_pkgconfig TARGET DESCRIPTION)
if(HAS_REQS)
set(REQUIRES "\nRequires.private:")
foreach (REQ ${REQS})
string(APPEND REQUIRES " ${REQ}")
set(REQUIRES "${REQUIRES} ${REQ}")
endforeach()
endif()
if(HAS_LIBS)
set(LIBRARIES "\nLibs.private:")
foreach (LIB ${LIBS})
string(APPEND LIBRARIES " ${LIB}")
set(LIBRARIES "${LIBRARIES} ${LIB}")
endforeach()
endif()
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig")
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/${TARGET}.pc" CONTENT
"prefix=${PREFIX}
includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}