Commit Graph

36 Commits

Author SHA1 Message Date
Arne Morten Kvarving
6465cfe1ea changed: drop gcc7 compatibility
this means getting rid of the Opm::filesystem namespace
and directly using std::filesystem, as well as dropping
some of the compat code for the tr filesystem.

we still need the FileSystem.hpp/cpp files though as unique_path
is not part of std::filesystem.
2021-11-01 12:36:42 +01:00
Joakim Hove
747fd8f897 Add build and write functionality to Json object 2020-08-10 09:41:51 +02:00
Arne Morten Kvarving
fb75bcd4e2 changed: use std::filesystem instead of boost::filesystem
since we still support g++-7, where filesystem is marked experimental,
we introduce a wrapper header and expose the namespace to use
as Opm::filesystem.

for gcc we unconditionally link with libstdc++fs in the python bindings.
the setup.py stuff links as c code, not c++ code, so it is not
automatically added on any gcc version. this might prove unportable
later.
2020-02-13 12:34:19 +01:00
Jørgen Kvalsvik
c138e817bb Include boost/filesystem/path.hpp in JsonObject 2017-06-01 15:29:23 +02:00
Jørgen Kvalsvik
e884b0664c Redesign cmake
Tune the makefile according to new principles, which adds a few bells
and whistles and for clarity.

Synopsis:

* The dependency on opm-common is completely gone. This is reflected in
  travis and appveyor as well. No non-kitware cmake modules are used.
* Directories are flattened, quite a bit - source code is located in the
  lib/ directory if it belongs to opm-parser, and external/ if third
  party.
* The sibling build feature is implemented through cmake's
  export(PACKAGE) rather than implicitly looking through source files.
* Targets explicitly set required public and private include
  directories, compile options and definitions, which cmake will handle
  and propagate
* opm-parser-config.cmake for downstream users is now provided.
* Dependencies are set up using targets. In the future, when cmake 3.x+
  can be used, these should be either targets from newer Find modules,
  or interface libraries.
* Fewer system specific assumptions are coded in, instead we assume
  cmake or users set up system specific details.
* All module wide configuration and looking up libraries is handled in
  the root makefile - all sub directories only set up libraries and
  compile options for the module in question.
* Targets are defined and links handled transitively because cmake now
  is told about them. ${module_LIBRARIES} variables are gone.

This is largely guided by the principles outlined in
https://rix0r.nl/blog/2015/08/13/cmake-guide/

Most source files are just moved - if they have some content change then
it's nothing more than include fixes or similar in order to make them
compile.
2017-06-01 15:29:23 +02:00
Markus Blatt
e20f521151 Support externally installed cJSON.
Using an external cJSON installed under /usr/include was not possible before
as the cJSON headers within opm were still used due to relative paths.
With this commit move the copied cJSON source to external/cjson and
thus prevent them to be found if an externally installed cJSON is there.
2016-11-02 20:10:35 +01:00
Magne Sjaastad
4186ce5a11 VS2015: Test for MSVC when guarding compiler flags 2016-05-25 10:39:19 +02:00
Jørgen Kvalsvik
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Arne Morten Kvarving
1d3b35c426 added/fixed: set soversion for libraries 2015-10-19 13:34:19 +02:00
Joakim Hove
8756435766 Added JsonObject::to_string() - removed content. 2015-06-05 14:26:35 +02:00
Arne Morten Kvarving
4ed965bf55 changed: rename opm-json opmjson for consistency 2015-05-26 13:53:54 +02:00
Arne Morten Kvarving
9e96127705 change how tests are added in the build system
- use a opm-macro to reduce code duplication
- add a 'test-suite' target which builds tests. for use if BUILD_TESTING
  is 0.
- add a 'check' target which builds tests, then executes them
2015-05-26 13:07:44 +02:00
Joakim Hove
19c29ff6df Added BUILD_TESTING() guard 2014-12-15 17:36:10 +01:00
Andreas Lauser
ea38a25af4 remove all trailing white space
this is just the result of

