diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | Install.txt | 8 | ||||
-rw-r--r-- | cmake/modules/FindBDB.cmake | 2 | ||||
-rw-r--r-- | cmake/modules/FindICU.cmake | 2 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | scripts/buildtests.sh | 5 | ||||
-rw-r--r-- | src/libicalss/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/libicalss/icalset.c | 10 | ||||
-rw-r--r-- | src/libicalss/icalss_file.cmake | 2 | ||||
-rw-r--r-- | src/test/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/test/libical-glib/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/test/regression-storage.c | 6 | ||||
-rw-r--r-- | src/test/regression.c | 2 |
15 files changed, 48 insertions, 41 deletions
diff --git a/.travis.yml b/.travis.yml index 1d500b01..bc749f09 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ language: c compiler: - gcc - clang -script: mkdir build && cd build && cmake -DWITH_BDB=true -DICAL_GLIB=true -DUSE_INTEROPERABLE_VTIMEZONES=true -DCMAKE_BUILD_TYPE=Release .. && make && make test +script: mkdir build && cd build && cmake -DICAL_GLIB=true -DUSE_INTEROPERABLE_VTIMEZONES=true -DCMAKE_BUILD_TYPE=Release .. && make && make test addons: apt: diff --git a/CMakeLists.txt b/CMakeLists.txt index 01fc326c..266201a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,6 @@ # Build the C++ bindings. # Default=true # -# -DWITH_BDB=[true|false] [MAY BE BUGGY. DO NOT USE FOR PRODUCTION] -# Build with the optional Berkeley DB storage. -# Requires the Berkeley DB development toolkit pre-installed. -# Default=false -# # -DICAL_ERRORS_ARE_FATAL=[true|false] # Set to make icalerror_* calls abort instead of internally signaling an error # Default=false @@ -89,6 +84,10 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) +#Include CMake capabilities +include(FeatureSummary) + +# Enable the test harness enable_testing() if(WINCE) @@ -109,14 +108,11 @@ set(PROJECT_VERSION "${LIBICAL_LIB_MAJOR_VERSION}.${LIBICAL_LIB_MINOR_VERSION}") set(PROJECT_URL "http://libical.github.io/libical/") # compile in Berkeley DB support -option(WITH_BDB "Build in Berkeley DB Support. Requires pre-installed Berkeley DB development toolkit") -if(WITH_BDB) - find_package(BDB) - if(BDB_FOUND) - add_definitions(-DWITH_BDB) - else() - message(FATAL_ERROR "Cannot build the Berkeley DB storage support as requested. Unable to the locate the pre-installed Berkeley DB development toolkit.") - endif() +find_package(BDB) +set_package_properties(BDB PROPERTIES TYPE OPTIONAL PURPOSE "For Berkeley DB storage support") +add_feature_info("Berkeley DB storage support" BDB_FOUND "requires the Berkeley DB development toolkit") +if(BDB_FOUND) + set(HAVE_BDB True) endif() # library build types @@ -135,6 +131,7 @@ endif() # must have Perl to create the derived stuff find_package(Perl REQUIRED) +set_package_properties(Perl PROPERTIES TYPE REQUIRED PURPOSE "Required by the libical build system.") # Ensure finding 64bit libs when using 64-bit compilers if(CMAKE_CL_64) @@ -145,6 +142,8 @@ endif() # libicu can be found at http://www.icu-project.org # RSCALE info at http://tools.ietf.org/html/rfc7529 find_package(ICU) +set_package_properties(ICU PROPERTIES TYPE RECOMMENDED PURPOSE "For RSCALE (RFC7529) support") +add_feature_info("RSCALE support (RFC7529)" ICU_FOUND "requires the ICU development libraries (libicu)") if(ICU_FOUND) set(REQUIRES_PRIVATE_ICU "Requires.private: icu-i18n") #for libical.pc set(HAVE_LIBICU 1) @@ -464,3 +463,5 @@ install( DESTINATION ${LIB_INSTALL_DIR}/cmake/LibIcal FILE LibIcalTargets.cmake ) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/Install.txt b/Install.txt index e5b6ef06..d553de9b 100644 --- a/Install.txt +++ b/Install.txt @@ -82,11 +82,9 @@ Then you can set the C and C++ compilers at CMake time, like so: ICU_BASE environment variable to the top folder where its installed and run cmake again. -* Berkeley DB storage. If want to use (try) the Berkeley Database storage - you can pass the -DWITH_BDB=True option to CMake. You'll need to have - the Berkeley DB toolkit development package installed beforehand. - This is very old code that disappeared in the 1.x series but - has been resurrected it in the 2.x series. +* Berkeley DB storage. + Optional for the Berkeley Database storage support. + The development toolkit can be found at http://www.oracle.com/database/berkeley-db ** This code path has not been fully tested. ** Don't be surprised if there are bugs. diff --git a/cmake/modules/FindBDB.cmake b/cmake/modules/FindBDB.cmake index 341e1fda..5782932f 100644 --- a/cmake/modules/FindBDB.cmake +++ b/cmake/modules/FindBDB.cmake @@ -5,6 +5,8 @@ # BDB_LIBRARY - Library to link against for the Berkeley DB # +set_package_info(BDB "Berkeley DB storage" "http://www.oracle.com/database/berkeley-db") + if(BDB_INCLUDE_DIR AND BDB_LIBRARY) # Already in cache, be silent set(BDB_FIND_QUIETLY TRUE) diff --git a/cmake/modules/FindICU.cmake b/cmake/modules/FindICU.cmake index e62f7371..5908dd59 100644 --- a/cmake/modules/FindICU.cmake +++ b/cmake/modules/FindICU.cmake @@ -13,6 +13,8 @@ # ICO_MINOR_VERSION - ICU minor version # +set_package_info(ICU "libicu (International Components for Unicode) libraries" "http://www.icu-project.org") + if(WIN32) file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR) endif() diff --git a/config.h.cmake b/config.h.cmake index 36ddbdc2..14914bb0 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -6,6 +6,9 @@ /* Define if you have the ICU internationalization library. */ #cmakedefine HAVE_LIBICU_I18N 1 +/* Define if you have the Berkeley DB library. */ +#cmakedefine HAVE_BDB 1 + /* Define to 1 if you have the `backtrace' function. */ #cmakedefine HAVE_BACKTRACE 1 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7ba11f50..8a18cf97 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -35,7 +35,7 @@ else() if(ICU_I18N_FOUND) target_link_libraries(doesnothing ${ICU_I18N_LIBRARY}) endif() - if(WITH_BDB) + if(BDB_FOUND) target_link_libraries(doesnothing ${BDB_LIBRARY}) endif() endif() diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh index d4fcabbe..0546015c 100755 --- a/scripts/buildtests.sh +++ b/scripts/buildtests.sh @@ -263,7 +263,6 @@ SPLINT() { -weak -warnposix \ -modobserver -initallelements -redef \ -linelen 1000 \ - -DWITH_BDB=1 \ -DHAVE_CONFIG_H=1 \ -DPACKAGE_DATA_DIR="\"foo\"" \ -DTEST_DATADIR="\"bar\"" \ @@ -415,7 +414,7 @@ cd .. TOP=`pwd` BDIR="" -CMAKEOPTS="-DCMAKE_BUILD_TYPE=Debug -DUSE_INTEROPERABLE_VTIMEZONES=True -DWITH_BDB=True -DGOBJECT_INTROSPECTION=True -DICAL_GLIB=True" +CMAKEOPTS="-DCMAKE_BUILD_TYPE=Debug -DUSE_INTEROPERABLE_VTIMEZONES=True -DGOBJECT_INTROSPECTION=True -DICAL_GLIB=True" #Static code checkers KRAZY @@ -437,6 +436,6 @@ CLANG_BUILD test1cross "-DCMAKE_TOOLCHAIN_FILE=$TOP/cmake/Toolchain-Linux-GCC-i6 CLANG_BUILD test2cross "-DCMAKE_TOOLCHAIN_FILE=$TOP/cmake/Toolchain-Linux-GCC-i686.cmake $CMAKEOPTS" #Address sanitizer -ASAN_BUILD test "-DUSE_INTEROPERABLE_VTIMEZONES=True -DWITH_BDB=True" +ASAN_BUILD test "-DUSE_INTEROPERABLE_VTIMEZONES=True" echo "ALL TESTS COMPLETED SUCCESSFULLY" diff --git a/src/libicalss/CMakeLists.txt b/src/libicalss/CMakeLists.txt index 7eec7218..da7e4da7 100644 --- a/src/libicalss/CMakeLists.txt +++ b/src/libicalss/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories( ${CMAKE_BINARY_DIR}/src/libical ${CMAKE_SOURCE_DIR}/src/libical ) -if(WITH_BDB) +if(BDB_FOUND) include_directories(${BDB_INCLUDE_DIR}) endif() @@ -26,7 +26,7 @@ add_custom_target( -DTOPS:FILEPATH=${TOPS} -DTOPB:FILEPATH=${TOPB} -DICAL_FILE_H_FILE:FILEPATH=${CMAKE_BINARY_DIR}/src/libicalss/icalss.h - -DWITH_BDB=${WITH_BDB} + -DBDB_FOUND=${BDB_FOUND} -P ${CMAKE_CURRENT_SOURCE_DIR}/icalss_file.cmake DEPENDS ical-header @@ -64,7 +64,7 @@ set(icalss_LIB_SRCS icalmessage.h ${icalss_LIB_DEVSRCS} ) -if(WITH_BDB) +if(BDB_FOUND) list(APPEND icalss_LIB_SRCS icalbdbset.c icalbdbset.h @@ -80,7 +80,7 @@ if(NOT SHARED_ONLY) endif() target_link_libraries(icalss ical) -if(WITH_BDB) +if(BDB_FOUND) target_link_libraries(icalss ${BDB_LIBRARY}) endif() @@ -123,7 +123,7 @@ if(WITH_CXX_BINDINGS) icalspanlist_cxx.cpp icalspanlist_cxx.h ) - if(WITH_BDB) + if(BDB_FOUND) list(APPEND icalsscxx_LIB_SRCS icalbdbset_cxx.h ) @@ -198,7 +198,7 @@ if(WITH_CXX_BINDINGS) DESTINATION ${INCLUDE_INSTALL_DIR}/libical ) - if(WITH_BDB) + if(BDB_FOUND) install(FILES icalbdbset_cxx.h DESTINATION ${INCLUDE_INSTALL_DIR}/libical diff --git a/src/libicalss/icalset.c b/src/libicalss/icalset.c index f1c048dd..040d2689 100644 --- a/src/libicalss/icalset.c +++ b/src/libicalss/icalset.c @@ -37,7 +37,7 @@ #include "icalfileset.h" #include "icalfilesetimpl.h" -#if defined(WITH_BDB) +#if defined(HAVE_BDB) #include "icalbdbset.h" #include "icalbdbsetimpl.h" #endif @@ -104,7 +104,7 @@ static icalset icalset_fileset_init = { NULL }; -#if defined(WITH_BDB) +#if defined(HAVE_BDB) static icalset icalset_bdbset_init = { ICAL_BDB_SET, sizeof(icalbdbset), @@ -212,8 +212,10 @@ static void icalset_init(void) pvl_push(icalset_kinds, &icalset_fileset_init); pvl_push(icalset_kinds, &icalset_dirset_init); -#if defined(WITH_BDB) +#if defined(HAVE_BDB) pvl_push(icalset_kinds, &icalset_bdb4set_init); +#else +#error 3 #endif icalset_init_done++; @@ -296,7 +298,7 @@ icalset *icalset_new(icalset_kind kind, const char *dsn, void *options) *data = icalset_dirset_init; break; } -#if defined(WITH_BDB) +#if defined(HAVE_BDB) case ICAL_BDB_SET: { icalbdbset *bdata; bdata = (icalbdbset *)malloc(sizeof(icalbdbset)); diff --git a/src/libicalss/icalss_file.cmake b/src/libicalss/icalss_file.cmake index c5433b7f..df105627 100644 --- a/src/libicalss/icalss_file.cmake +++ b/src/libicalss/icalss_file.cmake @@ -11,7 +11,7 @@ set(COMBINEDHEADERSICALSS ${TOPS}/src/libicalss/icalspanlist.h ${TOPS}/src/libicalss/icalmessage.h ) -if(WITH_BDB) +if(BDB_FOUND) list(APPEND COMBINEDHEADERSICALSS ${TOPS}/src/libicalss/icalbdbset.h) endif() diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index ef28e1f7..8fe21ebf 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -67,7 +67,7 @@ macro(buildme _name _srcs) if(ICU_I18N_FOUND) target_link_libraries(${_name} ${ICU_I18N_LIBRARY}) endif() - if(WITH_BDB) + if(BDB_FOUND) target_link_libraries(${_name} ${BDB_LIBRARY}) endif() endmacro() diff --git a/src/test/libical-glib/CMakeLists.txt b/src/test/libical-glib/CMakeLists.txt index c2ead07d..c1963785 100644 --- a/src/test/libical-glib/CMakeLists.txt +++ b/src/test/libical-glib/CMakeLists.txt @@ -1,4 +1,6 @@ find_program(PYTHON3 python3) +set_package_properties(PYTHON3 PROPERTIES TYPE REQUIRED PURPOSE "Required by the libical build system.") +add_feature_info("libical-glib testing" PYTHON3 "python3 is required to run the regression tests") list(APPEND TEST_FILES array.py @@ -34,6 +36,4 @@ if(PYTHON3) set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${test_env}") endforeach() -else() - message(WARNING "python3 not found, cannot run libical-glib tests") endif() diff --git a/src/test/regression-storage.c b/src/test/regression-storage.c index efaa33e0..30cea791 100644 --- a/src/test/regression-storage.c +++ b/src/test/regression-storage.c @@ -57,7 +57,7 @@ struct calendar int vcalendar_init(struct calendar **cal, const char *vcalendar, const char *title); -#if defined(WITH_BDB) +#if defined(HAVE_BDB) #include <db.h> int get_title(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey); @@ -272,7 +272,7 @@ void test_fileset_extended(void) icalcomponent_free(c); } -#if defined(WITH_BDB) +#if defined(HAVE_BDB) /* In this example, we're storing a calendar with several components @@ -509,7 +509,7 @@ int vcalendar_init(struct calendar **rcal, const char *vcalendar, const char *ti * from a primary key/data pair */ /* just create a random title for now */ -#if defined(WITH_BDB) +#if defined(HAVE_BDB) int get_title(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey) { diff --git a/src/test/regression.c b/src/test/regression.c index fe0bfdfa..4ac83343 100644 --- a/src/test/regression.c +++ b/src/test/regression.c @@ -4003,7 +4003,7 @@ int main(int argc, char *argv[]) test_run("Test C++ API", test_cxx, do_test, do_header); #endif -#if defined(WITH_BDB) +#if defined(HAVE_BDB) test_run("Test BDB Set", test_bdbset, do_test, do_header); #endif |