On Wed, Sep 23, 2015 at 10:38:31AM +0200, Gabriel Scherer wrote: > Thanks for the reproducible information. I just tried and could > reproduce the issue. > > The problem comes from the fact that, with the command-line invocation > you use oasis generates the build description files (_tags, > myocamlbuild.ml, setup.data) in the build directory, not in the source > directory, but ocamlbuild when invoked (from the source directory) > will look for them in the source directory. In particular, I could > "fix" the build by doing Indeed, the goal is to not contaminate the source directory *at all*. > ... > ocaml setup.ml -C $PWD/../oasis-camlp4 -configure > for f in {myocamlbuild.ml,_tags,setup.data}; do ln -s $PWD/$f > ../oasis-camlp4; done > ocaml setup.ml -C $PWD/../oasis-camlp4 -build -build-dir $PWD/build > > It looks like oasis's behavior with "-C $DIR -configure" is > problematic: it should generate its files in $DIR -- except maybe > setup.ml, or then people would have to run (ocaml $DIR/setup.ml -C > $DIR ...). I've been playing around a bit with the various combinations of where I run `ocaml /setup.ml` and `-C`. Since the steps work on "simple" code, but doesn't on code using `camlp4` I'm leaning towards calling this a bug. > TL;DR: this appear to be an oasis issue, rather than a issue with > CMake or ocamlbuild. Yes, I'm guessing it's an issue in the code generated by `oasis` and how it uses `ocamlbuild` and other build tools. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus@therning.org jabber: magnus@therning.org twitter: magthe http://therning.org/magnus The man who is denied the opportunity of taking decisions of importance begins to regard as important the decisions he is allowed to take. -- C Northcote Parkinson