From b6650623a9dae52e65110d42ed734c0e8d8a36a9 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 30 Jan 2024 15:08:12 +0100 Subject: [PATCH] Update CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Miloš Komarčević <4973094+kmilos@users.noreply.github.com> --- CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c36ccf61d3..4696f5bf39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -984,9 +984,17 @@ endif() # Create pkgconfig files. # We use the same files like ./configure, so we have to set its vars. set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) -set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +set(exec_prefix "\${prefix}") +if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") + set(libdir "${CMAKE_INSTALL_LIBDIR}") +else() + set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") +endif() +if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}") + set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") +else() + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") +endif() set(LIBS "-lz -lm") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc