Commit Graph
27 Commits
Author SHA1 Message Date
Markus Blatt 61b3a4618c [cmake] Do not use find_package in config mode for opm-parser.
Currently opm-parser does not create opm-parser-config.cmake files. Therefore
building with duncontrol fails as it sets opm-parser_DIR. With this patch
we force CMake to always use module mode for finding which fixes this.
2014-02-06 13:29:01 +01:00
Andreas Lauser 48751432a5 OpmFind.cmake: also check for CAPITALIZED found variables
thanks to @rolk for catching this
2013-12-16 09:34:59 +01:00
Andreas Lauser 92d1f463d9 OpmFind.cmake: prevent multiple calls to the same module in the same run
this prevents to check for the same module more than once in the same
cmake run and should thus speed things up a bit as well as make the
output a bit cleaner. For this I assumed that the ${name}_FOUND cmake
variable does not get cached, which it seems like it does not...
2013-12-15 17:56:37 +01:00
Roland Kaufmann d1020930db Don't search for disabled packages
Setting CMAKE_DISABLE_FIND_PACKAGE_xxx flag should make find_package
not doing anything, but this does not seem to work with older versions
of CMake. Anyway, we can test this flag and make sure that we don't
call find_package in that case.

Also includes a check for both upper- and same-case versions of found
flag, as some modules, most notably Boost, does not set the upper-case
version of their _FOUND flag; this tests for both.
2013-08-21 17:53:01 +02:00
Roland Kaufmann 2363a70d46 Only search for a package again if not found
If it is already found, most packages sets a flag that makes it exit
immediately anyway. We usually cannot rerun find_package to get another
combinations of modules. Here we check the flag before we start looking
for the package to avoid the endless stream of messages.
2013-08-16 21:56:08 +02:00
Bård Skaflestad c50b62fe5a Merge pull request #308 from rolk/308_agmg
Resurrect support for AGMG library

This is an interim milestone that may serve as point from which to 
resurrect the AGMG suppert fully if the AGMG author ever decides to 
re-release the software under an open licence.
2013-08-13 14:17:38 -07:00
Roland Kaufmann 50d4f5aa25 Allow packages to add source code to the project
By returning a ${package}_SOURCES variable with the names of the code,
it will be propagated to ${project}_SOURCES and subsequently compiled
into the library.

AGMG (Algebraic Multigrid) uses this functionality.
2013-08-07 00:08:43 +02:00
Roland Kaufmann 1e9d368012 Create a set of config variables for implementation
The config variables in _CONFIG_IMPL_VARS are only written to config.h
and not the .pc or -config.cmake files. They can thus only be used by
the implementation files and not the headers. Use this set to avoid
exposing the variables to other projects, when it is likely that a
probe used by that other project may turn up a different result.
2013-08-05 20:16:30 +02:00
Roland Kaufmann 56ff7975f0 Include possibility that uppercase is used 2013-05-16 13:26:33 +02:00
Roland Kaufmann 26475f448b Try singular name if plural not defined
In CMake "canon" (i.e. tutorial on Kitware's website) it is stated that
the _DIR suffix should be used for the directory of the library alone,
whereas _DIRS are entire list of paths necessary to compile (i.e.
dependencies are included).

Eigen3 only uses the singular form (since it doesn't have any
dependencies); it should really be copied to the plural form, but it may
be advantageous to have the find-module included unchanged, so we put in
an extra effort to find it here.
2013-05-16 10:58:24 +02:00
Roland Kaufmann 9d65dec0ac Provide suite info for those not in name convention 2013-04-03 10:16:54 +02:00
Roland Kaufmann 83fb758b74 Search for module in suite directory if specified
Instead of having to specify each and every project in a suite such as
DUNE or OPM, allow a root directory for the entire suite to be specified
and then assume that each module is located in a sub-directory to this.

Each individual project can still have its path explicitly specified, if
a special build of those are required.

The suite variable itself will be written to cache by being specified
on the command line. Each individual project directory will NOT be
written to cache, because then we cannot get rid of it by specifying a
new suite directory.
2013-04-03 10:16:53 +02:00
Roland Kaufmann 2b59d556f0 Use heuristics when finding rather than adjusting path
Commit b6cdc06b introduced heuristics to look in the parent directory
for header files alone, while leaving the path for binary files. This
is much better than adjusting the path because one does not potentially
confuse two build directories this way.
2013-03-20 11:30:44 +01:00
Roland Kaufmann b709645181 Don't search in system dir if explicit dir given
If we give an explicit directory path it is because we want a special
version to be used instead of the system version; if there is any
problems with that, we should know up-front instead of silently start
using the system version again!
2013-03-20 09:58:33 +01:00
Roland Kaufmann 5401df41b5 Use find modules for libraries with extra processing
Some libraries require more information than what is present in the
xxx-config.cmake file, e.g. the caller must know whether HAVE_TUPLE
is available and probably used when compiling dune-common, and put
this in its own config.h file.

Code to take care of these variables must therefore be in the client
configuration, and this is the same code which is used to handle the
autotools version, namely the find module, so a practical solution
is to just revert to that in both cases.
2013-03-17 21:03:00 +01:00
Roland Kaufmann 88b0740480 Bugfix expand variable definition 2013-03-15 12:23:57 +01:00
Roland Kaufmann 89be4e145a Bugfix change from macro to function
All variables we introduce which is not parameters are in fact global
variables that may be overwritten by recursive invocation!
2013-03-15 11:40:30 +01:00
Roland Kaufmann ce007fca7d Abstract into common version and parameterize 2013-03-15 10:57:53 +01:00
Roland Kaufmann 97c2fabe8e Search for uppercase variants of the package vars as well
For compatibility with packages that believes that every variable
should be in uppercase, we try this variant when adding relevant
variables to the project.
2013-03-15 01:23:59 +01:00
Roland Kaufmann a6a8170b50 Use keyword supported by older version of CMake
The CONFIG keyword to find_package () was introduced in 2.8.8 while
NO_MODULE works for the entire 2.8.x series.
2013-03-07 10:45:36 +01:00
Roland Kaufmann e75d69ef1d Use config mode if possible when finding packages 2013-03-05 22:29:20 +01:00
Roland Kaufmann 911bf9593f Do not duplicate handling of duplicate libraries
There were (at least) three implementations of the same macro; these
have been collected into a separate helper module. (Note that this
means that FindERT is now not completely stand-alone anymore).
2013-03-05 13:50:58 +01:00
Roland Kaufmann 7871a48551 Make sure HAVE_FOO is defined if foo_FOUND in CMake 2013-03-04 09:46:32 +01:00
Roland Kaufmann 9bd3f186d2 Do list cleanup in find routine
Although this amounts to some double work, it doesn't make the
configuration noticeably slower, and it ensures that the lists are
always cleaned up (in a proper way).
2013-02-11 22:37:55 +01:00
Roland Kaufmann e7d9abcd8e Allow directory to be set for config mode CMake files
If you run CMake with -Dfoo_DIR= pointing to a build tree, it should
now pick up the correct config mode module from there.
2013-02-11 22:37:55 +01:00
Roland Kaufmann 00b3f9431d Provide functions to find packages in batch
Dependencies can now be declared as a list and passed amongst modules
since CMake does not (easily) support passing anonymous functions.
2013-02-11 22:37:53 +01:00
Roland Kaufmann 0deeef0127 Rename macro modules
Modules that starts with the prefix "Use" alters the build to enable
something by default, whereas modules that only provide functionality
is not common to start with that prefix.
2013-02-11 22:37:53 +01:00