From 7fe58b1412cb877a6ea03ab6c3437ad937b78a39 Mon Sep 17 00:00:00 2001 From: Inho Oh Date: Wed, 10 Jul 2024 13:20:43 +0900 Subject: [PATCH] build: fix aln.pc.in variables Signed-off-by: Inho Oh --- CMakeLists.txt | 6 ++++++ aln.pc.in | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index adf0791..f465f22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,12 @@ include_directories(include) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aln/) # pkg-config file +if(NOT DEFINED CMAKE_LIBRARY_ARCHITECTURE) + set(libdir "\${prefix}/lib") +else() + set(libdir "\${prefix}/lib/${CMAKE_LIBRARY_ARCHITECTURE}") +endif() +set(includedir "\${prefix}/include/aln") configure_file(aln.pc.in ${PROJECT_BINARY_DIR}/aln.pc @ONLY) install(FILES ${PROJECT_BINARY_DIR}/aln.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/) diff --git a/aln.pc.in b/aln.pc.in index bc8220c..8fb4b56 100644 --- a/aln.pc.in +++ b/aln.pc.in @@ -1,10 +1,10 @@ -libdir=@CMAKE_INSTALL_FULL_LIBDIR@ -includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/aln -version=@VERSION@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@libdir@ +includedir=@includedir@ Name: aln Description: Library for Amazing Lucky Number generation -Version: ${version} +Version: @VERSION@ Requires: glib-2.0 Libs: -L${libdir} -laln Cflags: -I${includedir}