diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-27 20:25:58 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-27 20:25:58 -0600 |
commit | b939a1459ef0e4eec6d8dd111baf8e022d1b46a0 (patch) | |
tree | 4224eaba897295236c492b2fbf204a0f21ce38db | |
parent | e9402471a2f87071f972ec8a19be33716d5ada5d (diff) | |
download | abakus-b939a1459ef0e4eec6d8dd111baf8e022d1b46a0.tar.gz abakus-b939a1459ef0e4eec6d8dd111baf8e022d1b46a0.zip |
Initial conversion to standard CMake system
-rw-r--r-- | CMakeLists.txt | 76 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 30 | ||||
-rw-r--r-- | config.h.cmake | 6 | ||||
-rw-r--r-- | icons/CMakeLists.txt | 12 | ||||
-rw-r--r-- | icons/hi64-app-abakus.png (renamed from src/hi64-app-abakus.png) | bin | 7079 -> 7079 bytes | |||
-rw-r--r-- | po/CMakeLists.txt | 17 | ||||
-rw-r--r-- | src/CMakeLists.txt | 49 |
7 files changed, 190 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..53b078d --- /dev/null +++ b/CMakeLists.txt @@ -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 ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 0000000..16f316d --- /dev/null +++ b/ConfigureChecks.cmake @@ -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 ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 0000000..5d4c19d --- /dev/null +++ b/config.h.cmake @@ -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
\ No newline at end of file diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt new file mode 100644 index 0000000..fcacb7e --- /dev/null +++ b/icons/CMakeLists.txt @@ -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( ) diff --git a/src/hi64-app-abakus.png b/icons/hi64-app-abakus.png Binary files differindex 5644c45..5644c45 100644 --- a/src/hi64-app-abakus.png +++ b/icons/hi64-app-abakus.png diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt new file mode 100644 index 0000000..23c62d8 --- /dev/null +++ b/po/CMakeLists.txt @@ -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( ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..61f671b --- /dev/null +++ b/src/CMakeLists.txt @@ -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} +) |