| Newsgroups |
gmane.comp.lang.ocaml.beginners |
| Message-ID |
<CAPFanBFdbo5scHcgwUsRbYfXOtCPrK906w9+R3CQsKQwj=_eZg@mail.gmail.com> |
I would try playing with the -build-dir command-line option of
ocamlbuild, to specify where you want to build output to be placed.
Admittedly most people use the default configuration of building in
./_build, so I wouldn't be too surprised if there were some rough
edges with the rarer case of a build directory outside the ocamlbuild
project's relative hierarchy.
If you had a minimum reproduction setting, an archive with a simple
root CMake project and a small ocamlbuild sub-project to play with,
that could be interesting for testing and documenting this usage
scenario.
On Tue, Sep 22, 2015 at 9:37 AM, Magnus Therning [email protected]
[ocaml_beginners] <[email protected]> wrote:
> On Thu, Sep 17, 2015 at 11:59:25PM +0200, Gabriel Scherer [email protected] [ocaml_beginners] wrote:
>> >
>> > So far I've simply run `corebuild` (a simple wrapper around
>> > `ocamlbuild`), but that leaves some build stuff in the source folder
>> > (that sort of breaks with CMake's tradition of building
>> > out-of-source).
>>
>>
>> I'm fairly surprised by this, as ocamlbuild takes care to produce all
>> target outputs in a separate folder (the _build subdirectory). Could
>> you say more about what you are doing, what happens and what you
>> expect?
>
> Don't be surprised, I'm being unclear!
>
> This is what I mean: it won't let me decide where to build.
>
> I have a large-ish C/C++ project that uses CMake to build. In a
> sub-subfolder I have put the OCaml source for a test utility
> (`src/utils/tool/`). Following CMake best practices I create a build
> folder at the top of the project and run `cmake ..` in it to generate
> make files. This is what I need to hook into. CMake has support for
> what they call external projects[1], which is how I hook in the OCaml
> building. However, I haven't found any way of controlling where the
> build artefacts end up, `corebuild` puts all stuff in
> `src/utils/tool/_build/` whereas I want it somewhere under `_build` (to
> follow the CMake example I want it in `_build/src/utils/tool`).
>
> In short:
>
> 1. I run builds in `_build`
> 2. I want all built artefacts to end up under `_build`
> 3. I haven't found a way to make `ocamlbuild` build in that way
>
> /M
>
> [1]: http://www.cmake.org/cmake/help/v3.3/module/ExternalProject.html
>
> --
> Magnus Therning OpenPGP: 0xAB4DFBA4
> email: [email protected] jabber: [email protected]
> twitter: magthe http://therning.org/magnus
>
> Time is a great teacher, but unfortunately it kills all its pupils.
> -- Hector Louis Berlioz
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
> Posted by: Magnus Therning <[email protected]>
> ------------------------------------
>
> Archives up to December 31, 2011 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners
> The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames etc.
> ------------------------------------
>
> Yahoo Groups Links
>
>
>