'ANTLR3_RUNTIME' should respect lib/lib64 (#6906)
authorAndrew V. Jones <andrewvaughanj@gmail.com>
Mon, 19 Jul 2021 06:55:35 +0000 (07:55 +0100)
committerGitHub <noreply@github.com>
Mon, 19 Jul 2021 06:55:35 +0000 (23:55 -0700)
commit9780083d129c50aa4a093b47946126d9fa9dd3e5
tree4f1e01118fefc48a98df1fb73f87d7da0aee3c7d
parent17fc4c975cefba7082e5557cb9c9515f16b44096
'ANTLR3_RUNTIME' should respect lib/lib64 (#6906)

On 64-bit openSUSE (and maybe other distributions), the default install directory for static libraries is `lib64` *not* `lib`. This has an impact on cvc5 when it is automatically building ANTLR3: ANTLR3 follows the system-wide default of `lib64`, which fails when cvc5 tries to find these in `lib`.

Without this change, the build fails as follows:

```
<snip>
src/parser/CMakeFiles/cvc5parser.dir/smt2/Smt2Parser.c.o  -Wl,-rpath,/home/avj/clones/cvc5/lib64_cms/build/src::::::::::::::::::::::::  src/libcvc5.so.1  deps/lib/libantlr3c.a && :
/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: cannot find deps/lib/libantlr3c.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```

and where:

```
avj@platypus ~/clones/cvc5/lib64_cms/build$ find . -iname "libantlr3c.a"
./deps/src/ANTLR3-EP-runtime/.libs/libantlr3c.a
./deps/lib64/libantlr3c.a
```

(notice: `lib64` in the second path!)

This commit fixes this discrepancy to ensure that cvc5 checks for ANTLR3 on `CMAKE_INSTALL_LIBDIR`, which matches that `autotools` will use.

**Note**: `CMAKE_INSTALL_LIBDIR` comes from `GNUInstallDirs`, and this is `include`'d in cvc5's top-level `CMakeLists.txt`

Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
cmake/FindANTLR3.cmake