allow installing lib and include under different prefixes

This commit is contained in:
Robert Schütz
2021-07-24 23:59:49 +02:00
committed by link2xt
parent 3647aac4e6
commit ef9fbf9eba
3 changed files with 10 additions and 4 deletions

View File

@@ -8,7 +8,11 @@ add_custom_command(
"target/release/libdeltachat.a"
"target/release/libdeltachat.so"
"target/release/pkgconfig/deltachat.pc"
COMMAND PREFIX=${CMAKE_INSTALL_PREFIX} ${CARGO} build --release --no-default-features
COMMAND
PREFIX=${CMAKE_INSTALL_PREFIX}
LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR}
${CARGO} build --release --no-default-features
# Build in `deltachat-ffi` directory instead of using
# `--package deltachat_ffi` to avoid feature resolver version

View File

@@ -22,7 +22,9 @@ fn main() {
url = env::var("CARGO_PKG_HOMEPAGE").unwrap_or_else(|_| "".to_string()),
version = env::var("CARGO_PKG_VERSION").unwrap(),
libs_priv = libs_priv,
prefix = env::var("PREFIX").unwrap_or_else(|_| "/usr/local".to_string()),
prefix = env::var("PREFIX").unwrap(),
libdir = env::var("LIBDIR").unwrap(),
includedir = env::var("INCLUDEDIR").unwrap(),
);
fs::create_dir_all(target_path.join("pkgconfig")).unwrap();

View File

@@ -1,6 +1,6 @@
prefix={prefix}
libdir=${{prefix}}/lib
includedir=${{prefix}}/include
libdir={libdir}
includedir={includedir}
Name: {name}
Description: {description}