Branch: master

db17d12f 2019-05-12 14:30:25 gregory guy
conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@...>
Signed-off-by: Slávek Banko <slavek.banko@...>
A CMakeLists.txt
A ConfigureChecks.cmake
A config.h.cmake
A doc/CMakeLists.txt
A doc/en/CMakeLists.txt
A doc/man/CMakeLists.txt
A doc/man/kchmviewer.1
A doc/tdeioslave/CMakeLists.txt
A doc/tdeioslave/en/CMakeLists.txt
A doc/tdeioslave/en/msits/CMakeLists.txt
A lib/CMakeLists.txt
A lib/chmlib/CMakeLists.txt
A lib/libchmfile/CMakeLists.txt
A lib/tdeio-msits/CMakeLists.txt
A po/CMakeLists.txt
A src/CMakeLists.txt
A src/pics/CMakeLists.txt
A src/tde/CMakeLists.txt
M lib/libchmfile/libchmfileimpl.cpp
M lib/libchmfile/libchmfileimpl.h
M lib/tdeio-msits/msits.cpp
M lib/tdeio-msits/msits.h
M src/kchmsearchengine_impl.cpp

CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f5d79d6
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,81 @@
+############################################
+#                                          #
+#  Improvements and feedbacks are welcome  #
+#                                          #
+#  This file is released under GPL >= 3    #
+#                                          #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+#### general package setup
+
+project( kchmviewer )
+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} )
+option( WITH_TDE "Build with TDE itegration instead of standalone TQt" ${WITH_ALL_OPTIONS}          )
+option( WITH_CHMLIB "Build with external chmlib" ${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( lib )
+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 )

ConfigureChecks.cmake

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..7ec4f10
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,51 @@
+###########################################
+#                                         #
+#  Improvements and feedback are welcome  #
+#                                         #
+#  This file is released under GPL >= 3   #
+#                                         #
+###########################################
+
+# required stuff
+find_package( TQt )
+if( WITH_TDE )
+  find_package( TDE )
+endif( )
+
+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 )
+
+
+##### build with TDE integration
+
+if( WITH_TDE )
+  set( USE_KDE 1 )
+endif( )
+
+
+##### check for chmlib
+
+if( WITH_CHMLIB )
+  check_include_file( "chm_lib.h" CHMLIB_INCLUDE )
+  find_library( CHMLIB_LIBRARIES NAMES chm )
+
+  if( NOT CHMLIB_LIBRARIES )
+     tde_message_fatal( "extern chmlib has been requested but was not found on your system" )
+  endif( NOT CHMLIB_LIBRARIES )
+  set( USE_BUILTIN_CHMLIB 0 )
+else( )
+  set( CHMLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/lib/chmlib )
+  set( CHMLIB_LIBRARIES chm-static )
+  set( USE_BUILTIN_CHMLIB 1 )
+endif( WITH_CHMLIB )

config.h.cmake

diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..6ec66d5
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,16 @@
+#define VERSION "@VERSION@"
+#define APP_NAME "@PROJECT_NAME@"
+#define APP_VERSION "3.1"
+
+// 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 build with TDE integration */
+#cmakedefine USE_KDE @USE_KDE@
+
+/* Defined if you use the builtin chmlib */
+#cmakedefine USE_BUILTIN_CHMLIB @USE_BUILTIN_CHMLIB@

doc/CMakeLists.txt

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..185eab9
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory( man )
+tde_conditional_add_subdirectory( WITH_TDE en )
+tde_conditional_add_subdirectory( WITH_TDE tdeioslave )

doc/en/CMakeLists.txt

diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt
new file mode 100644
index 0000000..ba3ef3e
--- /dev/null
+++ b/doc/en/CMakeLists.txt
@@ -0,0 +1 @@
+tde_create_handbook( DESTINATION ${PROJECT_NAME} )

doc/man/CMakeLists.txt

diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt
new file mode 100644
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
+)

doc/man/kchmviewer.1

