Commit daacb56e authored by Christian Hergert's avatar Christian Hergert
Browse files

cmake: allow specifying CMAKE environment variable

This allows the user to specify CMAKE=/path/to/cmake in case they need to
use an alternate cmake than the default cmake in $PATH.
parent d3ea0022
......@@ -82,6 +82,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
const gchar *config_opts;
const gchar *prefix;
const gchar *srcdir;
const gchar *cmake;
guint id;
gint parallelism;
......@@ -104,6 +105,9 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
g_assert (IDE_IS_RUNTIME (runtime));
g_assert (srcdir != NULL);
if (!(cmake = ide_configuration_getenv (configuration, "CMAKE")))
cmake = "cmake";
for (guint i = 0; i < G_N_ELEMENTS (ninja_names); i++)
{
if (ide_runtime_contains_program_in_path (runtime, ninja_names[i], NULL))
......@@ -133,7 +137,7 @@ gbp_cmake_pipeline_addin_load (IdeBuildPipelineAddin *addin,
prefix_option = g_strdup_printf ("-DCMAKE_INSTALL_PREFIX=%s", prefix);
ide_subprocess_launcher_push_argv (configure_launcher, "cmake");
ide_subprocess_launcher_push_argv (configure_launcher, cmake);
ide_subprocess_launcher_push_argv (configure_launcher, "-G");
ide_subprocess_launcher_push_argv (configure_launcher, "Ninja");
ide_subprocess_launcher_push_argv (configure_launcher, ".");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment