From 9d0a01eda434520f01ddd74e6d837607995e8436 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Thu, 3 May 2018 17:22:47 +0200 Subject: [PATCH] Use 'libdir' build option. Closes: #148 Approved by: alexlarsson --- src/builder-module.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/builder-module.c b/src/builder-module.c index 5ff16683..497af3a4 100644 --- a/src/builder-module.c +++ b/src/builder-module.c @@ -1561,6 +1561,8 @@ builder_module_build_helper (BuilderModule *self, g_auto(GStrv) configure_args = NULL; g_autoptr(GPtrArray) configure_args_arr = g_ptr_array_new (); g_autofree char *configure_content = NULL; + const char *prefix = NULL; + const char *libdir = NULL; if (!g_file_load_contents (configure_file, NULL, &configure_content, NULL, NULL, error)) { @@ -1633,22 +1635,27 @@ builder_module_build_helper (BuilderModule *self, else if (cmake_ninja) cmake_generator = "Ninja"; + prefix = builder_options_get_prefix (self->build_options, context); + libdir = builder_options_get_libdir (self->build_options, context); + if (cmake || cmake_ninja) { - g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_PREFIX:PATH='%s'", - builder_options_get_prefix (self->build_options, context))); + g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_PREFIX:PATH='%s'", prefix)); + if (libdir) + g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_LIBDIR:PATH='%s'", libdir)); g_ptr_array_add (configure_args_arr, g_strdup ("-G")); g_ptr_array_add (configure_args_arr, g_strdup_printf ("%s", cmake_generator)); } else if (qmake) { - g_ptr_array_add (configure_args_arr, g_strdup_printf ("PREFIX='%s'", - builder_options_get_prefix (self->build_options, context))); + g_ptr_array_add (configure_args_arr, g_strdup_printf ("PREFIX='%s'", prefix)); + /* TODO: What parameter for qmake? */ } else /* autotools and meson */ { - g_ptr_array_add (configure_args_arr, g_strdup_printf ("--prefix=%s", - builder_options_get_prefix (self->build_options, context))); + g_ptr_array_add (configure_args_arr, g_strdup_printf ("--prefix=%s", prefix)); + if (libdir) + g_ptr_array_add (configure_args_arr, g_strdup_printf ("--libdir=%s", libdir)); } g_ptr_array_add (configure_args_arr, configure_final_arg);