summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2020-08-01 15:01:04 +0200
committergregory guy <gregory-tde@laposte.net>2020-08-01 15:02:43 +0200
commitd538a819341ec267ee10222c5e9315943f00008a (patch)
treeab64b4c5ad11f2206f0d0c3b7714a367a20fa29b
parent283e38f654e745ed47f5d11b91c5b4a6227ca751 (diff)
downloadmathemagics-d538a819341ec267ee10222c5e9315943f00008a.tar.gz
mathemagics-d538a819341ec267ee10222c5e9315943f00008a.zip
Conversion to the cmake building system.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
-rw-r--r--CMakeLists.txt76
-rw-r--r--ConfigureChecks.cmake26
-rw-r--r--config.h.cmake8
-rw-r--r--[-rwxr-xr-x]configure0
-rw-r--r--doc/CMakeLists.txt34
-rw-r--r--mathemagics/CMakeLists.txt44
-rw-r--r--mathemagics/pics/CMakeLists.txt3
7 files changed, 191 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..028421e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,76 @@
+############################################
+# #
+# Improvements and feedbacks are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+############################################
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+##### general package setup
+
+project( mathemagics )
+set( VERSION R14.1.0 )
+
+##### 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( )
+
+
+##### optional stuff
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+
+
+##### user requested modules
+
+option( BUILD_ALL "Build all" ON )
+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 "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
+set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
+
+
+##### source directories
+
+add_subdirectory( ${PROJECT_NAME} )
+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..0b84648
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,26 @@
+###########################################
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+###########################################
+
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+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 )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..61ede3a
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,8 @@
+#define VERSION "@VERSION@"
+
+// 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@
diff --git a/configure b/configure
index 3a01bdb..3a01bdb 100755..100644
--- a/configure
+++ b/configure
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..f6eec15
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,34 @@
+file( GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * )
+list( REMOVE_ITEM _dirs html man )
+
+string( REGEX REPLACE "[ \r\n\t]+" ";" _linguas "$ENV{LINGUAS}" )
+
+foreach( _dir IN LISTS _dirs )
+ if( IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_dir}
+ AND ( "${_dir}" STREQUAL "en" OR
+ "${_linguas}" MATCHES "^;*$" OR
+ ";${_linguas};" MATCHES ";${_dir};" ))
+ file( GLOB _doc_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${_dir} ${_dir}/*.docbook )
+ if( _doc_files )
+ list( FIND _doc_files "index.docbook" _find_index )
+ if( -1 EQUAL _find_index )
+ set( _noindex "NOINDEX" )
+ else()
+ unset( _noindex )
+ endif()
+ tde_create_handbook(
+ SOURCE_BASEDIR ${_dir}
+ ${_noindex}
+ LANG ${_dir}
+ DESTINATION ${PROJECT_NAME}
+ )
+ endif()
+ endif()
+endforeach()
+
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/html/CMakeLists.txt )
+ add_subdirectory( html )
+endif()
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/man/CMakeLists.txt )
+ add_subdirectory( man )
+endif()
diff --git a/mathemagics/CMakeLists.txt b/mathemagics/CMakeLists.txt
new file mode 100644
index 0000000..3dd9994
--- /dev/null
+++ b/mathemagics/CMakeLists.txt
@@ -0,0 +1,44 @@
+add_subdirectory( pics )
+
+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}
+)
+
+
+##### mathemagics (executable)
+
+tde_add_executable( mathemagics AUTOMOC
+
+ SOURCES
+ main.cpp
+ mathemagics.cpp
+ optiondialog.cpp
+ stacklevel.cpp
+ keypad.cpp
+ kparanoidline.cpp
+ LINK
+ tdeio-shared
+ tdeui-shared
+ tdecore-shared
+
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+install(
+ FILES mathemagicsui.rc
+ DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
+)
+
+tde_create_translated_desktop( ${PROJECT_NAME}.desktop )
diff --git a/mathemagics/pics/CMakeLists.txt b/mathemagics/pics/CMakeLists.txt
new file mode 100644
index 0000000..dd8e9ff
--- /dev/null
+++ b/mathemagics/pics/CMakeLists.txt
@@ -0,0 +1,3 @@
+##### icons
+
+tde_install_icons( )