Skip to content

Commit c321a77

Browse files
committed
Update to 4.6 (global_context) all tests **passed** and all examples are compiled with success on Windows 8.1 (VC 2012)
On 0.4.6 Boost.Singularity is not needed anymore. Some fixes on: - ensure_single_instance.hpp - launch.hpp - ensure_single_instance_test.cpp Now we are working on some improvements on interface. Thanks to Benjamin Dieckmann for global_context implementation!
1 parent 1d54843 commit c321a77

File tree

49 files changed

+226
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+226
-508
lines changed

Jamfile.v2

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright Rene Rivera 2007.
2+
#
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# (See accompanying file LICENSE_1_0.txt or copy at
5+
# http://www.boost.org/LICENSE_1_0.txt)
6+
7+
# Usage:
8+
#
9+
# bjam [options | properties | targets]
10+
#
11+
# Options:
12+
#
13+
# --boost=<BOOST> The directotory of a Boost source tree.
14+
# Default; BOOST env var (if found)
15+
# Default; ../boost (if found)
16+
#
17+
# --boost-build=<BOOST_BUILD>
18+
# The directory for the Boost.Build v2 files.
19+
# Default; BOOST_BUILD_PATH env var (if found)
20+
# Default; BOOST_BUILD env var (if found)
21+
# Default; <BOOST>/tools/build/v2 (if found)
22+
23+
#~ If we have the Boost sources we can use the project...
24+
25+
if [ GLOB $(BOOST) : [ modules.peek project : JAMFILE ] ]
26+
{
27+
use-project C:\\boost_1_54_0 : $(BOOST) ;
28+
}

Jamroot.jam

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
import modules ;
3+
4+
local boost = [ modules.peek : BOOST ] ;
5+
6+
project sandbox : requirements <include>$(boost) ;
7+
8+
# This seems to prevent some Boost.Build errors that otherwise occur :-(
9+
use-project C:\\boost_1_54_0 : $(boost) ;

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ contact: [email protected]
1111

1212
A special thanks to Vicente J. Botet Escriba that helped a lot on all areas of this lib.
1313

14+
Thanks to Benjamin Dieckmann for global_context implementation.
15+
1416
###On-line Documentation (Work in Progress)
1517