```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f |  xargs sed -i "s/ *$//"
```

so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
2014-12-08 16:34:28 +01:00
Arne Morten Kvarving
51de1faa85 fixed: compile cjson object into libopm-json
i see no reason to keep the separate library and this circumvents
shared vs static linking issues.

an alternative fix is to fix the opm buildsystems to prioritize config
mode. that would be more involved.
2014-11-18 13:19:25 +01:00
Arne Morten Kvarving
303b9bc885 changed: cjson handling
- probe only for system lib (i.e. only probe in prefix paths)
old code ended up not installing the json lib due to finding a copy
in the build folder if a reconfiguration was performed.

- build internal copy static and bundle in libopm-json.so
no reason to install this as a shared library. if it is updated
originating from opm, the entire parser library is updated anyways.
2014-11-18 10:27:03 +01:00
Arne Morten Kvarving
a42b503bac fixed: properly encapsulate cjson 2014-11-18 10:27:03 +01:00
Andreas Lauser
c2329b72ba add a few missing includes
these includes are required by the headers. If the affected files
would have been included without the headers included before, a
compiler error would have been produced.
2014-08-25 14:07:28 +02:00
Atgeirr Flø Rasmussen
41ddb2c460 Rename local variable to avoid shadowing. 2014-04-15 09:26:25 +02:00
atleh
0505c0a9ca createDefaultKeywordList now able to generate dump file. 2014-04-04 12:02:40 +02:00
Arne Morten Kvarving
4a9c18ac9f run tests through valgrind 2014-01-27 15:16:34 +01:00
Andreas Lauser
a1ae9ff6b5 add a few 'explicit' statements
this allows to constructs like

ParserIntItem("NRPVT");

which IMHO is more readable than the previous way, i.e.,

ParserIntItem(std::string("NRPVT"));
2013-12-19 15:39:47 +01:00
Andreas Lauser
8535ecdce3 do not force the use of static boost libraries if the ENABLE_SHARED variable is undefined
we only want to force the use of shared libraries if ENABLE_SHARED is
set to true. if it is unset, we don't care.
2013-12-10 17:26:14 +01:00
Joakim Hove
79aaa900c9 Moved enable_language( C ) to top level CMakeLists.txt 2013-10-22 14:38:16 +02:00
Joakim Hove
2e3caa9be3 Changed include path to cJSON 2013-10-21 17:12:36 +02:00
Joakim Hove
7bbeffc017 Removed CJSON check to top level CMakeLists.txt file 2013-10-21 17:12:01 +02:00
Joakim Hove
71dd19d11c Added cmake machinery to find cjson library; and build bundled version if find_package(cjson) fails. 2013-08-29 12:05:18 +02:00
Joakim Hove
467846c20d Added install targets in json/CMakeLists.txt 2013-08-28 16:50:30 +02:00
Joakim Hove
6d407ba73d Added as_double() acces to JsonObject 2013-08-01 09:26:21 +02:00
Joakim Hove
6ecad6b4e8 Improvements to JsonObject 2013-07-31 11:28:07 +02:00
Joakim Hove
d8a74a1d3d Typo in working directory of tests 2013-07-31 08:30:03 +02:00
Joakim Hove
269686a2f5 Extended the JsonObject() class 2013-07-30 14:08:42 +02:00
Joakim Hove
66cbb1a5cb Added Boost_LIBARIES to opm-json link target 2013-07-30 14:07:57 +02:00
Joakim Hove
c829bf0b66 Added (const char * inline_json) constructor 2013-07-30 09:21:54 +02:00
Joakim Hove
42e7333392 Added JsonObject as thin wrapper around the cJSON source 2013-07-29 21:55:57 +02:00
Joakim Hove
bf73449736 Added external files for cjson 2013-07-29 21:50:29 +02:00