Browse Source

conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/1/head
gregory guy 1 year ago
parent
commit
48dfd726a2
No known key found for this signature in database GPG Key ID: 6EFE0EF249A874C0
13 changed files with 286 additions and 1 deletions
  1. +86
    -0
      CMakeLists.txt
  2. +39
    -0
      ConfigureChecks.cmake
  3. +20
    -0
      config.h.cmake
  4. +1
    -0
      doc/CMakeLists.txt
  5. +1
    -0
      doc/en/CMakeLists.txt
  6. +2
    -0
      src/CMakeLists.txt
  7. +39
    -0
      src/kcm/CMakeLists.txt
  8. +60
    -0
      src/knemod/CMakeLists.txt
  9. +28
    -0
      src/knemod/backends/CMakeLists.txt
  10. +1
    -0
      src/knemod/backends/nettoolsbackend.cpp
  11. +1
    -1
      src/knemod/interfacestatistics.cpp
  12. +1
    -0
      src/knemod/pics/CMakeLists.txt
  13. +7
    -0
      translations/CMakeLists.txt

+ 86
- 0
CMakeLists.txt View File

@@ -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 )

+ 39
- 0
ConfigureChecks.cmake View File

@@ -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 )

+ 20
- 0
config.h.cmake View File

@@ -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@

+ 1
- 0
doc/CMakeLists.txt View File

@@ -0,0 +1 @@
add_subdirectory( en )

+ 1
- 0
doc/en/CMakeLists.txt View File

@@ -0,0 +1 @@
tde_create_handbook( DESTINATION kcontrol/${PROJECT_NAME} )

+ 2
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,2 @@
add_subdirectory( kcm )
add_subdirectory( knemod )

+ 39
- 0
src/kcm/CMakeLists.txt View File

@@ -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}
)

+ 60
- 0
src/knemod/CMakeLists.txt View File

@@ -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(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)


##### kded_knemod (kpart)

tde_add_kpart( kded_knemod AUTOMOC

SOURCES
interfacestatusdlg.ui
interfacestatisticsdlg.ui
knemodaemon.skel
knemodaemon.cpp
interface.cpp
interfaceicon.cpp
interfacetray.cpp
interfacemonitor.cpp
interfacestatusdialog.cpp
interfacetooltip.cpp
signalplotter.cpp
interfacestatistics.cpp
interfacestatisticsdialog.cpp
LINK
tdecore-shared
tdeio-shared
tdeui-shared
tdeutils-shared
tdeinit_kded
knemo_backends-static

DESTINATION ${PLUGIN_INSTALL_DIR}
)


##### other data

install(
FILES eventsrc
DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)

install(
FILES knemod.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/kded
)

+ 28
- 0
src/knemod/backends/CMakeLists.txt View File

@@ -0,0 +1,28 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/src/common
${CMAKE_SOURCE_DIR}/src/knemod
)

link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)


##### knemo_backends (static)

tde_add_library( knemo_backends STATIC_PIC AUTOMOC

SOURCES
backendbase.cpp
nettoolsbackend.cpp
sysbackend.cpp
LINK
tdeio-shared
${IW_LIBRARIES}
)

+ 1
- 0
src/knemod/backends/nettoolsbackend.cpp View File

@@ -496,3 +496,4 @@ void NetToolsBackend::parseRouteOutput()
}
}
}
#include "nettoolsbackend.moc"

+ 1
- 1
src/knemod/interfacestatistics.cpp View File

@@ -381,4 +381,4 @@ void InterfaceStatistics::updateCurrentYear()
mYearStatistics.append( mCurrentYear ); // TODO: insert at correct position
emit yearStatisticsChanged();
}
#include "interfacestatistics.moc"

+ 1
- 0
src/knemod/pics/CMakeLists.txt View File

@@ -0,0 +1 @@
tde_install_icons( )

+ 7
- 0
translations/CMakeLists.txt View File

@@ -0,0 +1,7 @@
file( GLOB_RECURSE po_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po )

foreach( _po ${po_files} )
string( REPLACE "/" ";" _path "${_po}" )
list( GET _path 0 _lang )
tde_create_translation( FILES ${_po} LANG ${_lang} )
endforeach( )

Loading…
Cancel
Save