From 3e2052d2d451a77852c362f6b8812f74f4648739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 19 Oct 2018 02:35:22 +0200 Subject: cmake: Add options WITH_SSL and WITH_MLED Fix test for SSL => is not needed, because is used KSSL from tdelibs Fix test for ASUS Mail LED support in ACPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 7 +++++++ ConfigureChecks.cmake | 20 ++++++++++++++++---- config.h.cmake | 14 +++++++------- kbiff/CMakeLists.txt | 8 -------- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c94156e..a593098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,8 @@ tde_setup_paths( ) option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_SSL "Build with SSL (imap4s and pop3s) protocol support" ${WITH_ALL_OPTIONS} ) +option( WITH_MLED "Compile with support for Mail LED on ASUS notebooks" OFF ) ##### user requested modules @@ -51,6 +53,11 @@ option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) +##### user defined options ####### + +set( _PATH_MAILDIR "/var/spool/mail" CACHE STRING "Path for the mail spool" ) + + ##### configure checks include( ConfigureChecks.cmake ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6f2c0d2..dcab462 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -37,10 +37,22 @@ check_include_file( "paths.h" HAVE_PATHS_H ) #### set USE_SSL -find_package(OpenSSL) -if( OPENSSL_FOUND ) - set( USE_SSL 1 ) -endif( OPENSSL_FOUND ) +if( WITH_SSL ) + # For SSL support is used KSSL in tdelibs. + # Therefore, there is no need for a direct dependence on the SSL library. + set( USE_SSL 1 ) +endif( WITH_SSL ) + + +#### check for ASUS Mail LED + +if( WITH_MLED ) + if( EXISTS "/proc/acpi/asus/mled" ) + set( HAVE_MLED 1 ) + else( ) + tde_mesage_fatal( "ASUS Mail LED support was requested but not found in ACPI" ) + endif( ) +endif( WITH_MLED ) ##### gettext diff --git a/config.h.cmake b/config.h.cmake index f516d04..19a2071 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -13,14 +13,14 @@ /* Defined to 1 if we have path.h header */ #cmakedefine HAVE_PATHS_H 1 -/* Defined to 1 since we do have c++ stl headers */ -#define HAVE_MLED 1 +/* + * Compile with support for Mail LED on ASUS notebooks: + * needs ACPI and Asus Laptop Extras (http://sourceforge.net/projects/acpi4asus/ + */ +#cmakedefine HAVE_MLED 1 /* Defined to 1 if we have OpenSSL */ -#cmakedefine USE_SSL @USE_SSL@ +#cmakedefine USE_SSL 1 /* Define the path for the mail spool */ -#define _PATH_MAILDIR "/var/spool/mail" - -/* for HP Unix Operating system */ -#undef _HPUX_SOURCE +#cmakedefine _PATH_MAILDIR "@PATH_MAILDIR@" diff --git a/kbiff/CMakeLists.txt b/kbiff/CMakeLists.txt index 30ccca5..2cd758a 100644 --- a/kbiff/CMakeLists.txt +++ b/kbiff/CMakeLists.txt @@ -12,13 +12,6 @@ link_directories( ) -##### OpenSSL library - -if( USE_SSL ) - set( _SSL ssl ) -endif() - - ##### kbiff (tdeinit) tde_add_tdeinit_executable( ${PROJECT_NAME} AUTOMOC @@ -39,7 +32,6 @@ tde_add_tdeinit_executable( ${PROJECT_NAME} AUTOMOC tdeio-shared tdecore-shared tdeui-shared - ${_SSL} ) -- cgit v1.2.3