1618
[Online Docs] (http://www.dokfile.com/appbeta4/docs/libs/application/doc/html/index.html)
@@ -33,3 +35,4 @@ Building: Detailed instructions can be found [here] (https://svn.boost.org/trac/
3335
### Questions, suggestions or bugs, please send an email to:
3436

3537
[email protected] (Renato Tegon Forti)
38+

boost-build.jam

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright Rene Rivera 2007.
2+
#
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# (See accompanying file LICENSE_1_0.txt or copy at
5+
# http://www.boost.org/LICENSE_1_0.txt)
6+
7+
# For instructions see Jamfile.v2, or "bjam --help".
8+
9+
local rule if-has-file ( file + : dir * )
10+
{
11+
local result ;
12+
if $(dir)
13+
{
14+
result = [ GLOB $(dir) : $(file) ] ;
15+
}
16+
return $(result[1]:P) ;
17+
}
18+
19+
#~ Attempts to find the Boost source tree...
20+
21+
local boost-src = [ if-has-file LICENSE_1_0.txt :
22+
[ MATCH --boost=(.*) : $(ARGV) ]
23+
$(BOOST)
24+
$(.boost-build-file:D)/../boost
25+
$(.boost-build-file:D)/../Trunk
26+
] ;
27+
28+
# error handling:
29+
if ! $(boost-src)
30+
{
31+
ECHO Unable to find the Boost source tree in the locations searched. ;
32+
ECHO Try setting the environment variable BOOST to point to your ;
33+
ECHO Boost tree, or else invoke bjam with the --boost=path option. ;
34+
ECHO The Boost include path will not be automatically set. ;
35+
ECHO The paths searched were [ MATCH --boost=(.*) : $(ARGV) ] $(BOOST) $(.boost-build-file:D)/../boost $(.boost-build-file:D)/../Trunk ;
36+
ECHO But the file LICENSE_1_0.txt was not found in any of them ;
37+
}
38+
39+
#~ Attempts to find the Boost.Build files...
40+
41+
local boost-build-src = [ if-has-file bootstrap.jam :
42+
[ MATCH --boost-build=(.*) : $(ARGV) ]
43+
$(BOOST_BUILD_PATH)
44+
$(BOOST_BUILD)
45+
$(boost-src)/tools/build/v2
46+
] ;
47+
48+
# error handling:
49+
if ! $(boost-build-src)
50+
{
51+
ECHO Unable to find the Boost.Build source tree in the locations searched. ;
52+
ECHO Try setting the environment variable BOOST_BUILD to point to your ;
53+
ECHO Boost.Build tree, or else invoke bjam with the --boost-build=path option. ;
54+
ECHO The paths searched were [ MATCH --boost-build=(.*) : $(ARGV) ] $(BOOST_BUILD_PATH) $(BOOST_BUILD) $(boost-src)/tools/build/v2 ;
55+
ECHO But bootstrap.jam was not found in any of these ;
56+
ECHO More failures will very likely follow... ;
57+
}
58+
59+
#~ Set some common vars to refer to the Boost sources...
60+
61+
BOOST ?= $(boost-src) ;
62+
BOOST_ROOT ?= $(boost-src) ;
63+
64+
#~ And load up Boost.Build...
65+
66+
boost-build $(boost-build-src) ;
67+
68+
69+
70+

example/limit_single_instance_callback_with_global_context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
110110
*/
111111

112112
// way 2
113-
this_application().insert<limit_single_instance>(
113+
this_application()->insert<limit_single_instance>(
114114
boost::make_shared<limit_single_instance_default_behaviour>(appuuid,
115115
make_singleton_callback<bool>(app, &myapp::instace_aready_running)));
116116

example/service_setup.cpp

Lines changed: 0 additions & 163 deletions
This file was deleted.

example/setup/windows/setup.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333

3434
#define BOOST_APPLICATION_FEATURE_NS_SELECT_BOOST
3535

36-
#include <boost\application.hpp>
37-
#include <boost\program_options.hpp>
36+
#include <boost/application.hpp>
37+
#include <boost/program_options.hpp>
3838

3939
#include "setup/service_setup.hpp"
4040

4141
using namespace boost;
42+
4243
namespace po = program_options;
4344

4445
//[wss
@@ -82,7 +83,7 @@ class windows_service_setup
8283
if (vm.count("-i"))
8384
{
8485
std::string s = vm["name"].as<std::string>();
85-
application::install_windows_service(
86+
application::example::install_windows_service(
8687
application::setup_arg(vm["name"].as<std::string>()),
8788
application::setup_arg(vm["display"].as<std::string>()),
8889
application::setup_arg(vm["description"].as<std::string>()),
@@ -98,7 +99,7 @@ class windows_service_setup
9899
if (vm.count("-c"))
99100
{
100101
bool exist =
101-
application::check_windows_service(
102+
application::example::check_windows_service(
102103
application::setup_arg(vm["name"].as<std::string>())).exist(ec);
103104

104105
if(ec)
@@ -124,7 +125,7 @@ class windows_service_setup
124125

125126
if (vm.count("-u"))
126127
{
127-
application::uninstall_windows_service(
128+
application::example::uninstall_windows_service(
128129
application::setup_arg(vm["name"].as<std::string>()),
129130
application::setup_arg(vm["path"].as<std::string>())).uninstall(ec);
130131

example/setup/windows/setup/service_setup.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <boost/filesystem/path.hpp>
2424
#include <boost/filesystem/operations.hpp>
2525

26-
namespace boost { namespace application {
26+
namespace boost { namespace application { namespace example {
2727

2828
// util class to open/close the SCM on current machine
2929
class windows_scm : noncopyable
@@ -525,7 +525,7 @@ namespace boost { namespace application {
525525
typedef install_windows_service_<character_types::char_type> install_windows_service;
526526
// wchar_t / char
527527

528-
}} // boost::application
528+
}}} // boost::application::example
529529

530530
#endif // BOOST_APPLICATION_IMPL_WINDOWS_SERVICE_SETUP_HPP
531531

example/setup/windows/work_in_progress.txt

Whitespace-only changes.

example/simple_server_application.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@
5454
#include <boost/program_options.hpp>
5555
#include <boost/application.hpp>
5656

57+
// provide setup example for windows service
58+
#if defined(BOOST_WINDOWS_API)
59+
# include "setup/windows/setup/service_setup.hpp"
60+
#endif
61+
5762
namespace po = boost::program_options;
5863
using namespace boost;
5964

@@ -192,7 +197,7 @@ bool setup(application::context& context)
192197

193198
if (vm.count("-i"))
194199
{
195-
application::install_windows_service(
200+
application::example::install_windows_service(
196201
application::setup_arg(vm["name"].as<std::string>()),
197202
application::setup_arg(vm["display"].as<std::string>()),
198203
application::setup_arg(vm["description"].as<std::string>()),
@@ -205,7 +210,7 @@ bool setup(application::context& context)
205210

206211
if (vm.count("-u"))
207212
{
208-
application::uninstall_windows_service(
213+
application::example::uninstall_windows_service(
209214
application::setup_arg(vm["name"].as<std::string>()),
210215
application::setup_arg(executable_path_name)).uninstall(ec);
211216

0 commit comments

Comments
 (0)