Teach the 'prefix' option to understand ${MODULE}/$MODULE.

This commit should make the 'prefix' option expand this variable to the
module's name, so one can easily install each module into a different
directory.

Reviewed-by: mpyne
wilder
Raphael Kubo da Costa 14 years ago
parent 4201792231
commit 9be64e86e2
  1. 6
      doc/index.docbook
  2. 30
      kdesrc-build

@ -1904,11 +1904,13 @@ cannot figure out what you mean using <link linkend="conf-branch">branch</link>.
<row id="conf-prefix">
<entry>prefix</entry>
<entry>Module setting overrides global</entry>
<entry>This option controls where to install the module (normally the
<entry><para>This option controls where to install the module (normally the
<option><link linkend="conf-kdedir">kdedir</link></option> setting is used).
Using this option allows you to install a module to a different directory than
where the KDE Platform libraries are installed, such as if you were using
&kdesrc-build; only to build applications.
&kdesrc-build; only to build applications.</para>
<para>You can use <varname>${MODULE}</varname> or <varname>$MODULE</varname>
in the path to have them expanded to the module's name.</para>
</entry>
</row>

@ -2999,6 +2999,27 @@ EOF
return $destDir;
}
# Subroutine to return the installation path of a given module (the value
# that is passed to the CMAKE_INSTALL_PREFIX CMake option).
# It is based on the "prefix" and, if it is not set, the "kdedir" option.
# The user may use '$MODULE' or '${MODULE}' in the "prefix" option to have
# them replaced by the name of the module in question.
sub installationPath
{
my $self = assert_isa(shift, 'Module');
my $path = $self->getOption('prefix');
if (!$path)
{
return $self->getOption('kdedir');
}
my $moduleName = $self->name();
$path =~ s/(\${MODULE})|(\$MODULE\b)/$moduleName/g;
return $path;
}
1;
}
@ -6276,10 +6297,7 @@ sub safe_run_cmake
push @commands, "-DCMAKE_CXX_FLAGS:STRING=$cxxflags";
}
my $prefix = $module->getOption('prefix');
# If still no prefix, use KDEDIR
$prefix = $module->getOption('kdedir') unless $prefix;
my $prefix = $module->installationPath();
push @commands, "-DCMAKE_INSTALL_PREFIX=$prefix";
@ -6565,9 +6583,7 @@ sub update_module_environment
my $module = assert_isa(shift, 'Module');
my $kdedir = $module->getOption('kdedir');
my $qtdir = $module->getOption('qtdir');
my $prefix = $module->getOption('prefix');
$prefix = $kdedir unless $prefix;
my $prefix = $module->installationPath();
# Add global set-envs
setup_module_environment ($module->buildContext());

Loading…
Cancel
Save