diff options
author | Mavridis Philippe <[email protected]> | 2021-01-25 15:48:29 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-01-25 15:48:29 +0200 |
commit | 3988d0b5dd1614839cee5a6aa23439cc156efe2d (patch) | |
tree | bf9b1f58ac0f799a9895aae701d7af93107f06b9 | |
parent | c06676f232466dcc7917299b75f5296ff830b01c (diff) | |
download | klamav-3988d0b5dd1614839cee5a6aa23439cc156efe2d.tar.gz klamav-3988d0b5dd1614839cee5a6aa23439cc156efe2d.zip |
CMake conversion
Signed-off-by: Mavridis Philippe <[email protected]>
-rw-r--r-- | CMakeLists.txt | 85 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 67 | ||||
-rw-r--r-- | config.h.cmake | 12 | ||||
-rw-r--r-- | doc/CMakeLists.txt | 34 | ||||
-rw-r--r-- | src/CMakeLists.txt | 75 | ||||
-rw-r--r-- | src/about/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/action/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/icons/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/klammail/CMakeLists.txt | 20 | ||||
-rw-r--r-- | src/sqlite/CMakeLists.txt | 54 |
10 files changed, 357 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e66f9d1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,85 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +# Modified by Mavridis Philippe for KlamAV. +# +################################################# + +cmake_minimum_required( VERSION 2.8.12 ) + + +##### general package setup ##################### + +project( klamav ) +set( VERSION R14.0.10 ) + + +##### include essential cmake modules ########### + +include( FindPkgConfig ) +include( CheckFunctionExists ) +include( CheckSymbolExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( CheckCSourceCompiles ) +include( CheckCXXSourceCompiles ) + + +##### include our cmake modules ################# + +set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) +include( TDEMacros ) + + +##### setup install paths ####################### + +include( TDESetupPaths ) +tde_setup_paths( ) + + + +##### optional stuff ############################ + +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_EMBEDDED_SQLITE "Use included SQLite instead of system one" ${WITH_ALL_OPTIONS} ) + + +##### user requested modules #################### + +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${BUILD_ALL} ) +option( BUILD_KLAMMAIL "Build Klammail (e-mail filter)" ${BUILD_ALL} ) +# option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} ) + + +##### configure checks ########################## + +include( ConfigureChecks.cmake ) + + +###### global compiler settings ################# + +add_definitions( -DHAVE_CONFIG_H ) + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) +set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) + + +##### source directories ######################## + +add_subdirectory( src ) +tde_conditional_add_subdirectory( BUILD_DOC doc ) +tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations ) + + +##### write configure files ##################### + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..5f09c91 --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,67 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +# Modified by Mavridis Philippe for KlamAV. +# +################################################# + + +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + +##### check for gcc visibility support + +if( WITH_GCC_VISIBILITY ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) + +find_package( X11 ) + + +##### check for LibClamAV + +pkg_search_module( LIBCLAMAV libclamav ) + +if( NOT LIBCLAMAV_FOUND ) + tde_message_fatal( "ClamAV is required but not found on your system" ) +endif( NOT LIBCLAMAV_FOUND ) + + +##### check for zlib (needed by Virus Browser) + +pkg_search_module( ZLIB zlib ) + +if( NOT ZLIB_FOUND ) + tde_message_fatal( "zlib is required but not found on your system" ) +endif( NOT ZLIB_FOUND ) + + +##### check whether to use embedded or system SQLite + +if( WITH_EMBEDDED_SQLITE ) + set( SQLITE_LIBRARIES sqlite-static ) + message( STATUS "sqlite3 linking: ${SQLITE_LIBRARIES}" ) +else() + pkg_search_module( SQLITE sqlite3 ) + + if( SQLITE_FOUND ) + message( STATUS "sqlite3 linking: ${SQLITE_LIBRARIES}" ) + else() + tde_message_fatal( "sqlite3 is required, but not found on your system" ) + endif( SQLITE_FOUND ) +endif( WITH_EMBEDDED_SQLITE ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..67860c5 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,12 @@ +#define VERSION "@VERSION@" + +// Defined if you have fvisibility and fvisibility-inlines-hidden support. +#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@ + +/* Defined if you don't have either the XTest headers or + the xcb-util-keysyms headers */ +#cmakedefine NO_XTEST_EXTENSION 1 diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..f6eec15 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,34 @@ +file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * ) +list( REMOVE_ITEM _dirs html man ) + +string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" ) + +foreach( _dir IN LISTS _dirs ) + if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} + AND ( "${_dir}" STREQUAL "en" OR + "${_linguas}" MATCHES "^;*$" OR + ";${_linguas};" MATCHES ";${_dir};" )) + file( GLOB _doc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} ${_dir}/*.docbook ) + if( _doc_files ) + list( FIND _doc_files "index.docbook" _find_index ) + if( -1 EQUAL _find_index ) + set( _noindex "NOINDEX" ) + else() + unset( _noindex ) + endif() + tde_create_handbook( + SOURCE_BASEDIR ${_dir} + ${_noindex} + LANG ${_dir} + DESTINATION ${PROJECT_NAME} + ) + endif() + endif() +endforeach() + +if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html/CMakeLists.txt ) + add_subdirectory( html ) +endif() +if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/man/CMakeLists.txt ) + add_subdirectory( man ) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..a520911 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,75 @@ +add_subdirectory( about ) +add_subdirectory( action ) +add_subdirectory( icons ) + +tde_conditional_add_subdirectory( WITH_EMBEDDED_SQLITE sqlite ) +tde_conditional_add_subdirectory( BUILD_KLAMMAIL klammail ) + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} + ${LIBCLAMAV_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} + ${CMAKE_SOURCE_DIR}/src/sqlite + ${SQLITE_INCLUDE_DIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + +##### klamav (executable) +# @SOURCES: autoscanoptions.ui excluded until autoscan reimplemented + +tde_add_executable( ${PROJECT_NAME} AUTOMOC + + SOURCES + main.cpp klamav.cpp freshklam.cpp sigtool.cpp + klamscan.cpp kuarantine.cpp welcome.cpp dbviewer.cpp + frame.cpp tabwidget.cpp viewer.cpp pageviewer.cpp + klamav_run.cpp dcopklamscan.skel directorylist.cpp + scanviewer.cpp schedule.cpp datepicker.cpp + cthost.cpp ctcron.cpp ctmonth.cpp ctdom.cpp + ctdow.cpp cttask.cpp ctvariable.cpp + ktlistitem.cpp ktlisttask.cpp ktlisttasks.cpp + ktview.cpp ktlistcron.cpp kticon.cpp + activityviewer.cpp collectiondb.cpp + configdialog.cpp klamavconfig.kcfgc + archivelimits.ui archivetypes.ui specialfiletypes.ui + firstrunwizard.ui logoptions.ui + k3bjobprogressosd_mod.cpp + + LINK + tdeio-shared + tdehtml-shared + tdeui-shared + tdecore-shared + ${LIBCLAMAV_LIBRARIES} + ${SQLITE_LIBRARIES} + ${ZLIB_LIBRARIES} + + DESTINATION ${BIN_INSTALL_DIR} +) + +tde_create_translated_desktop( ${PROJECT_NAME}.desktop ) + +tde_create_translated_desktop( + SOURCE eventsrc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +##### install servicemenu +install( + FILES klamav-dropdown.desktop + DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus +) + +##### install XML-GUI resource file +install( + FILES klamavui.rc + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) diff --git a/src/about/CMakeLists.txt b/src/about/CMakeLists.txt new file mode 100644 index 0000000..405fd2f --- /dev/null +++ b/src/about/CMakeLists.txt @@ -0,0 +1,4 @@ +install( + FILES aboutklamav.html main.html nodb.html wait.html klamav.css top-right-klamav.png klam.png + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/about +) diff --git a/src/action/CMakeLists.txt b/src/action/CMakeLists.txt new file mode 100644 index 0000000..d1d3018 --- /dev/null +++ b/src/action/CMakeLists.txt @@ -0,0 +1,4 @@ +install( + FILES ScanWithKlamAV + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/src/icons/CMakeLists.txt b/src/icons/CMakeLists.txt new file mode 100644 index 0000000..847f496 --- /dev/null +++ b/src/icons/CMakeLists.txt @@ -0,0 +1,2 @@ +tde_install_icons( DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}/icons ) +tde_install_icons( app-klamav ) diff --git a/src/klammail/CMakeLists.txt b/src/klammail/CMakeLists.txt new file mode 100644 index 0000000..235fc9d --- /dev/null +++ b/src/klammail/CMakeLists.txt @@ -0,0 +1,20 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src + ${LIBCLAMAV_INCLUDE_DIR} +) + +##### klammail (executable) + +tde_add_executable( klammail AUTOMOC + + SOURCES + clamdmail.c options.c output.c memory.c cfgparser.c client.c + + LINK + ${LIBCLAMAV_LIBRARIES} + + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/src/sqlite/CMakeLists.txt b/src/sqlite/CMakeLists.txt new file mode 100644 index 0000000..f38d08a --- /dev/null +++ b/src/sqlite/CMakeLists.txt @@ -0,0 +1,54 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src + ${ZLIB_INCLUDE_DIR} +) + + +##### SQLite (static) + +tde_add_library( sqlite STATIC_PIC + + SOURCES + alter.c + attach.c + auth.c + btree.c + build.c + callback.c + date.c + delete.c + expr.c + func.c + hash.c + insert.c + legacy.c + main.c + opcodes.c + os_unix.c + os_win.c + pager.c + parse.c + pragma.c + prepare.c + printf.c + random.c + select.c + table.c + tokenize.c + trigger.c + update.c + utf.c + util.c + vacuum.c + vdbe.c + vdbeapi.c + vdbeaux.c + vdbemem.c + where.c + + LINK + ${ZLIB_LIBRARIES} +) |