mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-04 23:14:57 -04:00
Squashed 'boost/' content from commit b4feb19f2
git-subtree-dir: boost git-subtree-split: b4feb19f287ee92d87a9624b5d36b7cf46aeadeb
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Copyright 2002, 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
boost-build ../src/kernel ;
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
import feature ;
|
||||
|
||||
feature.feature tblgen : : dependency free ;
|
||||
|
||||
project built_tool ;
|
||||
|
||||
build-project core ;
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
import toolset ;
|
||||
import os ;
|
||||
|
||||
project : requirements <tblgen>../tblgen//tblgen ;
|
||||
|
||||
|
||||
# Create a.c using a custom action defined below.
|
||||
make a.c : a.td : @tblgen ;
|
||||
|
||||
# Use a.c in executable.
|
||||
exe core : core.cpp a.c ;
|
||||
|
||||
# The action has to invoke the tool built in other
|
||||
# parts of the project. The <tblgen> feature is used
|
||||
# to specify the location of the tool, and the flags
|
||||
# statement below make the full path to the tool
|
||||
# available inside the action.
|
||||
toolset.flags tblgen COMMAND <tblgen> ;
|
||||
|
||||
# We generally want a.c to be rebuilt when the tool changes.
|
||||
rule tblgen ( targets * : sources * : properties * )
|
||||
{
|
||||
DEPENDS $(targets) : [ on $(targets) return $(COMMAND) ] ;
|
||||
}
|
||||
|
||||
# The action that invokes the tool
|
||||
actions tblgen bind COMMAND
|
||||
{
|
||||
$(COMMAND:E=tblgen) > $(<)
|
||||
}
|
||||
|
||||
if [ os.name ] = VMS
|
||||
{
|
||||
actions tblgen bind COMMAND
|
||||
{
|
||||
PIPE MCR $(COMMAND:WE=tblgen) > $(<:W)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
This example shows how to build an executable and then use it
|
||||
for generating other targets. The 'tblgen' subdirectory builds
|
||||
a tool, while the 'core' subdirectory uses that tool. Refer
|
||||
to core/Jamfile.jam for detailed comments.
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
project : requirements -<tblgen>tblgen//tblgen ;
|
||||
|
||||
exe tblgen : tblgen.cpp ;
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "int foo;\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Bye!\n";
|
||||
return EXIT_FAILURE
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Bye!\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright 2016 Rene Rivera
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
using testing ;
|
||||
import property-set ;
|
||||
import path ;
|
||||
|
||||
exe success : success.cpp ;
|
||||
|
||||
run success : arg1 arg2 : : : success-a ;
|
||||
run success : arg3 arg4 : : : success-b ;
|
||||
|
||||
run post.cpp : : success-a : : post-a ;
|
||||
run post.cpp : : success-b : : post-b ;
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout << argv[1] << "\n";
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::cout << "Hi!\n";
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class_template
|
||||
|
||||
class %class_name% {
|
||||
public:
|
||||
%class_name%() {}
|
||||
~%class_name%() {}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
// (C) Copyright Vladimir Prus, 2003
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Please see 'usage.verbatim' file for usage notes.
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
using std::cout;
|
||||
using std::string;
|
||||
using std::strlen;
|
||||
|
||||
extern const char class_template[];
|
||||
extern const char usage[];
|
||||
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
if (av[1]) {
|
||||
|
||||
string class_name = av[1];
|
||||
string s = class_template;
|
||||
|
||||
string::size_type n;
|
||||
while((n = s.find("%class_name%")) != string::npos) {
|
||||
s.replace(n, strlen("%class_name%"), class_name);
|
||||
}
|
||||
std::cout << "Output is:\n";
|
||||
std::cout << s << "\n";
|
||||
return 0;
|
||||
} else {
|
||||
std::cout << usage << "\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
# Copyright 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import sys
|
||||
from string import strip
|
||||
|
||||
def quote_line(line):
|
||||
|
||||
result = ""
|
||||
|
||||
for i in line:
|
||||
if (i == '\\'):
|
||||
result = result + '\\\\'
|
||||
elif (i == '\"'):
|
||||
result = result + '\\\"'
|
||||
elif (i != '\r' and i != '\n'):
|
||||
result = result + i;
|
||||
|
||||
return '\"' + result + '\\n\"'
|
||||
|
||||
def quote_file(file):
|
||||
result = ""
|
||||
|
||||
for i in file.readlines():
|
||||
result = result + quote_line(i) + "\n"
|
||||
|
||||
return result
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print "Usage: inline_file.py output_c_file file_to_include"
|
||||
else:
|
||||
output_c_file = sys.argv[1]
|
||||
out_file = open(output_c_file, "w");
|
||||
|
||||
file_to_include = sys.argv[2]
|
||||
|
||||
in_file = open(file_to_include, "r");
|
||||
variable_name = strip(in_file.readline())
|
||||
out_file.write("extern const char %s[] = {\n%s};\n\n" % (variable_name, quote_file(in_file)))
|
||||
in_file.close()
|
||||
out_file.close()
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import verbatim ;
|
||||
|
||||
exe codegen : codegen.cpp class.verbatim usage.verbatim
|
||||
t1.verbatim ;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Copyright 2003 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example show how to add a new target type and a new tool support to
|
||||
Boost.Build. Please refer to extender manual for a complete description of this
|
||||
example.
|
||||
|
||||
Note that this example requires Python. If cygwin Python on Windows is to be
|
||||
used, please go to "verbatim.jam" and follow instructions there.
|
||||
@@ -0,0 +1,2 @@
|
||||
t1
|
||||
//###include "t2.verbatim"
|
||||
@@ -0,0 +1,5 @@
|
||||
usage
|
||||
Usage: codegen class_name
|
||||
|
||||
This program takes a template of C++ code and replaces of all occurrences of
|
||||
%class_name% with the passed 'class_name' parameter.
|
||||
@@ -0,0 +1,61 @@
|
||||
# Copyright 2003, 2004 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# This file shows some of the primary customization mechanisms in Boost.Build V2
|
||||
# and should serve as a basic for your own customization.
|
||||
# Each part has a comment describing its purpose, and you can pick the parts
|
||||
# which are relevant to your case, remove everything else, and then change names
|
||||
# and actions to taste.
|
||||
|
||||
import os ;
|
||||
|
||||
# Declare a new target type. This allows Boost.Build to do something sensible
|
||||
# when targets with the .verbatim extension are found in sources.
|
||||
import type ;
|
||||
type.register VERBATIM : verbatim ;
|
||||
|
||||
# Declare a dependency scanner for the new target type. The
|
||||
# 'inline-file.py' script does not handle includes, so this is
|
||||
# only for illustraction.
|
||||
import scanner ;
|
||||
# First, define a new class, derived from 'common-scanner',
|
||||
# that class has all the interesting logic, and we only need
|
||||
# to override the 'pattern' method which return regular
|
||||
# expression to use when scanning.
|
||||
class verbatim-scanner : common-scanner
|
||||
{
|
||||
rule pattern ( )
|
||||
{
|
||||
return "//###include[ ]*\"([^\"]*)\"" ;
|
||||
}
|
||||
}
|
||||
|
||||
# Register the scanner class. The 'include' is
|
||||
# the property which specifies the search path
|
||||
# for includes.
|
||||
scanner.register verbatim-scanner : include ;
|
||||
# Assign the scanner class to the target type.
|
||||
# Now, all .verbatim sources will be scanned.
|
||||
# To test this, build the project, touch the
|
||||
# t2.verbatim file and build again.
|
||||
type.set-scanner VERBATIM : verbatim-scanner ;
|
||||
|
||||
import generators ;
|
||||
generators.register-standard verbatim.inline-file : VERBATIM : CPP ;
|
||||
|
||||
# Note: To use Cygwin Python on Windows change the following line
|
||||
# to "python inline_file.py $(<) $(>)"
|
||||
# Also, make sure that "python" in in PATH.
|
||||
actions inline-file
|
||||
{
|
||||
"./inline_file.py" $(<) $(>)
|
||||
}
|
||||
|
||||
if [ os.name ] = VMS
|
||||
{
|
||||
actions inline-file
|
||||
{
|
||||
python inline_file.py $(<:W) $(>:W)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
# Copyright 2010 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# This file is only used with Python port of Boost.Build
|
||||
|
||||
# This file shows some of the primary customization mechanisms in Boost.Build V2
|
||||
# and should serve as a basic for your own customization.
|
||||
# Each part has a comment describing its purpose, and you can pick the parts
|
||||
# which are relevant to your case, remove everything else, and then change names
|
||||
# and actions to taste.
|
||||
|
||||
# Declare a new target type. This allows Boost.Build to do something sensible
|
||||
# when targets with the .verbatim extension are found in sources.
|
||||
import b2.build.type as type
|
||||
type.register("VERBATIM", ["verbatim"])
|
||||
|
||||
# Declare a dependency scanner for the new target type. The
|
||||
# 'inline-file.py' script does not handle includes, so this is
|
||||
# only for illustraction.
|
||||
import b2.build.scanner as scanner;
|
||||
# First, define a new class, derived from 'common-scanner',
|
||||
# that class has all the interesting logic, and we only need
|
||||
# to override the 'pattern' method which return regular
|
||||
# expression to use when scanning.
|
||||
class VerbatimScanner(scanner.CommonScanner):
|
||||
|
||||
def pattern(self):
|
||||
return "//###include[ ]*\"([^\"]*)\""
|
||||
|
||||
scanner.register(VerbatimScanner, ["include"])
|
||||
type.set_scanner("VERBATIM", VerbatimScanner)
|
||||
|
||||
import b2.build.generators as generators
|
||||
|
||||
generators.register_standard("verbatim.inline-file",
|
||||
["VERBATIM"], ["CPP"])
|
||||
|
||||
from b2.manager import get_manager
|
||||
|
||||
get_manager().engine().register_action("verbatim.inline-file",
|
||||
"""
|
||||
./inline_file.py $(<) $(>)
|
||||
""")
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Copyright 2007 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This example shows the 'generate' rule, that allows you to construct target
|
||||
using any arbitrary set of transformation and commands.
|
||||
|
||||
The rule is similar to 'make' and 'notfile', but unlike those, you can operate
|
||||
in terms of Boost.Build 'virtual targets', which is more flexible.
|
||||
|
||||
Please consult the docs for more explanations.
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Copyright 2007 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
import "class" : new ;
|
||||
import common ;
|
||||
|
||||
rule generate-example ( project name : property-set : sources * )
|
||||
{
|
||||
local result ;
|
||||
for local s in $(sources)
|
||||
{
|
||||
#local source-name = [ $(s).name ] ;
|
||||
#local source-action = [ $(s).action ] ;
|
||||
#local source-properties = [ $(source-action).properties ] ;
|
||||
|
||||
# Create a new action, that takes the source target and runs the
|
||||
# 'common.copy' command on it.
|
||||
local a = [ new non-scanning-action $(s) : common.copy : $(property-set)
|
||||
] ;
|
||||
|
||||
# Create a target to represent the action result. Uses the target name
|
||||
# passed here via the 'name' parameter and the same type and project as
|
||||
# the source.
|
||||
result += [ new file-target $(name) : [ $(s).type ] : $(project) : $(a)
|
||||
] ;
|
||||
}
|
||||
return $(result) ;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
from b2.build.virtual_target import NonScanningAction, FileTarget
|
||||
|
||||
def generate_example(project, name, ps, sources):
|
||||
|
||||
result = []
|
||||
for s in sources:
|
||||
|
||||
a = NonScanningAction([s], "common.copy", ps)
|
||||
|
||||
# Create a target to represent the action result. Uses the target name
|
||||
# passed here via the 'name' parameter and the same type and project as
|
||||
# the source.
|
||||
result.append(FileTarget(name, s.type(), project, a))
|
||||
|
||||
return result
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright 2007 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import generate ;
|
||||
|
||||
import gen ;
|
||||
|
||||
generate a2 : a.cpp : <generating-rule>@gen.generate-example ;
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
This example shows how to declare a new generator class. It is necessary when
|
||||
generator's logic is more complex that just running a single tool.
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
Copyright 2006 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import soap ;
|
||||
exe foo : foo.gci : <server>on ;
|
||||
@@ -0,0 +1,86 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# This is example of a fictional code generator tool.
|
||||
# It accepts a single input of type '.gci' and produces
|
||||
# either one or two outputs of type .cpp, depending
|
||||
# on the value of the feature <server-mode>
|
||||
#
|
||||
# This example is loosely based on gSOAP code generator.
|
||||
|
||||
import type ;
|
||||
import generators ;
|
||||
import feature ;
|
||||
import common ;
|
||||
import "class" : new ;
|
||||
import os ;
|
||||
|
||||
type.register GCI : gci ;
|
||||
|
||||
feature.feature server : off on : incidental ;
|
||||
|
||||
class soap-generator : generator
|
||||
{
|
||||
import "class" : new ;
|
||||
|
||||
rule __init__ ( * : * )
|
||||
{
|
||||
generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
|
||||
}
|
||||
|
||||
rule run ( project name ? : property-set : sources * )
|
||||
{
|
||||
if ! $(sources[2])
|
||||
{
|
||||
# Accept only single source.
|
||||
local t = [ $(sources[1]).type ] ;
|
||||
if $(t) = GCI
|
||||
{
|
||||
# The type is correct.
|
||||
|
||||
# If no output name is specified, guess it from sources.
|
||||
if ! $(name)
|
||||
{
|
||||
name = [ generator.determine-output-name $(sources) ] ;
|
||||
}
|
||||
|
||||
# Produce one output, using just copy.
|
||||
local a = [ new action $(sources[1])
|
||||
: common.copy : $(property-set) ] ;
|
||||
local t = [ new file-target $(name) : CPP : $(project)
|
||||
: $(a) ] ;
|
||||
|
||||
# If in server mode, create another output -- an
|
||||
# empty file. If this were a real SOAP generator, we
|
||||
# might have created a single action, and two targets
|
||||
# both using that action.
|
||||
local t2 ;
|
||||
if [ $(property-set).get <server> ] = "on"
|
||||
{
|
||||
local a = [ new action : soap.touch : $(property-set) ] ;
|
||||
t2 = [ new file-target $(name)_server : CPP : $(project)
|
||||
: $(a) ] ;
|
||||
}
|
||||
return [ virtual-target.register $(t) ]
|
||||
[ virtual-target.register $(t2) ] ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
generators.register [ new soap-generator soap.soap : GCI : CPP ] ;
|
||||
|
||||
TOUCH = [ common.file-touch-command ] ;
|
||||
actions touch
|
||||
{
|
||||
$(TOUCH) $(<)
|
||||
}
|
||||
|
||||
if [ os.name ] = VMS
|
||||
{
|
||||
actions touch
|
||||
{
|
||||
$(TOUCH) $(<:W)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright 2003, 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
# Declare a main target.
|
||||
exe main : main.cpp ;
|
||||
|
||||
# Declare an action for updating translations
|
||||
# After changing main.cpp, invocation of
|
||||
#
|
||||
# bjam update-russian
|
||||
#
|
||||
# will update translations in russian.po
|
||||
gettext.update update-russian : russian.po main ;
|
||||
|
||||
# Compiled message catalog.
|
||||
gettext.catalog russian : russian.po ;
|
||||
|
||||
# A stage rule which installs message catalog to the
|
||||
# location gettext expects.
|
||||
stage messages-russian : russian
|
||||
: <location>messages/ru_RU.KOI8-R/LC_MESSAGES
|
||||
<name>main.mo
|
||||
;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copyright 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
using gettext ;
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright Vladimir Prus 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#define i18n(s) gettext(s)
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
// Specify that translations are stored in directory
|
||||
// "messages".
|
||||
bindtextdomain("main", "messages");
|
||||
textdomain("main");
|
||||
|
||||
// Switch to russian locale.
|
||||
setlocale(LC_MESSAGES, "ru_RU.KOI8-R");
|
||||
|
||||
// Output localized message.
|
||||
std::cout << i18n("hello") << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
Copyright 2003 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example shows how it is possible to use GNU gettext utilities with
|
||||
Boost.Build.
|
||||
|
||||
A simple translation file is compiled and installed as message catalog for
|
||||
russian. The main application explicitly switches to russian locale and outputs
|
||||
the translation of "hello".
|
||||
|
||||
To test:
|
||||
|
||||
bjam
|
||||
bin/gcc/debug/main
|
||||
|
||||
To test even more:
|
||||
|
||||
- add more localized strings to "main.cpp"
|
||||
- run "bjam update-russian"
|
||||
- edit "russian.po"
|
||||
- run bjam
|
||||
- run "main"
|
||||
@@ -0,0 +1,21 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2003-07-01 15:45+0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: main.cpp:16
|
||||
msgid "hello"
|
||||
msgstr "international hello"
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) 2003 Vladimir Prus
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello!\n";
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
exe hello : hello.cpp ;
|
||||
@@ -0,0 +1,7 @@
|
||||
Copyright 2008 Jurko Gospodnetic
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example shows a very basic Boost Build project set up so it compiles a
|
||||
single executable from a single source file.
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2003 Vladimir Prus
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <lib1.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
foo();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright 2002, 2003, 2005 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
# Declare a executable file, which uses a library. Note that
|
||||
# includes that for library will be automatically used
|
||||
# when compiling 'app.cpp'
|
||||
exe app : app.cpp /library-example/foo//bar ;
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
use-project /library-example/foo : util/foo ;
|
||||
|
||||
build-project app ;
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) 2003 Vladimir Prus
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void foo() {}
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright (c) 2003 Vladimir Prus
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
void foo();
|
||||
@@ -0,0 +1,9 @@
|
||||
# Copyright 2005 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
project
|
||||
: usage-requirements <include>include ;
|
||||
|
||||
lib bar : bar.cpp ;
|
||||
@@ -0,0 +1,2 @@
|
||||
import sys
|
||||
open(sys.argv[2], "w").write(open(sys.argv[1]).read())
|
||||
@@ -0,0 +1,22 @@
|
||||
import feature ;
|
||||
import toolset ;
|
||||
import os ;
|
||||
|
||||
path-constant HERE : . ;
|
||||
make main.cpp : main_cpp.pro : @do-something ;
|
||||
|
||||
feature.feature example.python.interpreter : : free ;
|
||||
|
||||
toolset.flags do-something PYTHON : <example.python.interpreter> ;
|
||||
actions do-something
|
||||
{
|
||||
"$(PYTHON:E=python)" "$(HERE)/foo.py" "$(>)" "$(<)"
|
||||
}
|
||||
|
||||
if [ os.name ] = VMS
|
||||
{
|
||||
actions do-something
|
||||
{
|
||||
$(PYTHON:E=python) $(HERE:W)foo.py $(>:W) $(<:W)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
int main() {}
|
||||
@@ -0,0 +1,7 @@
|
||||
Copyright 2002, 2005 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
Example of using custom command to create one file from another, using the
|
||||
built-in 'make' rule.
|
||||
@@ -0,0 +1,19 @@
|
||||
/* Copyright 2006 Vladimir Prus
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifdef BOOST_BUILD_PCH_ENABLED
|
||||
|
||||
#ifdef FOO2
|
||||
int bar();
|
||||
#endif
|
||||
|
||||
class TestClass {
|
||||
public:
|
||||
TestClass(int, int) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
# Copyright 2006 Ilya Sokolov
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0. (See
|
||||
# accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# pch ##########################################################################
|
||||
|
||||
import pch ;
|
||||
|
||||
cpp-pch pch
|
||||
: # sources
|
||||
include/pch.hpp
|
||||
: # requirements
|
||||
<include>include
|
||||
;
|
||||
explicit pch ;
|
||||
|
||||
# exe ##########################################################################
|
||||
|
||||
exe hello_world
|
||||
: # sources
|
||||
pch
|
||||
source/hello_world.cpp
|
||||
: # requirements
|
||||
<include>include
|
||||
: # default build
|
||||
: # usage requirements
|
||||
;
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Copyright 2006 Ilya Sokolov
|
||||
Copyright 2006 Vladimir Prus
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#include <pch.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
TestClass c(1, 2);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import python_helpers ;
|
||||
|
||||
ECHO "test1:" [ python_helpers.test1 ] ;
|
||||
ECHO "test2:" [ python_helpers.test2 1234 : 5678 ] ;
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import modules ;
|
||||
local here = [ modules.binding $(__name__) ] ;
|
||||
here = $(here:D) ;
|
||||
modules.poke : EXTRA_PYTHONPATH : $(here) ;
|
||||
|
||||
# Import the Python rules to Boost.Build
|
||||
PYTHON_IMPORT_RULE python_helpers : test1 : python_helpers : test1 ;
|
||||
PYTHON_IMPORT_RULE python_helpers : test2 : python_helpers : test2 ;
|
||||
|
||||
# Make the new rules accessible to everybody who imports us.
|
||||
EXPORT python_helpers : test1 test2 ;
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright 2006 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# Declare a couple of functions called from Boost.Build
|
||||
#
|
||||
# Each function will receive as many arguments as there ":"-separated
|
||||
# arguments in bjam call. Each argument is a list of strings.
|
||||
# As a special exception (aka bug), if no arguments are passed in bjam,
|
||||
# Python function will be passed a single empty list.
|
||||
#
|
||||
# All Python functions must return a list of strings, which may be empty.
|
||||
|
||||
def test1(l):
|
||||
return ["foo", "bar"]
|
||||
|
||||
def test2(l, l2):
|
||||
return [l[0], l2[0]]
|
||||
@@ -0,0 +1,16 @@
|
||||
Copyright 2006 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example shows how you can use Python modules from Boost.Build.
|
||||
|
||||
In order to do this, you need to build bjam with Python support, by running:
|
||||
|
||||
./build.sh --with-python=/usr
|
||||
|
||||
in the jam/src directory (replace /usr with the root of your Python
|
||||
installation).
|
||||
|
||||
The integration between Python and bjam is very basic now, but enough to be
|
||||
useful.
|
||||
@@ -0,0 +1,20 @@
|
||||
Copyright 2005 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This directory contains Boost.Build examples for the Qt library
|
||||
(http://www.trolltech.com/products/qt/index.html).
|
||||
|
||||
The current examples are:
|
||||
1. Basic setup -- application with several sources and moccable header.
|
||||
2. Using of .ui source file.
|
||||
3. Running .cpp files via the moc tool.
|
||||
|
||||
For convenience, there are examples both for 3.* and 4.* version of Qt, they are
|
||||
mostly identical and differ only in source code.
|
||||
|
||||
All examples assumes that you just installed Boost.Build and that QTDIR
|
||||
environment variables is set (typical values can be /usr/share/qt3 and
|
||||
/usr/share/qt4). After adding "using qt ..." to your user-config.jam, you would
|
||||
have to remove "using qt ; " statements from example Jamroot files.
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright Vladimir Prus 2004.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "canvas.h"
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qcanvas.h>
|
||||
#include <qlayout.h>
|
||||
|
||||
Canvas::Canvas(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_pen = QPen(QColor(255, 128, 128));
|
||||
m_brushes = new QBrush[2];
|
||||
m_brushes[0] = QBrush(QColor(255, 0, 0));
|
||||
m_brushes[1] = QBrush(QColor(0, 255, 0));
|
||||
m_current_brush = 0;
|
||||
|
||||
m_canvas = new QCanvas(this);
|
||||
m_canvas->resize(4*1600, 600);
|
||||
|
||||
redraw();
|
||||
|
||||
QVBoxLayout* l = new QVBoxLayout(this);
|
||||
|
||||
m_canvas_view = new QCanvasView(m_canvas, this);
|
||||
l->addWidget(m_canvas_view);
|
||||
m_canvas_view->resize(rect().size());
|
||||
m_canvas_view->show();
|
||||
}
|
||||
|
||||
Canvas::~Canvas()
|
||||
{
|
||||
delete m_brushes;
|
||||
}
|
||||
|
||||
void Canvas::redraw()
|
||||
{
|
||||
QCanvasItemList l = m_canvas->allItems();
|
||||
for(QCanvasItemList::iterator i = l.begin(),
|
||||
e = l.end(); i != e; ++i)
|
||||
{
|
||||
delete *i;
|
||||
}
|
||||
|
||||
unsigned count = 0;
|
||||
for (unsigned x = 10; x < 4*1600; x += 20)
|
||||
for (unsigned y = 10; y < 600; y += 20) {
|
||||
QCanvasRectangle* r = new QCanvasRectangle(x, y, 10, 10, m_canvas);
|
||||
r->setPen(m_pen);
|
||||
r->setBrush(m_brushes[m_current_brush]);
|
||||
r->show();
|
||||
++count;
|
||||
QCanvasText* t = new QCanvasText("D", m_canvas);
|
||||
t->move(x, y);
|
||||
t->show();
|
||||
++count;
|
||||
}
|
||||
|
||||
(new QCanvasText(QString::number(count), m_canvas))->show();
|
||||
m_canvas->setAllChanged();
|
||||
|
||||
}
|
||||
|
||||
void Canvas::change_color()
|
||||
{
|
||||
m_current_brush = (m_current_brush + 1)%2;
|
||||
redraw();
|
||||
m_canvas->update();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright Vladimir Prus 2004.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef CANVAS_VP_2004_08_31
|
||||
#define CANVAS_VP_2004_08_31
|
||||
|
||||
#include <qmainwindow.h>
|
||||
#include <qpen.h>
|
||||
#include <qbrush.h>
|
||||
|
||||
class Canvas : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Canvas(QWidget* parent);
|
||||
|
||||
virtual ~Canvas();
|
||||
|
||||
public slots:
|
||||
void change_color();
|
||||
|
||||
private:
|
||||
void redraw();
|
||||
class QCanvas* m_canvas;
|
||||
class QCanvasView* m_canvas_view;
|
||||
class QPen m_pen;
|
||||
class QBrush* m_brushes;
|
||||
int m_current_brush;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# Copyright Vladimir Prus 2004.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt
|
||||
# or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
using qt ;
|
||||
|
||||
project
|
||||
# built MT version, unless asked otherwise.
|
||||
: default-build <threading>multi
|
||||
;
|
||||
|
||||
exe canvas : main.cpp canvas.cpp canvas.h : <library>/qt//qt ;
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright Vladimir Prus 2004.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "canvas.h"
|
||||
#include <qapplication.h>
|
||||
#include <qvbox.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
class Window : public QMainWindow
|
||||
{
|
||||
public:
|
||||
Window()
|
||||
{
|
||||
setCaption("QCanvas test");
|
||||
QVBox* vb = new QVBox(this);
|
||||
setCentralWidget(vb);
|
||||
|
||||
Canvas* c = new Canvas(vb);
|
||||
QPushButton* b = new QPushButton("Change color", vb);
|
||||
connect(b, SIGNAL(clicked()), c, SLOT(change_color()));
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
Window *w = new Window();
|
||||
|
||||
app.setMainWidget(w);
|
||||
w->show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
using qt ;
|
||||
import cast ;
|
||||
|
||||
project
|
||||
: default-build <threading>multi
|
||||
;
|
||||
|
||||
exe main : main.cpp [ cast _ moccable-cpp : main.cpp ]
|
||||
/qt//qt
|
||||
;
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright Vladimir Prus 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class My_widget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
My_widget() : QWidget()
|
||||
{
|
||||
QPushButton* b = new QPushButton("Push me", this);
|
||||
|
||||
connect(b, SIGNAL(clicked()), this, SLOT(theSlot()));
|
||||
}
|
||||
|
||||
private slots:
|
||||
void theSlot()
|
||||
{
|
||||
std::cout << "Clicked\n";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
QApplication app(ac, av);
|
||||
My_widget mw;
|
||||
mw.show();
|
||||
app.setMainWidget(&mw);
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#include "main.moc"
|
||||
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
|
||||
<class>HelloWorldWidget</class>
|
||||
<comment>
|
||||
<!--
|
||||
Copyright Felix E. Klee, 2003
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt
|
||||
or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
</comment>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>HelloWorldWidget</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>124</width>
|
||||
<height>63</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>TextLabel2</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>OkButton</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright Felix E. Klee, 2003
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt
|
||||
# or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# Tell that QT should be used. QTDIR will give installation
|
||||
# prefix.
|
||||
using qt ;
|
||||
|
||||
project
|
||||
: default-build <threading>multi
|
||||
;
|
||||
|
||||
exe hello : main.cpp hello_world_widget.ui : <library>/qt//qt ;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright Felix E. Klee, 2003
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "hello_world_widget.h"
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <qpushbutton.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
QApplication a(argc, argv);
|
||||
HelloWorldWidget w;
|
||||
QObject::connect(static_cast<QObject*>(w.OkButton), SIGNAL(clicked()), &w, SLOT(close()));
|
||||
a.setMainWidget(&w);
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
// Copyright Vladimir Prus 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "arrow.h"
|
||||
|
||||
#include <QtGui/qapplication.h>
|
||||
|
||||
#include <QtGui/qwidget.h>
|
||||
#include <QtGui/qpainter.h>
|
||||
#include <QtGui/qpainterpath.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
Arrow_widget::Arrow_widget(QWidget* parent) : QWidget(parent), color_(0)
|
||||
{
|
||||
QPalette pal = palette();
|
||||
pal.setBrush(backgroundRole(), QBrush(Qt::white));
|
||||
setPalette(pal);
|
||||
}
|
||||
|
||||
void Arrow_widget::slotChangeColor()
|
||||
{
|
||||
color_ = (color_ + 1) % 3;
|
||||
update();
|
||||
}
|
||||
|
||||
void
|
||||
Arrow_widget::draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter)
|
||||
{
|
||||
// The length of the from the tip of the arrow to the point
|
||||
// where line starts.
|
||||
const int arrowhead_length = 16;
|
||||
|
||||
QPainterPath arrow;
|
||||
arrow.moveTo(x1, y1);
|
||||
|
||||
// Determine the angle of the straight line.
|
||||
double a1 = (x2-x1);
|
||||
double a2 = (y2-y1);
|
||||
double b1 = 1;
|
||||
double b2 = 0;
|
||||
|
||||
double straight_length = sqrt(a1*a1 + a2*a2);
|
||||
|
||||
double dot_product = a1*b1 + a2*b2;
|
||||
double cosine = dot_product/
|
||||
(sqrt(pow(a1, 2) + pow(a2, 2))*sqrt(b1 + b2));
|
||||
double angle = acos(cosine);
|
||||
if (y1 < y2)
|
||||
{
|
||||
angle = -angle;
|
||||
}
|
||||
double straight_angle = angle*180/M_PI;
|
||||
|
||||
double limit = 10;
|
||||
|
||||
double angle_to_vertical;
|
||||
if (fabs(straight_angle) < 90)
|
||||
angle_to_vertical = fabs(straight_angle);
|
||||
else if (straight_angle > 0)
|
||||
angle_to_vertical = 180-straight_angle;
|
||||
else
|
||||
angle_to_vertical = 180-(-straight_angle);
|
||||
|
||||
double angle_delta = 0;
|
||||
if (angle_to_vertical > limit)
|
||||
angle_delta = 30 * (angle_to_vertical - limit)/90;
|
||||
double start_angle = straight_angle > 0
|
||||
? straight_angle - angle_delta :
|
||||
straight_angle + angle_delta;
|
||||
|
||||
|
||||
QMatrix m1;
|
||||
m1.translate(x1, y1);
|
||||
m1.rotate(-start_angle);
|
||||
|
||||
double end_angle = straight_angle > 0
|
||||
? (straight_angle + 180 + angle_delta) :
|
||||
(straight_angle + 180 - angle_delta);
|
||||
|
||||
QMatrix m2;
|
||||
m2.reset();
|
||||
m2.translate(x2, y2);
|
||||
m2.rotate(-end_angle);
|
||||
|
||||
arrow.cubicTo(m1.map(QPointF(straight_length/2, 0)),
|
||||
m2.map(QPointF(straight_length/2, 0)),
|
||||
m2.map(QPointF(arrowhead_length, 0)));
|
||||
|
||||
painter.save();
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.drawPath(arrow);
|
||||
painter.restore();
|
||||
|
||||
painter.save();
|
||||
painter.translate(x2, y2);
|
||||
|
||||
painter.rotate(-90);
|
||||
painter.rotate(-end_angle);
|
||||
painter.rotate(180);
|
||||
|
||||
QPolygon arrowhead(4);
|
||||
arrowhead.setPoint(0, 0, 0);
|
||||
arrowhead.setPoint(1, arrowhead_length/3, -arrowhead_length*5/4);
|
||||
arrowhead.setPoint(2, 0, -arrowhead_length);
|
||||
arrowhead.setPoint(3, -arrowhead_length/3, -arrowhead_length*5/4);
|
||||
|
||||
painter.drawPolygon(arrowhead);
|
||||
|
||||
painter.restore();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Arrow_widget::paintEvent(QPaintEvent*)
|
||||
{
|
||||
QPainter p(this);
|
||||
|
||||
p.setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
int base_x = 550;
|
||||
int base_y = 200;
|
||||
|
||||
if (color_ == 0)
|
||||
p.setBrush(Qt::black);
|
||||
else if (color_ == 1)
|
||||
p.setBrush(Qt::green);
|
||||
else if (color_ == 2)
|
||||
p.setBrush(Qt::yellow);
|
||||
else
|
||||
p.setBrush(Qt::black);
|
||||
|
||||
for (int x_step = 0; x_step < 6; ++x_step)
|
||||
{
|
||||
for (int y_step = 1; y_step <= 3; ++y_step)
|
||||
{
|
||||
draw_arrow(base_x, base_y, base_x+x_step*100,
|
||||
base_y - y_step*50, p);
|
||||
|
||||
draw_arrow(base_x, base_y, base_x+x_step*100,
|
||||
base_y + y_step*50, p);
|
||||
|
||||
draw_arrow(base_x, base_y, base_x-x_step*100,
|
||||
base_y + y_step*50, p);
|
||||
|
||||
draw_arrow(base_x, base_y, base_x-x_step*100,
|
||||
base_y - y_step*50, p);
|
||||
}
|
||||
}
|
||||
|
||||
draw_arrow(50, 400, 1000, 450, p);
|
||||
draw_arrow(1000, 400, 50, 450, p);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// Copyright Vladimir Prus 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <QtGui/qapplication.h>
|
||||
|
||||
#include <QtGui/qwidget.h>
|
||||
#include <QtGui/qpainter.h>
|
||||
#include <QtGui/qpainterpath.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
class Arrow_widget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Arrow_widget(QWidget* parent = 0);
|
||||
|
||||
public slots:
|
||||
void slotChangeColor();
|
||||
|
||||
private:
|
||||
void draw_arrow(int x1, int y1, int x2, int y2, QPainter& painter);
|
||||
void paintEvent(QPaintEvent*);
|
||||
|
||||
private:
|
||||
int color_;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
import qt4 ;
|
||||
|
||||
if ! [ qt4.initialized ]
|
||||
{
|
||||
ECHO "Warning: Qt4 not initialized in user-config.jam" ;
|
||||
ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
|
||||
ECHO "This is very likely won't work for you. " ;
|
||||
using qt4 : /space/p2/ghost/build/Qt4 ;
|
||||
}
|
||||
|
||||
project : requirements <threading>multi ;
|
||||
|
||||
exe arrow : main.cpp arrow.cpp arrow.h /qt//QtGui ;
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright Vladimir Prus 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "arrow.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QTimer>
|
||||
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
QApplication app(ac, av);
|
||||
Arrow_widget* w = new Arrow_widget;
|
||||
w->resize(1100, 480);
|
||||
|
||||
QTimer timer;
|
||||
QObject::connect(&timer, SIGNAL(timeout()),
|
||||
w, SLOT(slotChangeColor()));
|
||||
|
||||
timer.start(2000);
|
||||
|
||||
w->show();
|
||||
app.exec();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
import qt4 ;
|
||||
if ! [ qt4.initialized ]
|
||||
{
|
||||
ECHO "Warning: Qt4 not initialized in user-config.jam" ;
|
||||
ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
|
||||
ECHO "This is very likely won't work for you. " ;
|
||||
using qt4 : /space/p2/ghost/build/Qt4 ;
|
||||
}
|
||||
|
||||
import cast ;
|
||||
exe main : main.cpp
|
||||
[ cast _ moccable-cpp : main.cpp ]
|
||||
/qt//QtGui
|
||||
: <threading>multi
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright Vladimir Prus 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class My_widget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
My_widget() : QWidget()
|
||||
{
|
||||
QPushButton* b = new QPushButton("Push me", this);
|
||||
|
||||
connect(b, SIGNAL(clicked()), this, SLOT(theSlot()));
|
||||
}
|
||||
|
||||
private slots:
|
||||
void theSlot()
|
||||
{
|
||||
std::cout << "Clicked\n";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
QApplication app(ac, av);
|
||||
My_widget mw;
|
||||
mw.show();
|
||||
app.exec();
|
||||
}
|
||||
|
||||
#include "main.moc"
|
||||
@@ -0,0 +1,55 @@
|
||||
<ui version="4.0" >
|
||||
<author></author>
|
||||
<comment>
|
||||
<!--
|
||||
Copyright Felix E. Klee, 2003
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt
|
||||
or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
</comment>
|
||||
<exportmacro></exportmacro>
|
||||
<class>HelloWorldWidget</class>
|
||||
<widget class="QWidget" name="HelloWorldWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>124</width>
|
||||
<height>63</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabel2" >
|
||||
<property name="text" >
|
||||
<string>Hello World!</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="OkButton" >
|
||||
<property name="text" >
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright Felix E. Klee, 2003
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt
|
||||
# or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import qt4 ;
|
||||
if ! [ qt4.initialized ]
|
||||
{
|
||||
ECHO "Warning: Qt4 not initialized in user-config.jam" ;
|
||||
ECHO "Assuming /space/p2/ghost/build/Qt4 as location." ;
|
||||
ECHO "This is very likely won't work for you. " ;
|
||||
using qt4 : /space/p2/ghost/build/Qt4 ;
|
||||
}
|
||||
|
||||
project : requirements <threading>multi
|
||||
;
|
||||
|
||||
exe hello : main.cpp hello_world_widget.ui : <library>/qt//QtGui ;
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright Felix E. Klee, 2003
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "ui_hello_world_widget.h"
|
||||
#include <qapplication.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
#include <qpushbutton.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QWidget w;
|
||||
Ui::HelloWorldWidget wm;
|
||||
wm.setupUi(&w);
|
||||
|
||||
QObject::connect(wm.OkButton, SIGNAL(clicked()), &w, SLOT(close()));
|
||||
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
# Copyright 2002, 2003 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Bye!\n";
|
||||
return EXIT_FAILURE
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Bye!\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# Copyright 2014 Rene Rivera
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
using testing ;
|
||||
|
||||
run success.cpp : : ;
|
||||
run-fail fail.cpp : : ;
|
||||
compile success.cpp : : success-compile ;
|
||||
compile-fail compile-fail.cpp ;
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2014 Rene Rivera
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hi!\n";
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import feature ;
|
||||
import toolset ;
|
||||
import os ;
|
||||
import testing ;
|
||||
|
||||
path-constant HERE : . ;
|
||||
make main.cpp : main_cpp.pro : @do-something ;
|
||||
time main.time : main.cpp ;
|
||||
|
||||
actions do-something
|
||||
{
|
||||
sleep 2 && echo "$(<)" > "$(<)"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
int main() {}
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
# This example shows performing configure checks in Boost.Build,
|
||||
# e.g. to check for some system function or compiler quirk.
|
||||
|
||||
# First, declare a metatarget that we'll try to build.
|
||||
obj foo : foo.cpp ;
|
||||
# Make it explicit so that it's only built if used by a configure check
|
||||
explicit foo ;
|
||||
|
||||
# Declare a target that depends on configure check result.
|
||||
exe main
|
||||
: main.cpp
|
||||
# The check-target-builds invocation in requirements section will
|
||||
# - build the specified metatarget
|
||||
# - if it builds OK, add the properties in the second parameter
|
||||
# - otherwise, add the properties in the third parameter
|
||||
: [ check-target-builds foo : <define>FOO=1 : <define>FOO=0 ]
|
||||
;
|
||||
|
||||
# To test this:
|
||||
#
|
||||
# 1. Build with "b2". You should see a "foo builds: yes" message, and running
|
||||
# the produced executable will show that FOO is set to 1.
|
||||
# 2. Modify foo.cpp to contain a compile error, rebuild with
|
||||
# "b2 -a --reconfigure". You should see a "foo builds: no" message, and running
|
||||
# the produced executable should show that FOO is now set to 0.
|
||||
#
|
||||
# The output from the check is not shown on the console, instead it is
|
||||
# redirected to the bin/config.log file
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
int foo()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Foo: " << FOO << "\n";
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
# Copyright 2003, 2005 Douglas Gregor
|
||||
# Copyright 2004 John Maddock
|
||||
# Copyright 2002, 2003, 2004, 2007 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# This file is used to configure your Boost.Build installation. You can modify
|
||||
# this file in place, or you can place it in a permanent location so that it
|
||||
# does not get overwritten should you get a new version of Boost.Build. See:
|
||||
#
|
||||
# http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
|
||||
#
|
||||
# for documentation about possible permanent locations.
|
||||
|
||||
# This file specifies which toolsets (C++ compilers), libraries, and other
|
||||
# tools are available. Often, you should be able to just uncomment existing
|
||||
# example lines and adjust them to taste. The complete list of supported tools,
|
||||
# and configuration instructions can be found at:
|
||||
#
|
||||
# http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html
|
||||
#
|
||||
|
||||
# This file uses Jam language syntax to describe available tools. Mostly,
|
||||
# there are 'using' lines, that contain the name of the used tools, and
|
||||
# parameters to pass to those tools -- where parameters are separated by
|
||||
# semicolons. Important syntax notes:
|
||||
#
|
||||
# - Both ':' and ';' must be separated from other tokens by whitespace
|
||||
# - The '\' symbol is a quote character, so when specifying Windows paths you
|
||||
# should use '/' or '\\' instead.
|
||||
#
|
||||
# More details about the syntax can be found at:
|
||||
#
|
||||
# http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language
|
||||
#
|
||||
|
||||
# ------------------
|
||||
# GCC configuration.
|
||||
# ------------------
|
||||
|
||||
# Configure gcc (default version).
|
||||
# using gcc ;
|
||||
|
||||
# Configure specific gcc version, giving alternative name to use.
|
||||
# using gcc : 3.2 : g++-3.2 ;
|
||||
|
||||
|
||||
# -------------------
|
||||
# MSVC configuration.
|
||||
# -------------------
|
||||
|
||||
# Configure msvc (default version, searched for in standard locations and PATH).
|
||||
# using msvc ;
|
||||
|
||||
# Configure specific msvc version (searched for in standard locations and PATH).
|
||||
# using msvc : 8.0 ;
|
||||
|
||||
|
||||
# ----------------------
|
||||
# Borland configuration.
|
||||
# ----------------------
|
||||
# using borland ;
|
||||
|
||||
|
||||
# ----------------------
|
||||
# STLPort configuration.
|
||||
# ----------------------
|
||||
|
||||
# Configure specifying location of STLPort headers. Libraries must be either
|
||||
# not needed or available to the compiler by default.
|
||||
# using stlport : : /usr/include/stlport ;
|
||||
|
||||
# Configure specifying location of both headers and libraries explicitly.
|
||||
# using stlport : : /usr/include/stlport /usr/lib ;
|
||||
|
||||
|
||||
# -----------------
|
||||
# QT configuration.
|
||||
# -----------------
|
||||
|
||||
# Configure assuming QTDIR gives the installation prefix.
|
||||
# using qt ;
|
||||
|
||||
# Configure with an explicit installation prefix.
|
||||
# using qt : /usr/opt/qt ;
|
||||
|
||||
# ---------------------
|
||||
# Python configuration.
|
||||
# ---------------------
|
||||
|
||||
# Configure specific Python version.
|
||||
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;
|
||||
@@ -0,0 +1,7 @@
|
||||
// Copyright Vladimir Prus 2004.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
void l();
|
||||
int main() { l(); return 0; }
|
||||
@@ -0,0 +1,11 @@
|
||||
# Copyright 2004 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
# By default, build the project with the two variants we have defined in
|
||||
# jamroot.jam.
|
||||
|
||||
project : default-build crazy super_release ;
|
||||
|
||||
exe a : a.cpp libs//l ;
|
||||
@@ -0,0 +1,14 @@
|
||||
# Copyright 2004 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
# Define a build variant which is just combination
|
||||
# of four properties.
|
||||
variant crazy : <optimization>speed <inlining>off
|
||||
<debug-symbols>on <profiling>on ;
|
||||
|
||||
# Define a built variant inherited from 'release'.
|
||||
# It defines one new property and get all properties
|
||||
# from parent variant.
|
||||
variant super_release : release : <define>USE_ASM ;
|
||||
@@ -0,0 +1,6 @@
|
||||
# Copyright 2004 Vladimir Prus
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
lib l : l.cpp ;
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright Vladimir Prus 2002-2004.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void l() {}
|
||||
@@ -0,0 +1,11 @@
|
||||
Copyright 2004 Vladimir Prus
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
This example shows how user can create his own build variants. Two variants are
|
||||
defined: "crazy", which is just a random combination of properties, and
|
||||
"super-release", which is inherited from "release", and differs by a single
|
||||
define.
|
||||
|
||||
See the jamroot.jam for the definitions.
|
||||
Reference in New Issue
Block a user