Browse Source

converios to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/1/head
gregory guy 1 year ago
parent
commit
a63b9b15ca
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
17 changed files with 263 additions and 0 deletions
  1. +93
    -0
      CMakeLists.txt
  2. +56
    -0
      ConfigureChecks.cmake
  3. +16
    -0
      config.h.cmake
  4. +1
    -0
      doc/CMakeLists.txt
  5. +1
    -0
      doc/en/CMakeLists.txt
  6. +8
    -0
      kkbswitch.upd/CMakeLists.txt
  7. +71
    -0
      kkbswitch/CMakeLists.txt
  8. +2
    -0
      kkbswitch/kbconfigdlg.cpp
  9. +2
    -0
      kkbswitch/kbpickicondlg.cpp
  10. +2
    -0
      kkbswitch/kbswitchapp.cpp
  11. +2
    -0
      kkbswitch/kbswitchintf.cpp
  12. +2
    -0
      kkbswitch/kbswitchtrayicon.cpp
  13. +2
    -0
      kkbswitch/singlewindowwatcher.cpp
  14. +1
    -0
      kkbswitch/windowclasswatcher.cpp
  15. +1
    -0
      kkbswitch/windowwatcher.cpp
  16. +2
    -0
      kkbswitch/xkeyboard.cpp
  17. +1
    -0
      po/CMakeLists.txt

+ 93
- 0
CMakeLists.txt View File

@@ -0,0 +1,93 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################


cmake_minimum_required( VERSION 2.8 )


#### general package setup

project( kkbswitch )
set( VERSION R14.1.0 )


#### include essential cmake modules

include( FindPkgConfig )
include( CheckFunctionExists )
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_RU_UA_LAYOUT "Add Russian and Ukrainian keyboard" ${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} )


##### 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" )


##### directories

add_subdirectory( ${PROJECT_NAME} )
add_subdirectory( ${PROJECT_NAME}.upd )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )


##### man page

INSTALL(
FILES ${PROJECT_NAME}.1
DESTINATION ${MAN_INSTALL_DIR}/man1
COMPONENT doc
)


##### icons

tde_install_icons( ${PROJECT_NAME} )


##### write configure files

configure_file( config.h.cmake config.h @ONLY )

+ 56
- 0
ConfigureChecks.cmake View File

@@ -0,0 +1,56 @@
###########################################
# #
# 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)


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
if( NOT UNIX )
tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
endif( NOT UNIX )
set( __KDE_HAVE_GCC_VISIBILITY 1 )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif( WITH_GCC_VISIBILITY )


#### check for libxkbfile

pkg_search_module( XKBFILE xkbfile )
if( NOT XKBFILE_FOUND )
tde_message_fatal( "xkbfile is required , but was not found on your system" )
else ( )
set( HAVE_X11_EXTENSIONS_XKBRULES_H 1 )
set( HAVE_LIBXKBFILE 1 )
endif()


##### gettext

if( BUILD_TRANSLATIONS )
include( FindGettext )
if( GETTEXT_FOUND )
set( MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT_EXECUTABLE}
CACHE FILEPATH "path to msgfmt executable" )
endif( GETTEXT_FOUND )
if( NOT MSGFMT_EXECUTABLE )
tde_message_fatal( "msgfmt is required but was not found on your system." )
endif( NOT MSGFMT_EXECUTABLE )
endif( BUILD_TRANSLATIONS )


+ 16
- 0
config.h.cmake View File

@@ -0,0 +1,16 @@
#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@


// Defined to 1 if we have libxkbfile library
#cmakedefine HAVE_LIBXKBFILE 1


// Defined to 1 if we have libxkbfile headers
#cmakedefine HAVE_X11_EXTENSIONS_XKBRULES_H 1

+ 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 ${PROJECT_NAME} )

+ 8
- 0
kkbswitch.upd/CMakeLists.txt View File

@@ -0,0 +1,8 @@
install(
FILES
${PROJECT_NAME}.upd
kkbswitch_update_14_icons
kkbswitch_update_14_options
DESTINATION ${DATA_INSTALL_DIR}/tdeconf_update
)

