Browse Source

Initial conversion to standard CMake system

tags/r14.0.0
Timothy Pearson 7 years ago
parent
commit
b939a1459e
7 changed files with 190 additions and 0 deletions
  1. 76
    0
      CMakeLists.txt
  2. 30
    0
      ConfigureChecks.cmake
  3. 6
    0
      config.h.cmake
  4. 12
    0
      icons/CMakeLists.txt
  5. 0
    0
      icons/hi64-app-abakus.png
  6. 17
    0
      po/CMakeLists.txt
  7. 49
    0
      src/CMakeLists.txt

+ 76
- 0
CMakeLists.txt View File

@@ -0,0 +1,76 @@
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+cmake_minimum_required( VERSION 2.8 )
13
+
14
+
15
+##### general package setup #####################
16
+
17
+project( abakus )
18
+
19
+
20
+##### include essential cmake modules ###########
21
+
22
+include( CheckCXXSourceCompiles )
23
+include( CheckFunctionExists )
24
+include( CheckIncludeFileCXX )
25
+include( CheckLibraryExists )
26
+include( CheckStructHasMember )
27
+include( CheckSymbolExists )
28
+include( CheckTypeSize )
29
+include( FindPkgConfig )
30
+
31
+
32
+##### include our cmake modules #################
33
+
34
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
35
+include( TDEMacros )
36
+
37
+
38
+##### setup install paths #######################
39
+
40
+include( TDESetupPaths )
41
+tde_setup_paths( )
42
+
43
+
44
+##### user requested modules ####################
45
+
46
+option( BUILD_ALL "Build all" OFF )
47
+option( BUILD_DOC "Build doc" ${BUILD_ALL} )
48
+option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
49
+
50
+
51
+##### configure checks ##########################
52
+
53
+include( ConfigureChecks.cmake )
54
+
55
+
56
+###### global compiler settings #################
57
+
58
+add_definitions(
59
+  -DHAVE_CONFIG_H
60
+)
61
+
62
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
63
+set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
64
+set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
65
+
66
+
67
+##### source directories ########################
68
+
69
+add_subdirectory( src )
70
+tde_conditional_add_subdirectory( BUILD_DOC doc )
71
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
72
+
73
+
74
+##### write configure files #####################
75
+
76
+configure_file( config.h.cmake config.h @ONLY )

+ 30
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,30 @@
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
13
+  find_program( MSGFMT_EXECUTABLE msgfmt )
14
+  if( NOT MSGFMT_EXECUTABLE )
15
+    tde_message_fatal( "msgfmt program is required, but was not found on your system" )
16
+  endif( )
17
+endif( )
18
+
19
+check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
20
+check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
21
+
22
+check_include_file( stdint.h HAVE_STDINT_H )
23
+check_include_file( systems.h HAVE_SYSTEMS_H )
24
+check_include_file( linux/inotify.h HAVE_INOTIFY )
25
+
26
+check_function_exists( statvfs HAVE_STATVFS )
27
+
28
+# common required stuff
29
+find_package( TQt )
30
+find_package( TDE )

+ 6
- 0
config.h.cmake View File

@@ -0,0 +1,6 @@
1
+#cmakedefine SIZEOF_INT @SIZEOF_INT@
2
+#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
3
+#cmakedefine HAVE_STDINT_H 1
4
+#cmakedefine HAVE_SYSTEMS_H 1
5
+#cmakedefine HAVE_STATVFS 1
6
+#cmakedefine HAVE_MPFR 1

+ 12
- 0
icons/CMakeLists.txt View File

@@ -0,0 +1,12 @@
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+tde_install_icons( )

src/hi64-app-abakus.png → icons/hi64-app-abakus.png View File


+ 17
- 0
po/CMakeLists.txt View File

@@ -0,0 +1,17 @@
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} abakus.po )
13
+
14
+foreach( _po ${po_files} )
15
+  get_filename_component( _lang ${_po} PATH )
16
+  tde_create_translation( FILES ${_po} LANG ${_lang} )
17
+endforeach( )

+ 49
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,49 @@
1
+#################################################
2
+#
3
+#  (C) 2011 Timothy Pearson
4
+#  kb9vqf (AT) pearsoncomputing.net
5
+#
6
+#  Improvements and feedback are welcome
7
+#
8
+#  This file is released under GPL >= 2
9
+#
10
+#################################################
11
+
12
+include_directories(
13
+  ${TQT_INCLUDE_DIRS}
14
+  ${TDE_INCLUDE_DIR}
15
+  ${CMAKE_BINARY_DIR}
16
+  ${CMAKE_BINARY_DIR}/src
17
+  ${CMAKE_SOURCE_DIR}/src
18
+)
19
+
20
+link_directories(
21
+  ${TQT_LIBRARY_DIRS}
22
+)
23
+
24
+
25
+##### other data ################################
26
+
27
+install( FILES abakus.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
28
+install( FILES abakusui.rc DESTINATION ${DATA_INSTALL_DIR} )
29
+
30
+##### abakus (executable) #######################
31
+
32
+if( HAVE_MPFR )
33
+  MPFR_SOURCES="hmath.cpp number.c"
34
+  MPFR_LIBRARIES="mpfr gmp"
35
+endif( HAVE_MPFR )
36
+
37
+tde_add_executable( abakus AUTOMOC
38
+  SOURCES abakus.cpp abakuslistview.cpp
39
+    dragsupport.cpp editor.cpp
40
+    evaluator.cpp function.cpp
41
+    lexer_lex.cpp mainwindow.cpp
42
+    node.cpp numerictypes.cpp
43
+    parser_yacc.cpp result.cpp
44
+    resultlistview.cpp resultlistviewtext.cpp
45
+    rpnmuncher.cpp valuemanager.cpp dcopIface.skel
46
+    ${MPFR_SOURCES}
47
+  LINK kio-shared tdecore-shared tdeprint-shared tdeui-shared DCOP-shared ${MPFR_LIBRARIES}
48
+  DESTINATION ${BIN_INSTALL_DIR}
49
+)

Loading…
Cancel
Save