From bff40e4c26817a129ae020c5bc4e51fd5d8476f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 15 Sep 2019 07:49:03 +0200 Subject: [PATCH] core: display an error on missing dependency in CMake (closes #916, closes #956) --- CMakeLists.txt | 16 +++++++++++---- ChangeLog.adoc | 6 ++++++ doc/CMakeLists.txt | 8 ++------ src/gui/curses/normal/CMakeLists.txt | 2 ++ src/plugins/CMakeLists.txt | 29 ++++++++++++++++++++-------- 5 files changed, 43 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba4b415c8..6f5820225 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,6 +180,8 @@ if(ENABLE_NLS) find_package(Gettext) if(GETTEXT_FOUND) add_definitions(-DENABLE_NLS) + else() + message(SEND_ERROR "Gettext not found") endif() endif() @@ -197,6 +199,8 @@ if(ENABLE_GNUTLS) include_directories(${GNUTLS_INCLUDE_PATH}) set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${GNUTLS_LIBRARY_PATH}") list(APPEND EXTRA_LIBS gnutls) + else() + message(SEND_ERROR "GnuTLS not found") endif() endif() @@ -234,10 +238,14 @@ endif() add_subdirectory(src) add_subdirectory(doc) -find_package(CppUTest) -if(ENABLE_TESTS AND CPPUTEST_FOUND) - enable_testing() - add_subdirectory(tests) +if(ENABLE_TESTS) + find_package(CppUTest) + if(CPPUTEST_FOUND) + enable_testing() + add_subdirectory(tests) + else() + message(SEND_ERROR "CppUTest not found") + endif() endif() configure_file(config.h.cmake config.h @ONLY) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 27a8fe7ba..86aac1c09 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -15,6 +15,12 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] (file _ReleaseNotes.adoc_ in sources). +[[v2.7]] +== Version 2.7 (under dev) + +Build:: + * core: display an error on missing dependency in CMake (issue #916, issue #956) + [[v2.6]] == Version 2.6 (2019-09-08) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 3e58148cb..7c48d171a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -19,13 +19,9 @@ # if(ENABLE_MAN OR ENABLE_DOC) - find_package(Asciidoctor) - if(ASCIIDOCTOR_FOUND) - set(ASCIIDOCTOR_ARGS -a experimental -a icons=font -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=prettify) - add_subdirectory(cs) add_subdirectory(de) add_subdirectory(en) @@ -35,7 +31,7 @@ if(ENABLE_MAN OR ENABLE_DOC) add_subdirectory(ja) add_subdirectory(pl) add_subdirectory(ru) - + else() + message(SEND_ERROR "Asciidoctor not found") endif() - endif() diff --git a/src/gui/curses/normal/CMakeLists.txt b/src/gui/curses/normal/CMakeLists.txt index db9f5826a..604f8763d 100644 --- a/src/gui/curses/normal/CMakeLists.txt +++ b/src/gui/curses/normal/CMakeLists.txt @@ -40,6 +40,8 @@ if(NCURSES_FOUND) add_definitions(-DHAVE_NCURSES_H) endif() endif() +else() + message(SEND_ERROR "Ncurses not found") endif() include_directories(.. ../../core ../../plugins ${NCURSES_INCLUDE_PATH}) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index fc8d2eed4..4cf971a44 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -55,9 +55,10 @@ if(ENABLE_BUFLIST) endif() if(ENABLE_CHARSET) - # Check for iconv support. if(ICONV_FOUND) add_subdirectory(charset) + else() + message(SEND_ERROR "Iconv not found") endif() endif() @@ -93,6 +94,8 @@ if(ENABLE_SCRIPTS AND ENABLE_PERL) find_package(Perl) if(PERL_FOUND) add_subdirectory(perl) + else() + message(SEND_ERROR "Perl not found") endif() endif() @@ -100,6 +103,8 @@ if(ENABLE_SCRIPTS AND ENABLE_PYTHON) find_package(Python) if(PYTHON_FOUND) add_subdirectory(python) + else() + message(SEND_ERROR "Python not found") endif() endif() @@ -107,6 +112,8 @@ if(ENABLE_SCRIPTS AND ENABLE_RUBY) find_package(Ruby) if(RUBY_FOUND) add_subdirectory(ruby) + else() + message(SEND_ERROR "Ruby not found") endif() endif() @@ -114,6 +121,8 @@ if(ENABLE_SCRIPTS AND ENABLE_LUA) find_package(Lua) if(LUA_FOUND) add_subdirectory(lua) + else() + message(SEND_ERROR "Lua not found") endif() endif() @@ -121,6 +130,8 @@ if(ENABLE_SCRIPTS AND ENABLE_TCL) find_package(TCL) if(TCL_FOUND) add_subdirectory(tcl) + else() + message(SEND_ERROR "Tcl not found") endif() endif() @@ -128,6 +139,8 @@ if(ENABLE_SCRIPTS AND ENABLE_GUILE) find_package(Guile) if(GUILE_FOUND) add_subdirectory(guile) + else() + message(SEND_ERROR "Guile not found") endif() endif() @@ -135,6 +148,8 @@ if(ENABLE_SCRIPTS AND ENABLE_JAVASCRIPT) find_package(V8) if(V8_FOUND) add_subdirectory(javascript) + else() + message(SEND_ERROR "V8 (javascript) not found") endif() endif() @@ -142,27 +157,25 @@ if(ENABLE_SCRIPTS AND ENABLE_PHP) find_package(PHP) if(PHP_FOUND) add_subdirectory(php) + else() + message(SEND_ERROR "Php not found") endif() endif() if(ENABLE_SPELL) if(ENABLE_ENCHANT) - # Check for enchant libraries find_package(ENCHANT) if(ENCHANT_FOUND) add_subdirectory(spell) else() - # Check for aspell libraries - find_package(Aspell) - if(ASPELL_FOUND) - add_subdirectory(spell) - endif() + message(SEND_ERROR "Enchant not found") endif() else() - # Check for aspell libraries find_package(Aspell) if(ASPELL_FOUND) add_subdirectory(spell) + else() + message(SEND_ERROR "Aspell not found") endif() endif() endif()