Commit Graph

11 Commits

Author SHA1 Message Date
Kirill A. Korinsky
40920f3ec3
Prevent creating malformed version
Let assume that I run a cmake with option `-DNETGEN_VERSION_GIT="v6.2.2204"` (or without this option at all) to avoid calling `git` which won't work when I've downloaded sources from GitHub as `.zip` file.

If I try to compile sources and run it, it fails with error like:
```
libc++abi: terminating with uncaught exception of type std::invalid_argument: stoi: no conversion
``` 
after some digging I've discovered that `netgen_version.hpp` looks like:
```
#ifndef NETGEN_VERSION_HPP_INCLUDED
#define NETGEN_VERSION_HPP_INCLUDED
#define NETGEN_VERSION "6.2.0-v6.2.0.0-v6.2.0.0"
#define NETGEN_VERSION_MAJOR 6
#define NETGEN_VERSION_MINOR 2
#define NETGEN_VERSION_PATCH 0
#define NETGEN_VERSION_TWEAK v6.2.0.0
#define NETGEN_VERSION_HASH "v6.2.0.0"
#endif // NETGEN_VERSION_HPP_INCLUDED
```

This is happened because `string(REGEX REPLACE` copied original string to target and replaces it by regex. If regex doesn't match => it still copied an original value.

So, this commit prevented this mess from happened.
2022-12-07 02:55:27 +01:00
mhochsteger@cerbsim.com
4f4a3f7c92 generate version.py with cmake 2022-02-04 18:01:46 +01:00
mhochsteger@cerbsim.com
0d4028ea7a cmake - strip version string 2021-11-08 11:02:12 +01:00
mhochsteger@cerbsim.com
1cf9e3ff02 version handling, generate python configuration file 2021-10-28 13:57:24 +02:00
mhochsteger@cerbsim.com
d9e8b815f5 pip installer 2021-10-27 16:51:41 +02:00
Matthias Hochsteger
cb610b9b04 NETGEN_CHECK_RANGE -> NETGEN_USE_CHECK_RANGE in netgen_config.hpp (macro name already used) 2020-09-09 11:53:05 +02:00
Matthias Hochsteger
52b372718c generate netgen_config.hpp containing all cmake options 2020-09-09 11:33:06 +02:00
Matthias Hochsteger
fa1a5d11ee Fix version file generation 2020-07-25 08:41:17 +02:00
Matthias Hochsteger
68f5605866 Fix version parsing in conda build 2020-07-24 17:13:22 +02:00
Matthias Hochsteger
dcc0484be0 install netgen_version.hpp, set version in Archive 2020-07-23 16:25:06 +02:00
Matthias Hochsteger
34a6777f49 add file generate_version_file.cmake 2020-05-18 17:54:09 +02:00