Commit Graph

11804 Commits

Author SHA1 Message Date
Joakim Hove
02c410e9af Merge pull request #39 from rolk/039_src
Extract source location from cache in build tree
2013-10-28 02:06:18 -07:00
Joakim Hove
e1088eee71 Merge remote-tracking branch 'upstream/master' into test-compile-time-polymorphism 2013-10-28 10:02:21 +01:00
Joakim Hove
8b7c27fa17 Merge pull request #37 from rolk/037_virt
Change unintended compile-time polymorphism to dynamic
2013-10-28 02:01:07 -07:00
Joakim Hove
91704558a6 Added test for compile time polymorphism 2013-10-28 10:00:40 +01:00
Joakim Hove
039f6ea4cf Merge pull request #36 from joakim-hove/cmake-package-config
Cmake package config
2013-10-28 01:00:03 -07:00
Joakim Hove
4b94800073 Added some Eclipse project files to .gitignore 2013-10-25 17:34:08 +02:00
Joakim Hove
76a9cbb0b8 Updated test to check a return value 2013-10-25 17:31:48 +02:00
Joakim Hove
77cc1fd03b Added Integration test to build TimeMap from Deck 2013-10-25 17:30:16 +02:00
Joakim Hove
d511d2ee2d Added Schedule class 2013-10-25 17:28:56 +02:00
Joakim Hove
488782d8c5 TimeMap class can now be constructed from an Eclipse DECK 2013-10-25 17:26:37 +02:00
Joakim Hove
51d16d24da Added install to .gitignore 2013-10-25 16:48:57 +02:00
Joakim Hove
14b8759b7e Removed not-used ParserItemTemplate.hpp from install targets 2013-10-24 15:51:38 +02:00
Joakim Hove
1efadb4af2 Merge remote-tracking branch 'upstream/master' into time-map 2013-10-24 15:25:43 +02:00
Roland Kaufmann
e8e8d1c21e Extract source location from cache in build tree
If opm-parser_ROOT is given, this should point to a build tree. The
only way to extract the corresponding source directory is to parse
the build cache located there.
2013-10-24 09:40:36 +02:00
Joakim Hove
53ef54225a Merge remote-tracking branch 'upstream/master' 2013-10-24 09:38:57 +02:00
Joakim Hove
54d94d7634 Parser->addKeyword() will erase first; NOW the ReplaceKeyword works 2013-10-24 09:38:03 +02:00
Joakim Hove
f303c09690 Parser->addKeyword() will erase first; NOW the ReplaceKeyword works 2013-10-24 09:37:14 +02:00
Joakim Hove
29a168ee52 Merge pull request #38 from rolk/038_cmake
Allow directory root to be specified as the rest of the OPM modules
2013-10-24 00:22:33 -07:00
Joakim Hove
113d488242 Merge pull request #33 from rolk/033_bld
Support more build configurations
2013-10-24 00:01:05 -07:00
Roland Kaufmann
940f31295b Test for all the required header directories 2013-10-23 22:40:45 +02:00
Roland Kaufmann
7e9c45b765 Allow package to be specified as required
Although CMake prefers the uppercase variant variables, and the
find_package_handle_standard_args will convert to them for us, the
part that parses REQUIRED and QUIET arguments to find_package still
only uses the package name verbatim (sic).
2013-10-23 22:40:45 +02:00
Roland Kaufmann
bb4fffc227 Don't search relative directories if root is given
The PATHS that are specified is always searched, also if NO_DEFAULT_PATH
is given.
2013-10-23 22:40:45 +02:00
Roland Kaufmann
8ac1062968 Allow lowercase variables for specifying project root 2013-10-23 22:40:45 +02:00
Roland Kaufmann
b1f6e665c1 Search for headers relative to project root
The find module may be called from a CMakeLists.txt in a subdirectory,
and it would start the search from there.
2013-10-23 22:40:45 +02:00
Roland Kaufmann
f8c6bfbaf2 Change unintended compile-time polymorphism to dynamic
equals(ParserIntItem&) has a different signature than equals(ParserItem&),
thus the former method does *not* overload the latter. Virtual just means
then only means that you have created a *new* entry in the v-table. If
you call equals through a pointer/reference to the base class ParserItem,
the defined method in the derived class is not called, and we miss out the
test for the equal default value.

Instead, we should take an argument of the base type and use a dynamic
cast to the derived type. If this downcast fails, then they are not equal;
otherwise we have gotten ourselves a pointer to get the properly typed
default value.

