.. and print a helpful message.
Before:
./configure
mkdir ../cln_build
cd ../cln_build && cmake -GNinja ../cln && cmake --build .
[cryptic error due to a redefined macro or something]
After:
./configure
mkdir ../cln_build
cd ../cln_build && cmake -GNinja ../cln && cmake --build .
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:24 (message):
Source directory has been already configured by configure script. Please
run `make distclean` in /home/asheplyakov/work/sw/cln and try again.
-- Configuring incomplete, errors occurred!
set(libcln_version ${libcln_soversion}.${cl_lt_age}.${cl_lt_revision})
option(CLN_USE_GMP "Use GMP low level routines" ON)
+if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/config.status
+ OR EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libtool)
+ message(FATAL_ERROR
+ "Source directory has been already configured by configure script. "
+ "Please run `make distclean` in ${CMAKE_CURRENT_SOURCE_DIR} and try again."
+ )
+endif()
include(GNUInstallDirs)
set(cl_config_files