diff --git a/doc/man/kchmviewer.1 b/doc/man/kchmviewer.1
new file mode 100644
index 0000000..5994f53
--- /dev/null
+++ b/doc/man/kchmviewer.1
@@ -0,0 +1,34 @@
+.\" Author: Jose Luis Tallon <jltallon@...>
+.\"
+.\" This is free software; you may redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as
+.\" published by the Free Software Foundation; either version 2,
+.\" or (at your option) any later version.
+.\"
+.\" This is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with the Debian GNU/Linux system; if not, write to the Free
+.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+.\" 02111-1307 USA
+.TH kchmviwer "1" "December 2005"
+.SH NAME
+kchmviewer \- Windows CHM viewer for TDE
+.SH SYNOPSIS
+kchmviewer
+.SH DESCRIPTION
+.B kchmviewer
+makes it possible to browse native Windows CHM files under TDE.
+.PP
+Complete documentation can be found in docbook format in
+/usr/share/doc/tde/HTML/<lang>/kchmviewer/ on this system.
+.SH AUTHOR
+ George Yunaev <gyunaev@...>
+.PP
+This manual page was written by Jose Luis Tallon 
+.nh
+<jltallon@adv\-solutions.net> 
+for the \fBDebian\fP system (but may be used by others).

doc/tdeioslave/CMakeLists.txt

diff --git a/doc/tdeioslave/CMakeLists.txt b/doc/tdeioslave/CMakeLists.txt
new file mode 100644
index 0000000..c938175
--- /dev/null
+++ b/doc/tdeioslave/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory( en )

doc/tdeioslave/en/CMakeLists.txt

diff --git a/doc/tdeioslave/en/CMakeLists.txt b/doc/tdeioslave/en/CMakeLists.txt
new file mode 100644
index 0000000..a91f2c1
--- /dev/null
+++ b/doc/tdeioslave/en/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory( msits )

doc/tdeioslave/en/msits/CMakeLists.txt

diff --git a/doc/tdeioslave/en/msits/CMakeLists.txt b/doc/tdeioslave/en/msits/CMakeLists.txt
new file mode 100644
index 0000000..fcbaa9b
** Diff limit reached (max: 250 lines) **
2ac18002 2019-05-12 14:30:29 Slávek Banko
Fix FTBFS for build with builtin libchm.

Signed-off-by: Slávek Banko <slavek.banko@...>
M lib/libchmfile/libchmfileimpl.cpp
M lib/tdeio-msits/msits.h
** Diff limit reached (max: 250 lines) **
f0a35341 2019-05-12 14:30:29 Slávek Banko
Fix FTBFS for build without TDE integration.

Signed-off-by: Slávek Banko <slavek.banko@...>
M src/kchmsetupdialog_impl.cpp
M src/tde-tqt.h
** Diff limit reached (max: 250 lines) **
c0263d89 2019-05-12 14:30:30 Slávek Banko
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@...>
M CMakeLists.txt
M lib/libchmfile/libchmfileimpl.cpp
M lib/libchmfile/libchmfileimpl.h
M lib/libchmfile/libchmurlfactory.h
M src/kchmmainwindow.cpp
** Diff limit reached (max: 250 lines) **

Branch: r14.0.x

ac9ac39f 2019-05-12 15:38:10 Slávek Banko
Fix FTBFS for build with builtin libchm.

Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit 2ac1800224d2870ae5129e8a09b3a190e77fa506)
M lib/libchmfile/libchmfileimpl.cpp
M lib/tdeio-msits/msits.h
** Diff limit reached (max: 250 lines) **
87aa164b 2019-05-12 15:38:10 Slávek Banko
Fix FTBFS for build without TDE integration.

Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit f0a3534123e54a962a4c7de7ebd332e6eae658d1)
M src/kchmsetupdialog_impl.cpp
M src/tde-tqt.h
** Diff limit reached (max: 250 lines) **
518045ae 2019-05-12 15:38:30 Slávek Banko
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit c0263d89c688f750a6e68a7f77257b2be0c55990)
M CMakeLists.txt
M lib/libchmfile/libchmfileimpl.cpp
M lib/libchmfile/libchmfileimpl.h
M lib/libchmfile/libchmurlfactory.h
M src/kchmmainwindow.cpp
** Diff limit reached (max: 250 lines) **