We must use pointers instead of references; if we cast to a reference,
a bad_cast exception is thrown if the expression is not in the proper
type hierarchy.
2013-10-23 20:54:56 +02:00
Joakim Hove
dd0676126e Merge remote-tracking branch 'upstream/master' into time-map 2013-10-23 18:15:43 +02:00
Joakim Hove
f6aa9af881 Added install-headers function + opm-parser-prereqs.cmake 2013-10-23 18:12:35 +02:00
Joakim Hove
987d5c4a71 Changed Findcjson.cmake to use OPM_PARSER_ROOT as prefix - if CJSON_ROOT has not been set 2013-10-23 17:56:35 +02:00
Joakim Hove
0b3a4d64ec Merge branch 'master' into cmake-package-config 2013-10-23 17:23:46 +02:00
Joakim Hove
069cd2b8c9 Merge pull request #35 from rolk/035_cmake
Provide find module for OPM Parser library
2013-10-23 07:48:29 -07:00
Roland Kaufmann
173df1f166 Include standard CMake module to get error handling 2013-10-23 14:34:25 +02:00
Roland Kaufmann
8642f5e253 Include standard CMake module to get error handling 2013-10-23 14:32:40 +02:00
Roland Kaufmann
c698136b51 Define uppercase version of found-variable
It doesn't really matter here because "cjson" is only letters, but as
a general rule we define the uppercase variant ourselves so that CMake
doesn't use its own (bizarre) case rules, and then set the lower case
explicitly afterwards.
2013-10-23 11:37:16 +02:00
Roland Kaufmann
0cbed21e5a Define uppercase variant when testing for existence
CMake will do some uppercasing of its own (defining OPM-PARSER_FOUND)
so it works best if we specify the correct uppercase version and sets
the lowercase afterwards.
2013-10-23 11:35:19 +02:00
Roland Kaufmann
e823803474 Provide find module for OPM Parser library
Searches for headers and objects of the library as well as finding
the prerequisites (Boost and CJSON) necessary to link a program.
2013-10-23 11:12:35 +02:00
Roland Kaufmann
d537acf16f Correct documentation typo 2013-10-23 11:06:13 +02:00
Roland Kaufmann
9f8ac9a963 Set plural form of header dir. var.
Even though we only look for one directory, the convention is to always
have the full set of prerequisites in the plural form.
2013-10-23 11:05:22 +02:00
Roland Kaufmann
47934fd678 Look in lib64/ for x86_64 libs on RHEL(-like) distro 2013-10-23 10:44:35 +02:00
Roland Kaufmann
9d4cd49427 Use math library as a prerequisite (on Linux)
It is needed for pow() and floor() functions.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
2b52adadf2 Search for build tree relative to this project
The CMake script is run in the source tree. We assume a certain
directory layout and that the cjson is available in a sibling
directory of this project. Thus, we can pick up a build tree without
having the library installed.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
9663d187a7 Search for library in proper build directory
The library will end up in the opm/json library in a build tree; we
want to be able to point the CJSON_ROOT variable to the root of the
build tree and have it pick up the libraries from there.
2013-10-23 10:22:50 +02:00
Roland Kaufmann
1b4a71bdfb Raise error if module is required but not found
Otherwise the error will just be silently ignored.
2013-10-23 10:22:49 +02:00
Roland Kaufmann
781ef04a0e Compare size with unsigned int literal
Surprisingly, some compilers (notably GCC 4.6.3) will issue a warning
when comparing a literal which is clearly positive to an unsigned type,
when looking for a suitable instantiation in Boost. This is fixed by
making the literal unsigned too, so there's no doubt.
2013-10-22 23:39:49 +02:00
Roland Kaufmann
0a69727bf7 Add missing header for function used inline in class 2013-10-22 22:38:08 +02:00
Joakim Hove
8cc555c5ac Added basic functionality to assemble a timeMap 2013-10-22 17:11:33 +02:00
Joakim Hove
79aaa900c9 Moved enable_language( C ) to top level CMakeLists.txt 2013-10-22 14:38:16 +02:00
Joakim Hove
2a09a6b2c1 Added (empty) TimeMap class 2013-10-22 14:24:31 +02:00
Joakim Hove
803304d5f8 Deck->keywordContainer will set deckIndex of DeckKeyword when inserting: Have relaxed const properties of DeckKeyword 2013-10-22 11:42:15 +02:00
Joakim Hove
0598e9122a Added deckIndex property to deckKeyword 2013-10-22 11:40:45 +02:00
Joakim Hove
63fb47515b Relaxed internalParseLarge test 2013-10-22 10:48:39 +02:00