From 45bd13fd792b96a2ebf2c6887da263f0ebc2c02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Fiestas?= Date: Wed, 5 Mar 2014 15:08:36 +0100 Subject: [PATCH] Execute install/fast on CMake, and add --install-only This patch does three things: 1-Adds --install-only for the sake of consistency 2-Adds --install into the usage 3-Makes the CMake (KDE4) build system use make install/fast. make install/fast only performs the installation of the files thus avoiding a double compilation. REVIEW: 116589 --- doc/index.docbook | 7 +++++++ modules/ksb/Application.pm | 11 ++++++++++- modules/ksb/BuildSystem.pm | 2 +- modules/ksb/BuildSystem/KDE4.pm | 17 +++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/doc/index.docbook b/doc/index.docbook index ad8a512..2808bf2 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -2822,6 +2822,13 @@ Only perform the build process. + +--install-only + +Only perform the install process. + + + --ignore-modules diff --git a/modules/ksb/Application.pm b/modules/ksb/Application.pm index e14b3e1..6046ed6 100644 --- a/modules/ksb/Application.pm +++ b/modules/ksb/Application.pm @@ -191,6 +191,10 @@ DONE 'build-only' => sub { $phases->phases('build'); }, + 'install-only' => sub { + $self->{run_mode} = 'install'; + $phases->phases('install'); + }, prefix => sub { my ($optName, $arg) = @_; $auxOptions{prefix} = $arg; @@ -258,7 +262,7 @@ DONE 'no-tests', 'build-when-unchanged|force-build', 'verbose|v', 'quiet|quite|q', 'really-quiet', 'debug', 'reconfigure', 'colorful-output|color!', 'async!', - 'src-only|svn-only', 'build-only', 'build-system-only', + 'src-only|svn-only', 'build-only', 'install-only', 'build-system-only', 'rc-file=s', 'prefix=s', 'niceness|nice:10', 'ignore-modules=s{,}', 'print-modules', 'pretend|dry-run|p', 'refresh-build', 'start-program|run=s{,}', @@ -2717,6 +2721,11 @@ Options: at this point). --build-only Build only, don't perform updates or install. + --install-only Only install the already compiled code, this is equivalent + --install to make install/fast in CMake. Useful for example when we + want to clean the install directory but we do not want to + re-compile everything. + --rc-file= Read configuration from filename instead of default. --resume-from= Skips modules until just before the given package, diff --git a/modules/ksb/BuildSystem.pm b/modules/ksb/BuildSystem.pm index 6c5f030..91e8967 100644 --- a/modules/ksb/BuildSystem.pm +++ b/modules/ksb/BuildSystem.pm @@ -338,7 +338,7 @@ sub safe_make (@) # them. next unless $self->isSubdirBuildable($subdir); - my $logname = $optsRef->{logbase} // $optsRef->{target}; + my $logname = $optsRef->{logbase} // $optsRef->{logfile} // $optsRef->{target}; if ($subdir ne '') { diff --git a/modules/ksb/BuildSystem/KDE4.pm b/modules/ksb/BuildSystem/KDE4.pm index 7f67f8c..2b8ebc1 100644 --- a/modules/ksb/BuildSystem/KDE4.pm +++ b/modules/ksb/BuildSystem/KDE4.pm @@ -97,6 +97,23 @@ sub runTestsuite return 1; } +# Re-implementing the one in BuildSystem since in CMake we want to call +# make install/fast, so it only installs rather than building + installing +sub installInternal +{ + my $self = shift; + my $module = $self->module(); + my @cmdPrefix = @_; + + return $self->safe_make ({ + target => 'install/fast', + logfile => 'install', + message => "Installing g[$module]", + 'prefix-options' => [@cmdPrefix], + subdirs => [ split(' ', $module->getOption("checkout-only")) ], + }) == 0; +} + sub configureInternal { my $self = assert_isa(shift, 'ksb::BuildSystem::KDE4');