On 2013-02-28 11:13, Atgeirr Rasmussen wrote:
I want to be able to specify where to find any module in some way.
In the autotools world, this is usually done with
--with-somelib=location configure arguments being handled by the
find macros. I do not know what is the cmake way.
The CMake way is quite similar; say you want to specify a custom Boost
installation; then you give -DBOOST_ROOT=/path/to/boost on the command-line.
This nice principle is somewhat obfuscated by the fact that inconsistent
conventions have been accepted into the modules; which case the variable
names should be in, and whether the suffix should be _ROOT or _PREFIX.
If you run ./configure with the same options that you used to earlier,
it will print out which variables that are being set in the beginning.
Only if no such variable is specified does the build module start to
wander about and look for sibling directories.
Let me give an example of how I have organized the directory structure
myself:
~ / opm / src / opm-core
/ dune-cornerpoint
/ ert
/ you-got-the-idea
/ bld / opm-core
/ dune-cornerpoint
/ ert
/ and-so-forth
i.e. I have a source tree which looks like the organization on GitHub,
and then a separate build tree which mirrors this organization, but
separately.
Another way to do this with autotools is to add 'CPPFLAGS +=
-I/location/of/includes' (and similar for libs) to the configure
call. This is more primitive, but in practice works well. How can I
do something like this in cmake?
This should be possible, as CMake should pick up those environment
variables, but I haven't even tested it.
How should I make a 'meta-project' that includes every one of these
modules as subprojects? The ease of doing this is supposed to be one
of the strengths of cmake, and it should render the detection issue
above void, right?
I'll come back to this one later.
Switching to listing all files to compile (as previously discussed)
is not done yet.
This is in progress on opm-core (issue #165); will transfer to the other
projects afterwards since they are more or less copies of that build
system (minus a header that specifies names etc.)
--
Roland.
_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm