diff options
author | Brad King <brad.king@kitware.com> | 2015-02-17 18:24:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-02-19 14:26:27 (GMT) |
commit | e6ebc814dfa022680038a3855eb1eee56f6015f0 (patch) | |
tree | ac39d7a1252716751f72ceb435fc1233cdc9f2a7 /Modules/CMakeFortranCompilerId.F.in | |
parent | ec1ec47193fcab7084e8edd977d3bebd1e8c73cb (diff) | |
download | CMake-e6ebc814dfa022680038a3855eb1eee56f6015f0.zip CMake-e6ebc814dfa022680038a3855eb1eee56f6015f0.tar.gz CMake-e6ebc814dfa022680038a3855eb1eee56f6015f0.tar.bz2 |
Fortran: Add infrastructure to detect compiler version (#15372)
Fortran does not offer syntax to compose a string literal at
preprocessing time from numeric compuations. Instead encode each digit
of each component as a separate INFO string and compose them in CMake
code after extraction. Support MAJOR, MINOR, PATCH, and TWEAK
components with up to 8 digits each.
Diffstat (limited to 'Modules/CMakeFortranCompilerId.F.in')
-rw-r--r-- | Modules/CMakeFortranCompilerId.F.in | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 5349505..955ca85 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -134,4 +134,26 @@ PRINT *, 'INFO:arch[X86]' # endif #endif + +#if 0 +! Encode compiler version digits +#endif +#define DEC_8(n) (((n) / 10000000) % 10) +#define DEC_7(n) (((n) / 1000000) % 10) +#define DEC_6(n) (((n) / 100000) % 10) +#define DEC_5(n) (((n) / 10000) % 10) +#define DEC_4(n) (((n) / 1000) % 10) +#define DEC_3(n) (((n) / 100) % 10) +#define DEC_2(n) (((n) / 10) % 10) +#define DEC_1(n) (((n) ) % 10) +#define HEX_8(n) ((n)>>28 & 0xF) +#define HEX_7(n) ((n)>>24 & 0xF) +#define HEX_6(n) ((n)>>20 & 0xF) +#define HEX_5(n) ((n)>>16 & 0xF) +#define HEX_4(n) ((n)>>12 & 0xF) +#define HEX_3(n) ((n)>>8 & 0xF) +#define HEX_2(n) ((n)>>4 & 0xF) +#define HEX_1(n) ((n) & 0xF) +@CMAKE_Fortran_COMPILER_ID_VERSION_INFO@ + END |