Branch: master

48dfd726 2019-04-23 10:57:40 gregory guy
conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@...>
A CMakeLists.txt
A ConfigureChecks.cmake
A config.h.cmake
A doc/CMakeLists.txt
A doc/en/CMakeLists.txt
A src/CMakeLists.txt
A src/kcm/CMakeLists.txt
A src/knemod/CMakeLists.txt
A src/knemod/backends/CMakeLists.txt
A src/knemod/pics/CMakeLists.txt
A translations/CMakeLists.txt
M src/knemod/backends/nettoolsbackend.cpp
M src/knemod/interfacestatistics.cpp

CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..33a9506
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,86 @@
+############################################
+#                                          #
+#  Improvements and feedbacks are welcome  #
+#                                          #
+#  This file is released under GPL >= 3    #
+#                                          #
+############################################
+
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+#### general package setup
+
+project( knemo )
+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_LIBIW "Enable build with libiw" ${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} )
+
+
+##### user defined options
+
+set( PATH_IFCONFIG "/sbin/ifconfig" CACHE STRING "Path for the ifconfig program" )
+set( PATH_IWCONFIG "/sbin/iwconfig" CACHE STRING "Path for the iwconfig program" )
+set( PATH_ROUTE    "/sbin/route"    CACHE STRING "Path for the route program"    )
+
+
+##### 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" )
+
+
+##### directories
+
+add_subdirectory( src )
+tde_conditional_add_subdirectory( BUILD_DOC doc                   )
+tde_conditional_add_subdirectory( BUILD_TRANSLATIONS translations ) 
+
+
+##### write configure files
+
+configure_file( config.h.cmake config.h @ONLY )

ConfigureChecks.cmake

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..71c36d8
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,39 @@
+###########################################
+#                                         #
+#  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 )
+
+
+##### support for libiw
+
+if( WITH_LIBIW )
+check_include_file( "iwlib.h" IW_HEADER )
+find_library( IW_LIBRARIES NAMES iw )
+
+if( IW_HEADER AND IW_LIBRARIES )
+   set( HAVE_LIBIW 1 )
+    else()
+   tde_message_fatal( "libiw support is requested but was not found on your system" )
+endif( IW_HEADER AND IW_LIBRARIES )
+endif( WITH_LIBIW )

config.h.cmake

diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..791fded
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,20 @@
+#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@
+
+/* Path for the ifconfig program */
+#cmakedefine PATH_IFCONFIG "@PATH_IFCONFIG@"
+
+/* Path path for the iwconfig program */
+#cmakedefine PATH_IWCONFIG "@PATH_IWCONFIG@"
+
+/* Path for the route program */
+#cmakedefine PATH_ROUTE "@PATH_ROUTE@"
+
+/* Defined if you have the <iwlib.h> header */
+#cmakedefine HAVE_LIBIW @HAVE_LIBIW@

doc/CMakeLists.txt

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..c938175
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory( en )

doc/en/CMakeLists.txt

diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt
new file mode 100644
index 0000000..16ccf18
--- /dev/null
+++ b/doc/en/CMakeLists.txt
@@ -0,0 +1 @@
+tde_create_handbook( DESTINATION kcontrol/${PROJECT_NAME} )

src/CMakeLists.txt

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..825e5b4
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory( kcm    )
+add_subdirectory( knemod )

src/kcm/CMakeLists.txt

diff --git a/src/kcm/CMakeLists.txt b/src/kcm/CMakeLists.txt
new file mode 100644
index 0000000..9a039be
--- /dev/null
+++ b/src/kcm/CMakeLists.txt
@@ -0,0 +1,39 @@
+include_directories(
+  ${CMAKE_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${TDE_INCLUDE_DIR}
+  ${TQT_INCLUDE_DIRS}
+  ${CMAKE_SOURCE_DIR}/src/knemod/backends
+  ${CMAKE_SOURCE_DIR}/src/common
+)
+
+link_directories(
+  ${TQT_LIBRARY_DIRS}
+  ${TDE_LIB_DIR}
+)
+
+
+##### kcm_knemo (kpart)
+
+tde_add_kpart( kcm_knemo AUTOMOC
+
+  SOURCES
+        configdlg.ui
+        configdialog.cpp
+        
+  LINK
+     tdecore-shared
+     tdeui-shared
+     tdeio-shared
+
+  DESTINATION ${PLUGIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+install(
+    FILES kcm_knemo.desktop
+    DESTINATION ${XDG_APPS_INSTALL_DIR}
+)

src/knemod/CMakeLists.txt

diff --git a/src/knemod/CMakeLists.txt b/src/knemod/CMakeLists.txt
new file mode 100644
index 0000000..648d40c
--- /dev/null
+++ b/src/knemod/CMakeLists.txt
@@ -0,0 +1,60 @@
+add_subdirectory( pics     )
+add_subdirectory( backends )
+
+include_directories(
+  ${CMAKE_BINARY_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${TDE_INCLUDE_DIR}
+  ${TQT_INCLUDE_DIRS}
+  ${CMAKE_SOURCE_DIR}/src/knemod/backends
+  ${CMAKE_SOURCE_DIR}/src/common
+)
+
+link_directories(
** Diff limit reached (max: 250 lines) **
6107abd7 2019-05-04 16:53:21 Slávek Banko
cmake: Search for ifconfig, route, and iwconfig
instead of using predefined paths.

Signed-off-by: Slávek Banko <slavek.banko@...>
M CMakeLists.txt
M ConfigureChecks.cmake
** Diff limit reached (max: 250 lines) **
a775e20c 2019-05-04 16:53:26 Slávek Banko
Add includes to UI files to resolve FTBFS.

Signed-off-by: Slávek Banko <slavek.banko@...>
M src/kcm/configdlg.ui
** Diff limit reached (max: 250 lines) **

Branch: r14.0.x

e9678645 2019-05-04 17:01:36 Slávek Banko
cmake: Search for ifconfig, route, and iwconfig
instead of using predefined paths.

Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit 6107abd74fa2f26194eef7c2b4ba26d728a7c4be)
M CMakeLists.txt
M ConfigureChecks.cmake
** Diff limit reached (max: 250 lines) **
1fafcd13 2019-05-04 17:01:36 Slávek Banko
Add includes to UI files to resolve FTBFS.

Signed-off-by: Slávek Banko <slavek.banko@...>
(cherry picked from commit a775e20ccd5e2c1144b4ed8444b5c2bd4a038d5c)
M src/kcm/configdlg.ui
** Diff limit reached (max: 250 lines) **