Hey Pau,

> While testing the Ubuntu/Debian packages, I've noticed in the examples
> files (for instance, localization XMLs) are opened assuming they are
> in the same folder the application binary is when it is started.

True. And many of them make the additional assumption that you have
'ln -s'ed the Wt's resources folder into the example's source
directory too.

> cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/
> -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples

Just curious, what does "wt;wthttp" do (versus "wthttp") ?

> Then you run make in /home/user/dev/wtexamples
>
> Now, if you want to run the charts example, you can either:
>
> - Run /home/user/dev/wtexamples/charts/charts.wt --docroot
> /usr/share/doc/witty-doc/examples/charts --http-port 10000 --http-addr
> 0.0.0.0
>
> - Or go into the /home/user/dev/wtexamples/charts directory, then run
> ./charts.wt --docroot /usr/share/doc/witty-doc/examples/charts
> --http-port 10000 --http-addr 0.0.0.0
>
> Either way, your XML files, CSS files, etc are not found because they
> are not opened taking the directory you specified with --docroot as
> the "." directory for open, std::istream, etc. The "." directory is
> the directory from where you run the binary (not even the directory
> the binary is in).

Would the following not work ?

$ cd usr/share/doc/witty-doc/examples/charts;
$ /home/user/dev/wtexamples/charts/charts.wt --docroot . --http-port
10000 --http-addr 0.0.0.0

> Am I wrong? Shouldn't "--docroot" be enforced? Or maybe something like
> BinReloc ( http://autopackage.org/docs/binreloc/ ) to use the
> directory where the binary is as the root? (I like docroot enforced
> better, FWIW)

I think docroot is enforced? At least, an empty value is not allowed.

I have a /etc/wt/wthttpd that reads like this:
docroot = .
http-address = 0.0.0.0
http-port = 8080

And in this way I can run all the examples without any arguments from
within their source directory. What exactly do you mean with
enforcing?

Regards,
koen

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to