conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
gregory guy 6 years ago committed by Slávek Banko
parent 45746889b1
commit db17d12f24
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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 )

@ -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 )

@ -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@

@ -0,0 +1,3 @@
add_subdirectory( man )
tde_conditional_add_subdirectory( WITH_TDE en )
tde_conditional_add_subdirectory( WITH_TDE tdeioslave )

@ -0,0 +1 @@
tde_create_handbook( DESTINATION ${PROJECT_NAME} )

@ -0,0 +1,5 @@
INSTALL(
FILES ${PROJECT_NAME}.1
DESTINATION ${MAN_INSTALL_DIR}/man1
COMPONENT doc
)

@ -0,0 +1,34 @@
.\" Author: Jose Luis Tallon <jltallon@adv-solutions.net>
.\"
.\" 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@ulduzsoft.com>
.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).

@ -0,0 +1 @@
add_subdirectory( en )

@ -0,0 +1 @@
add_subdirectory( msits )

@ -0,0 +1 @@
tde_create_handbook( DESTINATION tdeioslave/msits )

@ -0,0 +1,3 @@
add_subdirectory( libchmfile )
tde_conditional_add_subdirectory( USE_BUILTIN_CHMLIB chmlib )
tde_conditional_add_subdirectory( WITH_TDE tdeio-msits )

@ -0,0 +1,22 @@
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}
)
##### chm (static)
tde_add_library( chm STATIC_PIC
SOURCES
chm_lib.c
lzx.c
)

@ -0,0 +1,28 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CHMLIB_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### chmfile (static)
tde_add_library( chmfile STATIC_PIC
SOURCES
libchmfile.cpp
libchmfile_search.cpp
libchmfileimpl.cpp
libchmtextencoding.cpp
libchmtocimage.cpp
DESTINATION ${LIB_INSTALL_DIR}
)

@ -27,7 +27,11 @@
#include <tqapplication.h> #include <tqapplication.h>
#include "config.h" #include "config.h"
#if USE_BUILTIN_CHMLIB
#include "chm_lib.h" #include "chm_lib.h"
#else
#include <chm_lib.h>
#endif
#include "bitfiddle.h" #include "bitfiddle.h"
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmurlfactory.h" #include "libchmurlfactory.h"

@ -19,9 +19,11 @@
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/ ***************************************************************************/
#if USE_BUILTIN_CHMLIB
#include "chm_lib.h" #include "chm_lib.h"
#else
#include <chm_lib.h>
#endif
#include "libchmfile.h" #include "libchmfile.h"
#include "libchmtocimage.h" #include "libchmtocimage.h"

@ -0,0 +1,42 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CHMLIB_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/lib/libchmfile
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### tdeio_msits (kpart)
tde_add_kpart( tdeio_msits
SOURCES
msits.cpp
LINK
tdeio-shared
tdecore-shared
${CHMLIB_LIBRARIES}
DESTINATION ${PLUGIN_INSTALL_DIR}
)
##### other data
install(
FILES msits.protocol
DESTINATION ${SERVICES_INSTALL_DIR}
)
install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${APPS_INSTALL_DIR}
)

@ -40,7 +40,7 @@ using namespace TDEIO;
extern "C" extern "C"
{ {
int kdemain( int argc, char **argv ) KDE_EXPORT int kdemain( int argc, char **argv )
{ {
kdDebug() << "*** tdeio_msits Init" << endl; kdDebug() << "*** tdeio_msits Init" << endl;

@ -30,8 +30,11 @@
#include <tqcstring.h> #include <tqcstring.h>
#include "config.h" #include "config.h"
#if USE_BUILTIN_CHMLIB
#include "chm_lib.h" #include "chm_lib.h"
#else
#include <chm_lib.h>
#endif
class ProtocolMSITS : public TDEIO::SlaveBase class ProtocolMSITS : public TDEIO::SlaveBase
{ {

@ -0,0 +1,5 @@
file( GLOB _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )
if( _srcs )
tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )
endif( )

@ -0,0 +1,77 @@
add_subdirectory( pics )
tde_conditional_add_subdirectory( WITH_TDE tde )
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CHMLIB_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/lib/libchmfile
${CMAKE_SOURCE_DIR}/src
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### kchmviewer (executable)
if( WITH_TDE )
set( BASE_LIBRARIES
tdecore-shared
tdeui-shared
tdeio-shared
tdehtml-shared
tdeparts-shared
)
set( TDEEXTRA_LIBRARIES kdeextra-static )
else( )
set( BASE_LIBRARIES ${TQT_LIBRARIES} )
set( TDEEXTRA_LIBRARIES "" )
endif( )
tde_add_executable( ${PROJECT_NAME} AUTOMOC
SOURCES
kchmsetupdialog.ui
iconstorage.cpp
kchmbookmarkwindow.cpp
kchmconfig.cpp
kchmindexwindow.cpp
kchmmainwindow.cpp
kchmsearchtoolbar.cpp
kchmsearchwindow.cpp
kchmsettings.cpp
kchmsourcefactory.cpp
kchmtreeviewitem.cpp
kchmviewwindow.cpp
main.cpp
kchmdialogchooseurlfromlist.cpp
tde-tqt.cpp
kchmviewwindow_qtextbrowser.cpp
kqtempfile.cpp
kchmnavtoolbar.cpp
kchmviewwindowmgr.cpp
kchmkeyeventfilter.cpp
kchmcontentswindow.cpp
kchmsearchengine_impl.cpp
kchmsearchengine.cpp
kchmsetupdialog_impl.cpp
LINK
${BASE_LIBRARIES}
${TDEEXTRA_LIBRARIES}
chmfile-static
${CHMLIB_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
##### icons
tde_install_icons( )

@ -570,3 +570,4 @@ bool Index::searchForPhrases( const TQStringList &phrases, const TQStringList &w
}; };
#include "kchmsearchengine_impl.moc"

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

@ -0,0 +1,27 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/lib/libchmfile
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### kdeextra (static)
tde_add_library( kdeextra STATIC_PIC AUTOMOC
SOURCES
kchmdcopiface.skel
kchmdcopiface.cpp
kchmviewwindow_tdehtmlpart.cpp
DESTINATION ${LIB_INSTALL_DIR}
)
Loading…
Cancel
Save