core: make cpputest optional in cmake compilation

With this fix, WeeChat can be built without tests (if cpputest is not found),
without having to explicitely disable tests ("-DENABLE_TESTS=OFF").
v2.8-utf8proc
Sébastien Helleu 2015-05-17 14:58:10 +02:00
parent 81e037b1ce
commit 3262599413
3 changed files with 3 additions and 4 deletions

View File

@ -212,7 +212,8 @@ endif()
add_subdirectory(src)
add_subdirectory(doc)
if(ENABLE_TESTS)
find_package(CppUTest)
if(ENABLE_TESTS AND CPPUTEST_FOUND)
enable_testing()
add_subdirectory(tests)
endif()

View File

@ -33,5 +33,5 @@ endif()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_search_module(CPPUTEST REQUIRED cpputest)
pkg_search_module(CPPUTEST cpputest)
endif()

View File

@ -19,8 +19,6 @@
enable_language(CXX)
find_package(CppUTest REQUIRED)
# fake ncurses lib (it does nothing)
set(LIB_WEECHAT_NCURSES_FAKE_SRC ncurses-fake.c)
add_library(weechat_ncurses_fake STATIC ${LIB_WEECHAT_NCURSES_FAKE_SRC})