From 8ea19caacf281240411541b5af37c2f9a103a7d1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 7 May 2013 17:10:22 +0200 Subject: add -compile-examples configure option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this overrides the magic that makes examples only install their sources in production builds. packagers may want to force the build of the examples, so they can package them up for demo purposes. this is actually why we formerly had the split between demos and examples ... Task-number: QTBUG-30788 Change-Id: I5633f69404c5aa6846f5496e8f161a273a7a7da3 Reviewed-by: Joerg Bornemann Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a030351443..a83f451b81 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -276,6 +276,8 @@ Configure::Configure(int& argc, char** argv) dictionary[ "BUILDDEV" ] = "no"; + dictionary[ "COMPILE_EXAMPLES" ] = "auto"; + dictionary[ "C++11" ] = "auto"; dictionary[ "SHARED" ] = "yes"; @@ -458,6 +460,13 @@ void Configure::parseCmdLine() dictionary[ "BUILDALL" ] = "yes"; else if (configCmdLine.at(i) == "-force-debug-info") dictionary[ "FORCEDEBUGINFO" ] = "yes"; + + else if (configCmdLine.at(i) == "-compile-examples") { + dictionary[ "COMPILE_EXAMPLES" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-compile-examples") { + dictionary[ "COMPILE_EXAMPLES" ] = "no"; + } + else if (configCmdLine.at(i) == "-c++11") dictionary[ "C++11" ] = "yes"; else if (configCmdLine.at(i) == "-no-c++11") @@ -1696,6 +1705,8 @@ bool Configure::displayHelp() desc( "-skip ", "Exclude an entire module from the build.\n"); + desc( "-compile-examples", "Compile examples even in a production build.\n"); + desc("WIDGETS", "no", "-no-widgets", "Disable Qt Widgets module.\n"); desc("GUI", "no", "-no-gui", "Disable Qt GUI module.\n"); @@ -1979,6 +1990,13 @@ QString Configure::defaultTo(const QString &option) && (!QFile::exists(sourcePath + "/bin/syncqt.pl"))) return "no"; + // Do not actually build the examples in production builds with -prefix, unless requested + if (option == "COMPILE_EXAMPLES" + && QDir::cleanPath(dictionary[ "QT_BUILD_TREE" ]) + != QDir::cleanPath(dictionary[ "QT_INSTALL_PREFIX" ]) + && dictionary[ "BUILDDEV" ] == "no") + return "no"; + return "yes"; } @@ -2560,6 +2578,8 @@ void Configure::generateOutputVars() if (!buildParts.contains("libs")) buildParts += "libs"; buildParts.removeDuplicates(); + if (dictionary[ "COMPILE_EXAMPLES" ] == "yes") + qmakeConfig += "compile_examples"; if (dictionary["MSVC_MP"] == "yes") qmakeConfig += "msvc_mp"; -- cgit v1.2.3