Point CMake to Qt's cmake module directory if different from KF5's

I still need to fix kdesrc-build-setup though. :(

CCBUG:368070
wilder
Michael Pyne 10 years ago
parent c9d32735a4
commit 2e62dc7e15
  1. 16
      modules/ksb/BuildSystem.pm
  2. 23
      modules/ksb/BuildSystem/KDE4.pm
  3. 30
      modules/ksb/Module.pm
  4. 6
      modules/ksb/l10nSystem.pm

@ -1,4 +1,4 @@
package ksb::BuildSystem;
package ksb::BuildSystem 0.30;
# Base module for the various build systems, includes built-in implementations of
# generic functions and supports hooks for subclasses to provide needed detailed
@ -8,8 +8,6 @@ use strict;
use warnings;
use 5.014;
our $VERSION = '0.20';
use ksb::Debug;
use ksb::Util;
use ksb::StatusView;
@ -101,14 +99,12 @@ sub isProgressOutputSupported
return 0;
}
# If this method returns a non-empty string, then that string is the name
# of an environment variable to prepend the module's installation prefix
# path to. Mostly a hack, but will have to do until there's a better scheme
# for giving integration points for build systems into the actual build
# process.
sub prefixEnvironmentVariable
# Called by the module being built before it runs its build/install process. Should
# setup any needed environment variables, build context settings, etc., in preparation
# for the build and install phases.
sub prepareModuleBuildEnvironment
{
return undef;
my ($self, $ctx, $module, $prefix) = @_;
}
# Returns true if the module should have make install run in order to be

@ -1,4 +1,4 @@
package ksb::BuildSystem::KDE4;
package ksb::BuildSystem::KDE4 0.20;
# Class responsible for building KDE4 CMake-based modules.
@ -6,11 +6,10 @@ use strict;
use warnings;
use 5.014;
our $VERSION = '0.10';
use ksb::Debug;
use ksb::Util;
use ksb::BuildSystem;
use ksb::BuildContext 0.30;
use ksb::BuildSystem 0.30;
our @ISA = ('ksb::BuildSystem');
@ -32,9 +31,21 @@ sub isProgressOutputSupported
return 1;
}
sub prefixEnvironmentVariable
# Called by the module being built before it runs its build/install process. Should
# setup any needed environment variables, build context settings, etc., in preparation
# for the build and install phases.
sub prepareModuleBuildEnvironment
{
return 'CMAKE_PREFIX_PATH';
my ($self, $ctx, $module, $prefix) = @_;
$ctx->prependEnvironmentValue('CMAKE_PREFIX_PATH', $prefix);
$ctx->prependEnvironmentValue('XDG_DATA_DIRS', "$prefix/share");
my $qtdir = $module->getOption('qtdir');
if ($qtdir && $qtdir ne $prefix) {
# Ensure we can find Qt5's own CMake modules
$ctx->prependEnvironmentValue('CMAKE_MODULE_PATH', "$qtdir/lib/cmake");
}
}
sub requiredPrograms

@ -26,7 +26,7 @@ use ksb::Updater::KDEProjectMetadata;
use ksb::BuildException 0.20;
use ksb::BuildSystem;
use ksb::BuildSystem 0.30;
use ksb::BuildSystem::Autotools;
use ksb::BuildSystem::QMake;
use ksb::BuildSystem::Qt4;
@ -661,17 +661,10 @@ sub setupEnvironment
my @ld_dirs = ("$kdedir/lib", "$qtdir/lib", $self->getOption('libpath'));
$ctx->prependEnvironmentValue('LD_LIBRARY_PATH', @ld_dirs);
# Needed to find installed resources for KF5.
# TODO: Make this an integration point for the BuildSystem interface.
$ctx->prependEnvironmentValue('XDG_DATA_DIRS', "$kdedir/share");
my $buildSystem = $self->buildSystem();
$buildSystem->prepareModuleBuildEnvironment($ctx, $self, $prefix);
my @path = ("$kdedir/bin", "$qtdir/bin", $self->getOption('binpath'));
if (my $prefixEnvVar = $self->buildSystem()->prefixEnvironmentVariable())
{
$ctx->prependEnvironmentValue($prefixEnvVar, $prefix);
}
$ctx->prependEnvironmentValue('PATH', @path);
# Set up the children's environment. We use queueEnvironmentVariable since
@ -680,23 +673,8 @@ sub setupEnvironment
$ctx->queueEnvironmentVariable('QTDIR', $qtdir);
# If the module isn't kdelibs, also append kdelibs's KDEDIR setting.
if ($self->name() ne 'kdelibs')
{
my $kdelibsModule = $ctx->lookupModule('kdelibs');
my $kdelibsDir;
$kdelibsDir = $kdelibsModule->installationPath() if $kdelibsModule;
if ($kdelibsDir && $kdelibsDir ne $kdedir) {
whisper ("Module $self uses different KDEDIR than kdelibs, including kdelibs as well.");
$kdedir .= ":$kdelibsDir"
}
}
$ctx->queueEnvironmentVariable('KDEDIRS', $kdedir);
# Read in user environment defines
$self->applyUserEnvironment() unless $self->name() eq 'global';
$self->applyUserEnvironment() unless $self == $ctx;
}
# Returns the path to the log directory used during this run for this

@ -58,9 +58,11 @@ sub isSubdirBuildable
return ($subdir ne 'scripts' && $subdir ne 'templates');
}
sub prefixEnvironmentVariable
sub prepareModuleBuildEnvironment
{
return 'CMAKE_PREFIX_PATH';
my ($ctx, $module, $prefix) = @_;
$ctx->prependEnvironmentValue('CMAKE_PREFIX_PATH', $prefix);
}
# scm-specific update procedure.

Loading…
Cancel
Save