Browse Source

Conversion to the cmake building system.

Added a man page taken from the Debian packaging system.
Changed the doc folder's layout.

Signed-off-by: gregory guy <gregory-tde@laposte.net>

CMake: Use tde_add_project_translations common macro.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
gregory guy 1 year ago
parent
commit
2fe98299ba
No known key found for this signature in database
GPG Key ID: 2CC84A1CC6823AF8
  1. 78
      CMakeLists.txt
  2. 39
      ConfigureChecks.cmake
  3. 11
      config.h.cmake
  4. 6
      doc/en/Makefile.am
  5. 0
      doc/en/calculation-history.png
  6. 0
      doc/en/calculator-buttons.png
  7. 0
      doc/en/completion.png
  8. 0
      doc/en/convert-number-bases.png
  9. 0
      doc/en/convert-unit.png
  10. 0
      doc/en/edit-function.png
  11. 0
      doc/en/edit-matrix.png
  12. 0
      doc/en/edit-unit.png
  13. 0
      doc/en/edit-variable.png
  14. 0
      doc/en/function-manager.png
  15. 0
      doc/en/functions.docbook
  16. 0
      doc/en/gnuplot.png
  17. 0
      doc/en/import-csv.png
  18. 0
      doc/en/index.docbook
  19. 0
      doc/en/insert-function.png
  20. 0
      doc/en/mainwindow.png
  21. 0
      doc/en/plot-data.png
  22. 0
      doc/en/plot-settings.png
  23. 2
      doc/en/qalculate_tde/Makefile.am
  24. 0
      doc/en/rpn-mode.png
  25. 0
      doc/en/store-variable.png
  26. 0
      doc/en/unit-manager.png
  27. 0
      doc/en/units.docbook
  28. 0
      doc/en/variable-manager.png
  29. 0
      doc/en/variables.docbook
  30. 16
      doc/man/qalculate-tde.1
  31. 1
      po/CMakeLists.txt
  32. 62
      src/CMakeLists.txt
  33. 4
      src/qalculateexpressionedit.cpp
  34. 12
      src/qalculateinsertmatrixvectordialog.cpp

78
CMakeLists.txt

@ -0,0 +1,78 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 2.8.12 )
#### general package setup
project( qalculate_tde )
set( VERSION R14.1.0 )
#### 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} )
##### 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 -UTQT_NO_ASCII_CAST )
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" )
##### directories
add_subdirectory( src )
tde_conditional_add_project_docs( BUILD_DOC )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

39
ConfigureChecks.cmake

@ -0,0 +1,39 @@
###########################################
# #
# 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)
tde_setup_largefiles( )
##### check for gcc visibility support
if( WITH_GCC_VISIBILITY )
tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )
##### Threading support
find_package( Threads )
##### look for libqalculate
pkg_search_module( QALCULATE libqalculate )
if( NOT QALCULATE_FOUND )
tde_message_fatal( "libqalculate is required but was not found on your system." )
endif( NOT QALCULATE_FOUND )

11
config.h.cmake

@ -0,0 +1,11 @@
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __TDE_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 for .rc file and icons */
#define PACKAGE "qalculate_tde"

6
doc/en/Makefile.am

@ -1,4 +1,2 @@
# the SUBDIRS is filled automatically by am_edit. If files are
# in this directory they are installed into the english dir
SUBDIRS = qalculate_tde
KDE_DOCS = qalculate_tde
KDE_LANG = en

0
doc/en/qalculate_tde/calculation-history.png → doc/en/calculation-history.png

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

0
doc/en/qalculate_tde/calculator-buttons.png → doc/en/calculator-buttons.png

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

0
doc/en/qalculate_tde/completion.png → doc/en/completion.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
doc/en/qalculate_tde/convert-number-bases.png → doc/en/convert-number-bases.png

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
doc/en/qalculate_tde/convert-unit.png → doc/en/convert-unit.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
doc/en/qalculate_tde/edit-function.png → doc/en/edit-function.png

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
doc/en/qalculate_tde/edit-matrix.png → doc/en/edit-matrix.png

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

0
doc/en/qalculate_tde/edit-unit.png → doc/en/edit-unit.png

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

0
doc/en/qalculate_tde/edit-variable.png → doc/en/edit-variable.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
doc/en/qalculate_tde/function-manager.png → doc/en/function-manager.png

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

0
doc/en/qalculate_tde/functions.docbook → doc/en/functions.docbook

0
doc/en/qalculate_tde/gnuplot.png → doc/en/gnuplot.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
doc/en/qalculate_tde/import-csv.png → doc/en/import-csv.png

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

0
doc/en/qalculate_tde/index.docbook → doc/en/index.docbook

0
doc/en/qalculate_tde/insert-function.png → doc/en/insert-function.png

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

0
doc/en/qalculate_tde/mainwindow.png → doc/en/mainwindow.png

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

0
doc/en/qalculate_tde/plot-data.png → doc/en/plot-data.png

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

0
doc/en/qalculate_tde/plot-settings.png → doc/en/plot-settings.png

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

2
doc/en/qalculate_tde/Makefile.am

@ -1,2 +0,0 @@
KDE_DOCS = AUTO
KDE_LANG = en

0
doc/en/qalculate_tde/rpn-mode.png → doc/en/rpn-mode.png

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
doc/en/qalculate_tde/store-variable.png → doc/en/store-variable.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
doc/en/qalculate_tde/unit-manager.png → doc/en/unit-manager.png

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

