Initial conversion to standard CMake system

pull/1/head
Timothy Pearson 13 years ago
parent e9402471a2
commit b939a1459e

@ -0,0 +1,76 @@
#################################################
#
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
cmake_minimum_required( VERSION 2.8 )
##### general package setup #####################
project( abakus )
##### include essential cmake modules ###########
include( CheckCXXSourceCompiles )
include( CheckFunctionExists )
include( CheckIncludeFileCXX )
include( CheckLibraryExists )
include( CheckStructHasMember )
include( CheckSymbolExists )
include( CheckTypeSize )
include( FindPkgConfig )
##### include our cmake modules #################
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
##### setup install paths #######################
include( TDESetupPaths )
tde_setup_paths( )
##### user requested modules ####################
option( BUILD_ALL "Build all" OFF )
option( BUILD_DOC "Build doc" ${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" )
##### source 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 )

@ -0,0 +1,30 @@
#################################################
#
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
find_program( MSGFMT_EXECUTABLE msgfmt )
if( NOT MSGFMT_EXECUTABLE )
tde_message_fatal( "msgfmt program is required, but was not found on your system" )
endif( )
endif( )
check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
check_include_file( stdint.h HAVE_STDINT_H )
check_include_file( systems.h HAVE_SYSTEMS_H )
check_include_file( linux/inotify.h HAVE_INOTIFY )
check_function_exists( statvfs HAVE_STATVFS )
# common required stuff
find_package( TQt )
find_package( TDE )

@ -0,0 +1,6 @@
#cmakedefine SIZEOF_INT @SIZEOF_INT@
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_SYSTEMS_H 1
#cmakedefine HAVE_STATVFS 1
#cmakedefine HAVE_MPFR 1

@ -0,0 +1,12 @@
#################################################
#
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
tde_install_icons( )

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

@ -0,0 +1,17 @@
#################################################
#
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} abakus.po )
foreach( _po ${po_files} )
get_filename_component( _lang ${_po} PATH )
tde_create_translation( FILES ${_po} LANG ${_lang} )
endforeach( )

@ -0,0 +1,49 @@
#################################################
#
# (C) 2011 Timothy Pearson
# kb9vqf (AT) pearsoncomputing.net
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
include_directories(
${TQT_INCLUDE_DIRS}
${TDE_INCLUDE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
)
link_directories(
${TQT_LIBRARY_DIRS}
)
##### other data ################################
install( FILES abakus.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES abakusui.rc DESTINATION ${DATA_INSTALL_DIR} )
##### abakus (executable) #######################
if( HAVE_MPFR )
MPFR_SOURCES="hmath.cpp number.c"
MPFR_LIBRARIES="mpfr gmp"
endif( HAVE_MPFR )
tde_add_executable( abakus AUTOMOC
SOURCES abakus.cpp abakuslistview.cpp
dragsupport.cpp editor.cpp
evaluator.cpp function.cpp
lexer_lex.cpp mainwindow.cpp
node.cpp numerictypes.cpp
parser_yacc.cpp result.cpp
resultlistview.cpp resultlistviewtext.cpp
rpnmuncher.cpp valuemanager.cpp dcopIface.skel
${MPFR_SOURCES}
LINK kio-shared tdecore-shared tdeprint-shared tdeui-shared DCOP-shared ${MPFR_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
Loading…
Cancel
Save