Fix CLN build (#6920)
authorAndres Noetzli <andres.noetzli@gmail.com>
Sat, 24 Jul 2021 00:06:51 +0000 (17:06 -0700)
committerGitHub <noreply@github.com>
Sat, 24 Jul 2021 00:06:51 +0000 (00:06 +0000)
Currently, the CLN `CONFIGURE_COMMAND` chains multiple commands using
`&&` but this does not seem to work with CMake 3.20.4 and CMake 3.19.7
and is also not the recommended way of doing it. The commit fixes the
issue by using additional `COMMAND`s and also switches to using the
CMake's `chdir` instead of `cd`.

cmake/FindCLN.cmake

index b5b37ec59e86f112ea865e70f1102209f00d0e5e..e802da2ef2265fd2425198514680bb3531e1d488 100644 (file)
@@ -58,7 +58,10 @@ if(NOT CLN_FOUND_SYSTEM)
     URL "https://www.ginac.de/CLN/cln.git/?p=cln.git\\\;a=snapshot\\\;h=cln_${CLN_TAG}\\\;sf=tgz"
     URL_HASH SHA1=71d02b90ef0575f06b7bafb8690f73e8064d8228
     DOWNLOAD_NAME cln.tgz
-    CONFIGURE_COMMAND cd <SOURCE_DIR> && ./autogen.sh && autoreconf -iv
+    CONFIGURE_COMMAND
+      ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> ./autogen.sh
+    COMMAND
+      ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> autoreconf -iv
     COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-shared
             --enable-static --with-pic
     BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libcln.a