0
doc/en/qalculate_tde/units.docbook → doc/en/units.docbook

0
doc/en/qalculate_tde/variable-manager.png → doc/en/variable-manager.png

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

0
doc/en/qalculate_tde/variables.docbook → doc/en/variables.docbook

16
doc/man/qalculate-tde.1

@ -0,0 +1,16 @@
.TH QALC 1 "28 December 2008"
.SH NAME
qalculate-tde \- Powerful and easy to use desktop calculator
.SH SYNOPSIS
.B qalculate-tde
.SH DESCRIPTION
Qalculate! is a small and simple to use calculator but with much power and
versatility underneath. Features include customizable functions, units,
arbitrary precision using a one-line fault-tolerant expression entry.
.PP
\fBqalculate-tde\fP is the TDE version of Qalculate!.
.SH AUTHORS
Original qalculate-kde was written by Niklas Knutsson <nq@altern.org>.
.PP
This manual page was originally written by Vincent Legout <vincent@legout.info>,
for the Debian system (but may be used by others).

1
po/CMakeLists.txt

@ -0,0 +1 @@
tde_add_project_translations()

62
src/CMakeLists.txt

@ -0,0 +1,62 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${QALCULATE_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### qalculate-tde (executable)
tde_add_executable( qalculate-tde AUTOMOC
SOURCES
buttonwithindexsignal.cpp kqalculate.cpp
main.cpp preferences.cpp qalculatebuttonwithdata.cpp
qalculateconvertnumberbasesdialog.cpp
qalculateconvertunitsdialog.cpp qalculatedatasetsdialog.cpp
qalculatedecimalsdialog.cpp qalculateeditdataobjectdialog.cpp
qalculateeditdatasetdialog.cpp qalculateeditfunctiondialog.cpp
qalculateeditmatrixvectordialog.cpp qalculateeditnamesdialog.cpp
qalculateeditunitdialog.cpp qalculateeditunknownvariabledialog.cpp
qalculateeditvariabledialog.cpp qalculateexportcsvdialog.cpp
qalculateexpressionedit.cpp qalculatefunctionsdialog.cpp
qalculateimportcsvdialog.cpp qalculateinsertfunctiondialog.cpp
qalculateinsertmatrixvectordialog.cpp qalculate_tde_utils.cpp
qalculateperiodictabledialog.cpp qalculateplotdialog.cpp
qalculateprecisiondialog.cpp qalculatepreferencesdialog.cpp
qalculatesetbasedialog.cpp qalculateunitsdialog.cpp
qalculatevariablesdialog.cpp qalculateresultdisplay.cpp
LINK
tdecore-shared
tdeui-shared
tdeio-shared
${CMAKE_THREAD_LIBS_INIT}
${QALCULATE_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
##### icons
tde_install_icons( )
##### other data
install(
FILES qalculate_tdeui.rc
DESTINATION ${DATA_INSTALL_DIR}/qalculate_tde
)
tde_create_translated_desktop( qalculate_tde.desktop )

4
src/qalculateexpressionedit.cpp

@ -413,7 +413,7 @@ void QalculateExpressionEdit::keyPressEvent(TQKeyEvent *e) {
switch(e->key()) {
case Key_Period: {
if(e->state() == Keypad) {
insert(CALCULATOR->getDecimalPoint());
insert(CALCULATOR->getDecimalPoint().c_str());
e->accept();
return;
}
@ -421,7 +421,7 @@ void QalculateExpressionEdit::keyPressEvent(TQKeyEvent *e) {
}
case Key_Comma: {
if(e->state() == Keypad) {
insert(CALCULATOR->getDecimalPoint());
insert(CALCULATOR->getDecimalPoint().c_str());
e->accept();
return;
}

12
src/qalculateinsertmatrixvectordialog.cpp

@ -170,7 +170,7 @@ void QalculateInsertMatrixVectorDialog::slotOk() {
TQString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
if(!str2.isEmpty()) {
if(b) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b = true;
@ -186,7 +186,7 @@ void QalculateInsertMatrixVectorDialog::slotOk() {
bool b1 = false;
for(int index_r = 0; index_r < r; index_r++) {
if(b1) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b1 = true;
@ -195,7 +195,7 @@ void QalculateInsertMatrixVectorDialog::slotOk() {
bool b2 = false;
for(int index_c = 0; index_c < c; index_c++) {
if(b2) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b2 = true;
@ -219,7 +219,7 @@ void QalculateInsertMatrixVectorDialog::insertSelection() {
TQString str2 = elementsTable->text(index_r, index_c).stripWhiteSpace();
if(!str2.isEmpty()) {
if(b) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b = true;
@ -235,7 +235,7 @@ void QalculateInsertMatrixVectorDialog::insertSelection() {
bool b1 = false;
for(int index_r = sel.topRow(); index_r <= sel.bottomRow(); index_r++) {
if(b1) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b1 = true;
@ -244,7 +244,7 @@ void QalculateInsertMatrixVectorDialog::insertSelection() {
bool b2 = false;
for(int index_c = sel.leftCol(); index_c <= sel.rightCol(); index_c++) {
if(b2) {
matrixstr += CALCULATOR->getComma();
matrixstr += CALCULATOR->getComma().c_str();
matrixstr += " ";
} else {
b2 = true;

Loading…
Cancel
Save