converios to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/1/head
gregory guy 6 years ago committed by Slávek Banko
parent 3050c585ec
commit a63b9b15ca
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

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

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

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

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

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

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

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

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

@ -377,3 +377,5 @@ void KBSwitchApp::setGroups(int group, int next_group)
m_next_groupno = next_group;
forceSetGroup(group);
}
#include "kbswitchapp.moc"

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

@ -198,3 +198,5 @@ void KBSwitchTrayIcon::slotUpdateIcons(){
void KBSwitchTrayIcon::slotHelp(){
kapp->invokeHelp();
}
#include "kbswitchtrayicon.moc"

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

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

@ -35,3 +35,4 @@ WindowWatcher::~WindowWatcher()
{
}
#include "windowwatcher.moc"

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

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