+ 71
- 0
kkbswitch/CMakeLists.txt View File

@@ -0,0 +1,71 @@
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}
)


##### kkbswitch (executable)

tde_add_executable( ${PROJECT_NAME} AUTOMOC

SOURCES
boldlistboxitem.cpp
boldmenuitem.cpp
kbconfig.cpp
kbconfigdlg.cpp
kbgroup.cpp
kbpickicondlg.cpp
kbswitchapp.cpp
kbswitchintf.cpp
kbswitchtrayicon.cpp
main.cpp
pathlistboxitem.cpp
xkeyboard.cpp
windowwatcher.cpp
singlewindowwatcher.cpp
windowclasswatcher.cpp
kbswitchintf.skel
LINK
tdeio-shared
tdeui-shared
tdecore-shared
${XKBFILE_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)


##### other data

install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${AUTOSTART_INSTALL_DIR}
)

install(
FILES ${PROJECT_NAME}.desktop
DESTINATION ${APPS_INSTALL_DIR}/Utilities
)

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


##### Russian - Ukrainian Layout

if( WITH_RU_UA_LAYOUT )
install(
FILES ru_ua
DESTINATION ${SHARE_INSTALL_PREFIX}/X11/xkb/symbols
)
endif( WITH_RU_UA_LAYOUT )

+ 2
- 0
kkbswitch/kbconfigdlg.cpp View File

@@ -406,3 +406,5 @@ void KBConfigDlg::checkIconDefault(int index)
btnSetDefaultIcon->setEnabled(!conf->readEntry(m_kbconf->getGroup(index)->getName()/*KBConfig::entryForGroup(index)*/).isNull());
}
}

#include "kbconfigdlg.moc"

+ 2
- 0
kkbswitch/kbpickicondlg.cpp View File

@@ -201,3 +201,5 @@ void KBPickIconDlg::showCurrentPath(const TQString &currentPath,
lbIcons->ensureCurrentVisible();
lbIcons->setHScrollBarMode(TQScrollView::Auto);
}

#include "kbpickicondlg.moc"

+ 2
- 0
kkbswitch/kbswitchapp.cpp View File

@@ -377,3 +377,5 @@ void KBSwitchApp::setGroups(int group, int next_group)
m_next_groupno = next_group;
forceSetGroup(group);
}

#include "kbswitchapp.moc"

+ 2
- 0
kkbswitch/kbswitchintf.cpp View File

@@ -49,3 +49,5 @@ TQStringList KBSwitchIntf::getGroupNames()
result.append(m_kbconf->getGroup(i)->getName());
return result;
}

#include "kbswitchintf.moc"

+ 2
- 0
kkbswitch/kbswitchtrayicon.cpp View File

@@ -198,3 +198,5 @@ void KBSwitchTrayIcon::slotUpdateIcons(){
void KBSwitchTrayIcon::slotHelp(){
kapp->invokeHelp();
}

#include "kbswitchtrayicon.moc"

+ 2
- 0
kkbswitch/singlewindowwatcher.cpp View File

@@ -71,3 +71,5 @@ void SingleWindowWatcher::reset()
addWindowToMap(active_window);
else m_active_window = m_window_map.end();
}

#include "singlewindowwatcher.moc"

+ 1
- 0
kkbswitch/windowclasswatcher.cpp View File

@@ -104,3 +104,4 @@ void WindowClassWatcher::reset()
else m_active_class = m_class_group_map.end();
}

#include "windowclasswatcher.moc"

+ 1
- 0
kkbswitch/windowwatcher.cpp View File

@@ -35,3 +35,4 @@ WindowWatcher::~WindowWatcher()
{
}

#include "windowwatcher.moc"

+ 2
- 0
kkbswitch/xkeyboard.cpp View File

@@ -244,3 +244,5 @@ void XKeyboard::XklLogAppender(const char file[], const char function[],
delete[] str;
}
#endif

#include "xkeyboard.moc"

+ 1
- 0
po/CMakeLists.txt View File

@@ -0,0 +1 @@
tde_create_translation( LANG auto OUTPUT_NAME ${PROJECT_NAME} )

Loading…
Cancel
Save