diff options
author | gregory guy <g-gregory@gmx.fr> | 2018-12-05 12:40:07 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 18:28:43 +0100 |
commit | 9004ae5427c4b939d7fbf21a7ab275181d534175 (patch) | |
tree | 5a4a56b0278c9ce7292d6a08115e5d7dd09a52a7 | |
parent | 159af1d7343f59679cc0e7e612d98bb46ffc9230 (diff) | |
download | knowit-9004ae5427c4b939d7fbf21a7ab275181d534175.tar.gz knowit-9004ae5427c4b939d7fbf21a7ab275181d534175.zip |
conversion to the cmake building system
Signed-off-by: gregory guy <g-gregory@gmx.fr>
-rwxr-xr-x | CMakeLists.txt | 77 | ||||
-rwxr-xr-x | ConfigureChecks.cmake | 44 | ||||
-rwxr-xr-x | config.h.cmake | 8 | ||||
-rwxr-xr-x | doc/CMakeLists.txt | 1 | ||||
-rw-r--r-- | doc/en/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | doc/man/CMakeLists.txt | 5 | ||||
-rw-r--r-- | doc/man/knowit.1 | 51 | ||||
-rw-r--r-- | po/CMakeLists.txt | 1 | ||||
-rw-r--r-- | po/zh_CN.po (renamed from po/zh_CN.GB2312.po) | 0 | ||||
-rw-r--r-- | src/CMakeLists.txt | 61 | ||||
-rw-r--r-- | src/knowit.cpp | 1 | ||||
-rw-r--r-- | src/knowit.desktop | 2 | ||||
-rw-r--r-- | src/knowitapp.cpp | 2 | ||||
-rw-r--r-- | src/knowitchooser.cpp | 2 | ||||
-rw-r--r-- | src/knowitedit.cpp | 1 | ||||
-rw-r--r-- | src/knowitlink.cpp | 1 | ||||
-rw-r--r-- | src/knowitlinks.cpp | 2 | ||||
-rw-r--r-- | src/knowitpref.cpp | 2 | ||||
-rw-r--r-- | src/knowittree.cpp | 2 | ||||
-rw-r--r-- | src/x-knowit.desktop | 2 |
20 files changed, 262 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..9e18cc8 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,77 @@ +############################################ +# # +# Improvements and feedbacks are welcome # +# # +# This file is released under GPL >= 3 # +# # +############################################ + + +cmake_minimum_required( VERSION 2.8 ) + + +#### general package setup + +project( knowit ) +set( VERSION R14.1.0 ) + + +#### include essential cmake modules + +include( FindPkgConfig ) +include( CheckFunctionExists ) +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} ) + + +##### user requested modules + +option( BUILD_ALL "Build all" ON ) +option( BUILD_DOC "Build documentation" ${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 "-Wl,--no-undefined" ) +set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" ) + + +##### directories + +add_subdirectory( src ) +tde_conditional_add_subdirectory( BUILD_DOC doc ) +tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po ) + + +##### write configure files + +configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100755 index 0000000..dfd13ad --- /dev/null +++ b/ConfigureChecks.cmake @@ -0,0 +1,44 @@ +########################################### +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 3 # +# # +########################################### + + +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + + +##### check for gcc visibility support + +if( WITH_GCC_VISIBILITY ) + if( NOT UNIX ) + tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" ) + endif( NOT UNIX ) + set( __KDE_HAVE_GCC_VISIBILITY 1 ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") +endif( WITH_GCC_VISIBILITY ) + + +##### gettext + +if( BUILD_TRANSLATIONS ) + include( FindGettext ) + if( GETTEXT_FOUND ) + set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE} + CACHE FILEPATH "path to msgfmt executable" ) + endif( GETTEXT_FOUND ) + + if( NOT MSGFMT_EXECUTABLE ) + tde_message_fatal( "msgfmt is required but was not found on your system." ) + endif( NOT MSGFMT_EXECUTABLE ) +endif( BUILD_TRANSLATIONS ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100755 index 0000000..61ede3a --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,8 @@ +#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@ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100755 index 0000000..6d0aa9f --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1 @@ +tde_auto_add_subdirectories( ) diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt new file mode 100644 index 0000000..3451d11 --- /dev/null +++ b/doc/en/CMakeLists.txt @@ -0,0 +1 @@ +tde_create_handbook( DESTINATION ${PROJECT_NAME} ) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt new file mode 100755 index 0000000..8512250 --- /dev/null +++ b/doc/man/CMakeLists.txt @@ -0,0 +1,5 @@ +INSTALL( + FILES ${PROJECT_NAME}.1 + DESTINATION ${MAN_INSTALL_DIR}/man1 + COMPONENT doc +) diff --git a/doc/man/knowit.1 b/doc/man/knowit.1 new file mode 100644 index 0000000..437b969 --- /dev/null +++ b/doc/man/knowit.1 @@ -0,0 +1,51 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH KNOWIT 1 "Aug 24, 2006" +.SH NAME +knowit \- Tool for managing notes for TDE +.SH SYNOPSIS +.B knowit +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B knowit +command. +.PP +\fBKnowIt\fP is a tool for managing notes which are organized in +tree-like hierarchy. It is similar to TuxCards, +but TDE-based (it requires Trinity Desktop Environment). +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-\-help +Show help about options +.TP +.B \-\-help-qt +Show Qt specific options +.TP +.B \-\-help-tde +Show TDE specific options +.TP +.B \-\-help-all +Show all options +.TP +.B \-\-author +Show author information +.TP +.B \-v, \-\-version +Show version information +.TP +.B \-\-license +Show license information +.TP +.B \-\- +End of options +.TP +.br +.SH AUTHOR +knowit was written by Micha Rudolf +.PP +This manual page was written by Lorenzo Villani <arbiter@arbiterlab.net>, +for the Ubuntu project (but may be used by others). diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..f5a2e1b --- /dev/null +++ b/po/CMakeLists.txt @@ -0,0 +1 @@ +tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} ) diff --git a/po/zh_CN.GB2312.po b/po/zh_CN.po index d2506c6..d2506c6 100644 --- a/po/zh_CN.GB2312.po +++ b/po/zh_CN.po diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..816216c --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,61 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### knowit (executable) + +tde_add_executable( ${PROJECT_NAME} AUTOMOC + + SOURCES + main.cpp + knowit.cpp + notes.cpp + knowittree.cpp + knowitlinks.cpp + knowittray.cpp + knowitpref.cpp + knowitlink.cpp + knowitapp.cpp + knowitchooser.cpp + knowitedit.cpp + LINK + tdecore-shared + tdeui-shared + tdeio-shared + tdeprint-shared + + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### icons + +tde_install_icons( ${PROJECT_NAME} ) + + +##### other data + +install( + FILES knowitui.rc tips + DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME} +) + +install( + FILES ${PROJECT_NAME}.desktop + DESTINATION ${XDG_APPS_INSTALL_DIR} +) + +install( + FILES x-${PROJECT_NAME}.desktop + DESTINATION ${MIME_INSTALL_DIR}/application +) diff --git a/src/knowit.cpp b/src/knowit.cpp index a9a2853..730b2af 100644 --- a/src/knowit.cpp +++ b/src/knowit.cpp @@ -1326,3 +1326,4 @@ void Knowit::slotLinkCopy() kapp->clipboard()->setText(link.link, TQClipboard::Selection); } +#include "knowit.moc" diff --git a/src/knowit.desktop b/src/knowit.desktop index 7ab745d..43e6544 100644 --- a/src/knowit.desktop +++ b/src/knowit.desktop @@ -3,7 +3,7 @@ Encoding=UTF-8 Type=Application Exec=knowit -caption "%c" %i %m MimeType=application/x-knowit -Icon=knowit +Icon=desktop X-DocPath=knowit/index.html Comment= Comment[de]= diff --git a/src/knowitapp.cpp b/src/knowitapp.cpp index 16cc68d..8796d94 100644 --- a/src/knowitapp.cpp +++ b/src/knowitapp.cpp @@ -31,3 +31,5 @@ void KnowitApplication::commitData(TQSessionManager& sm) mcloseByLogout = true; KUniqueApplication::commitData(sm); } + +#include "knowitapp.moc" diff --git a/src/knowitchooser.cpp b/src/knowitchooser.cpp index 639b943..45c8035 100644 --- a/src/knowitchooser.cpp +++ b/src/knowitchooser.cpp @@ -83,3 +83,5 @@ void KnowitChooser::setChoice(int flags) rule->setChecked(flags & AddRule); style->setChecked(flags & Style); } + +#include "knowitchooser.moc" diff --git a/src/knowitedit.cpp b/src/knowitedit.cpp index 11f2a29..748759d 100644 --- a/src/knowitedit.cpp +++ b/src/knowitedit.cpp @@ -64,3 +64,4 @@ void KnowitEdit::contentsDropEvent(TQDropEvent* event) else TQTextEdit::contentsDropEvent(event); } +#include "knowitedit.moc" diff --git a/src/knowitlink.cpp b/src/knowitlink.cpp index 863f776..d333c8f 100644 --- a/src/knowitlink.cpp +++ b/src/knowitlink.cpp @@ -99,3 +99,4 @@ void KnowitLinkDialog::slotTypeChanged(int index) browse->setEnabled(!index); } +#include "knowitlink.moc" diff --git a/src/knowitlinks.cpp b/src/knowitlinks.cpp index c2054e8..2114715 100644 --- a/src/knowitlinks.cpp +++ b/src/knowitlinks.cpp @@ -54,3 +54,5 @@ void KnowitLinks::keyPressEvent(TQKeyEvent* e) } else TDEListBox::keyPressEvent(e); } + +#include "knowitlinks.moc" diff --git a/src/knowitpref.cpp b/src/knowitpref.cpp index bbc4b97..d844658 100644 --- a/src/knowitpref.cpp +++ b/src/knowitpref.cpp @@ -389,4 +389,4 @@ void KnowitPreferences::slotUpdateDatePreview() insertDatePreview->setText(str); } - +#include "knowitpref.moc" diff --git a/src/knowittree.cpp b/src/knowittree.cpp index 436da5f..1c66c2b 100644 --- a/src/knowittree.cpp +++ b/src/knowittree.cpp @@ -142,5 +142,5 @@ void KnowitTree::slotItemRight() setCurrentItem(currentItem()->firstChild()); } - +#include "knowittree.moc" diff --git a/src/x-knowit.desktop b/src/x-knowit.desktop index e060ac5..0545753 100644 --- a/src/x-knowit.desktop +++ b/src/x-knowit.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Comment=KnowIt -Icon=knowit +Icon=desktop MimeType=application/x-knowit Patterns=*.kno; Type=MimeType |