Commit 20b831e1 authored by Pino Toscano's avatar Pino Toscano

remove the unneeded config.h; cleanup the top-level CMakeLists.txt

svn path=/trunk/playground/games/ksirk/; revision=646226
parent 6f346928
project(ksirk)
find_package(KDE4 REQUIRED)
include (KDE4Defaults)
include (MacroLibrary)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
#add_definitions (${QT_DEFINITIONS} -DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1 -fexceptions)
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1 -fexceptions)
add_definitions(${KDE4_ENABLE_EXCEPTIONS})
remove_definitions(-DQT_NO_STL)
link_directories (${KDE4_LIB_DIR})
include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
# Create config.h
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
include (ConfigureChecks.cmake)
configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
MESSAGE(STATUS "currently finishing the porting of KsirK to kde4")
add_subdirectory(ksirk)
macro_display_feature_log()
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)
include(CheckLibraryExists)
# include(CheckPrototypeExists)
# include(CheckStructMember)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)
# The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
# definitions like _GNU_SOURCE that are needed on each platform.
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
macro_bool_to_01(X11_Xrandr_FOUND HAVE_XRANDR) # kwin
macro_bool_to_01(X11_Xcomposite_FOUND HAVE_XCOMPOSITE) # kicker
macro_bool_to_01(X11_Xdamage_FOUND HAVE_XDAMAGE) # kwin
macro_bool_to_01(X11_Xcursor_FOUND HAVE_XCURSOR) # many uses in workspace/
macro_bool_to_01(X11_Xfixes_FOUND HAVE_XFIXES) # klipper, kicker
macro_bool_to_01(X11_Xxf86misc_FOUND HAVE_XF86MISC) # kdesktop and kcontrol/lock
macro_bool_to_01(X11_Xrender_FOUND HAVE_XRENDER) # kcontrol/style, konsole, kicker
macro_bool_to_01(X11_Xscreensaver_FOUND HAVE_XSCREENSAVER) # kdesktop
macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST) # khotkeys, kxkb, kdm
macro_bool_to_01(FONTCONFIG_FOUND HAVE_FONTCONFIG) # kcontrol/{fonts,kfontinst}
macro_bool_to_01(X11_dpms_FOUND HAVE_DPMS) # kdesktop
#now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro
# If definitions like -D_GNU_SOURCE are needed for these checks they
# should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally
# defined outside this file. Here we include these definitions in
# CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of
# checks below.
set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})
if (WIN32)
set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES} )
set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES} )
endif (WIN32)
check_include_files(devinfo.h HAVE_DEVINFO_H) # kcontrol/infocenter
check_include_files(fstab.h HAVE_FSTAB_H) # kcontrol/infocenter
check_include_files("sys/types.h;libutil.h" HAVE_LIBUTIL_H) # fish
check_include_files(limits.h HAVE_LIMITS_H) # kdm, ksmserver
check_include_files(linux/raw.h HAVE_LINUX_RAW_H) # kcontrol/infocenter
check_include_files(mntent.h HAVE_MNTENT_H) # kcontrol/infocenter
check_include_files(paths.h HAVE_PATHS_H) # kcheckpass
check_include_files(pty.h HAVE_PTY_H) # fish
check_include_files(sasl.h HAVE_SASL_H) # kioslave/ldap
check_include_files(sasl/sasl.h HAVE_SASL_SASL_H) # kioslave/ldap
check_include_files(string.h HAVE_STRING_H) # kioslave/floppy kioslave/man (but is this really needed?)
check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H) # fish, kcontrol/infocenter
check_include_files(sys/loadavg.h HAVE_SYS_LOADAVG_H) # kasbar
check_include_files(sys/raw.h HAVE_SYS_RAW_H) # kcontrol/infocenter
check_include_files(sys/select.h HAVE_SYS_SELECT_H) # kdesu and kioslaves (pop3 sftp thumbnail)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) # kioslave/smtp kcontrol(kio/socks)
check_include_files(sys/sockio.h HAVE_SYS_SOCKIO_H) # kcontrol/infocenter
check_include_files(sys/stat.h HAVE_SYS_STAT_H) # kioslave/tar (needed?)
check_include_files(sys/time.h HAVE_SYS_TIME_H) # ksmserver, ksplashml, sftp
check_include_files(sys/types.h HAVE_SYS_TYPES_H) # kioslave, kcontrol(kio/socks)
check_include_files(sys/wait.h HAVE_SYS_WAIT_H) # kdesu
check_include_files(termios.h HAVE_TERMIOS_H) # fish, kdm
check_include_files(termio.h HAVE_TERMIO_H) # kdm
check_include_files(unistd.h HAVE_UNISTD_H) # kioslave/man - unneeded
check_include_files(util.h HAVE_UTIL_H) # fish
check_include_files(linux/cdrom.h COMPILE_LINUXCDPOLLING) # kioslave/media
check_include_files(Alib.h HAVE_ALIB_H) # kcontrol/infocenter
check_include_files("sys/time.h;time.h" TIME_WITH_SYS_TIME) # ksplashml (unneeded?)
check_include_files(X11/fonts/fontenc.h HAVE_X11_FONTS_FONTENC_H)
check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME) # many uses of gethostname
check_symbol_exists(getdomainname "unistd.h" HAVE_GETDOMAINNAME) # kdm
check_symbol_exists(mallinfo "malloc.h" KDE_MALLINFO_MALLOC) # konq
check_symbol_exists(mallinfo "stdlib.h" KDE_MALLINFO_STDLIB) # konq
# TODO KDE_MALLINFO_FIELD_hblkhd # konq
# TODO KDE_MALLINFO_FIELD_uordblks # konq
# TODO KDE_MALLINFO_FIELD_usmblks # konq
# check_prototype_exists(gethostname "stdlib.h;unistd.h" HAVE_GETHOSTNAME_PROTO) # many uses of gethostname
# check_prototype_exists(getdomainname "stdlib.h;unistd.h" HAVE_GETDOMAINNAME_PROTO) # kdm
# check_prototype_exists(unsetenv stdlib.h HAVE_UNSETENV_PROTO) # drkonqi, kdesu, trash use unsetenv
# check_prototype_exists(usleep unistd.h HAVE_USLEEP_PROTO) # various uses of usleep
# check_prototype_exists(DPMSInfo "X11/Xlib.h;X11/extensions/dpms.h" HAVE_DPMSINFO_PROTO) #kdesktop
# check_prototype_exists(DPMSCapable "X11/Xlib.h;X11/extensions/dpms.h" HAVE_DPMSCAPABLE_PROTO)
check_symbol_exists(getnameinfo "sys/socket.h;netdb.h" HAVE_GETNAMEINFO) # kcontrol/infocenter
check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF) # config.h (ksysguardd uses vsnprintf)
check_library_exists(Xss XScreenSaverAllocInfo "" HAVE_SCREENSAVER)
check_library_exists(GL glXChooseVisual "" HAVE_GLXCHOOSEVISUAL)
check_library_exists(Xxf86misc XF86MiscSetGrabKeysState "" HAVE_XF86MISCSETGRABKEYSSTATE)
check_library_exists(ICE _IceTransNoListen "" HAVE__ICETRANSNOLISTEN) #ksmserver
check_function_exists(getpeereid HAVE_GETPEEREID) # kdesu
check_function_exists(getpt HAVE_GETPT) # fish
check_function_exists(grantpt HAVE_GRANTPT) # fish
check_function_exists(getifaddrs HAVE_GETIFADDRS) # kcontrol/infocenter, kdm
check_function_exists(getloadavg HAVE_GETLOADAVG) # kdm
check_function_exists(nice HAVE_NICE) # kioslave/thumbnail
check_function_exists(setpriority HAVE_SETPRIORITY) # kdesktop, kcontrol/screensaver
check_function_exists(setproctitle HAVE_SETPROCTITLE) # kdm
check_function_exists(strnlen HAVE_STRNLEN) # kdm
check_function_exists(unsetenv HAVE_UNSETENV) # drkonqi, kdesu, trash use unsetenv
check_function_exists(usleep HAVE_USLEEP) # various uses of usleep
check_library_exists(util openpty "" HAVE_OPENPTY) # fish
check_library_exists(util isastream "" HAVE_ISASTREAM) #fish
FIND_FILE(UTMP_FILE utmp PATHS /var/run/ /var/adm/ /etc/ )
# TODO: COMPILE_HALBACKEND (kioslave/media)
# TODO: HAVE_COREAUDIO (kcontrol/infocenter, for OSX)
# TODO: HAVE_KSTAT (ksysguardd/{Solaris,Tru64})
# TODO: HAVE_LIBDEVINFO_H (kcontrol/infocenter, for Solaris)
# TODO: HAVE_SIGACTION HAVE_SIGSET (kdeprint)
# TODO: HAVE_XFT (kfontinst)
# TODO: PATH_JAVA (konqueror and kcontrol/konqhtml)
check_type_size("long" SIZEOF_LONG) # infocenter
set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
check_type_size("struct ucred" HAVE_STRUCT_UCRED) # kdesu
# check_struct_member("struct sockaddr" "sa_len" "sys/socket.h" HAVE_STRUCT_SOCKADDR_SA_LEN) # kcontrol/infocenter
# check_struct_member("struct sockaddr_in" "sin_len" "sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_IN_SIN_LEN) # kdm
# check_struct_member("struct sockaddr_in6" "sin6_len" "sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN) # kdm
if (UNIX)
find_path(X11_XKB_INCLUDE_PATH X11/XKBlib.h "${X11_INC_SEARCH_PATH}")
if (X11_XKB_INCLUDE_PATH)
MACRO_PUSH_REQUIRED_VARS()
set(CMAKE_REQUIRED_LIBRARIES "${X11_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}")
check_library_exists(X11 XkbLockModifiers "" HAVE_XKB) # konsole, kxkb, kdm
check_library_exists(X11 XkbSetPerClientControls "" HAVE_XKBSETPERCLIENTCONTROLS) # kdm
MACRO_POP_REQUIRED_VARS()
endif (X11_XKB_INCLUDE_PATH)
endif (UNIX)
check_cxx_source_compiles("
class A { public: virtual A* me(); };
class X { public: int x; virtual void ff() {}; };
class B : public X, public A { public: virtual B* me(); };
int foo( A* a )
{
A* aa = a->me();
return a == aa;
}
int main()
{
B* b = new B;
return foo( b ) == 0;
}
A* A::me() { return this; }
B* B::me() { return this; }
" HAVE_COVARIANT_RETURN ) # khotkeys
/* config.h. Generated by cmake from config.h.cmake */
/* media HAL backend compilation */
#undef COMPILE_HALBACKEND
/* Define if covariant return in virtual methods works */
#cmakedefine HAVE_COVARIANT_RETURN 1
/* Define to 1 if you have the <Alib.h> header file. */
#cmakedefine HAVE_ALIB_H 1
/* Define if you have the CoreAudio API */
#undef HAVE_COREAUDIO
/* Define to 1 if you have the <devinfo.h> header file. */
#cmakedefine HAVE_DEVINFO_H 1
/* Define if you have DPMS support */
#cmakedefine HAVE_DPMS 1
/* Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h> */
#cmakedefine HAVE_DPMSCAPABLE_PROTO 1
/* Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h> */
#cmakedefine HAVE_DPMSINFO_PROTO 1
/* Defines if your system has the libfontconfig library */
#cmakedefine HAVE_FONTCONFIG 1
/* Define to 1 if you have the <fstab.h> header file. */
#cmakedefine HAVE_FSTAB_H 1
/* Define to 1 if you have the `getifaddrs' function. */
#cmakedefine HAVE_GETIFADDRS 1
/* Define to 1 if you have the `getloadavg' function. */
#cmakedefine HAVE_GETLOADAVG 1
/* Define to 1 if you have the `getnameinfo' function. */
#cmakedefine HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `getpeereid' function. */
#cmakedefine HAVE_GETPEEREID 1
/* Define to 1 if you have the `getpt' function. */
#cmakedefine HAVE_GETPT 1
/* Define to 1 if you have the `grantpt' function. */
#cmakedefine HAVE_GRANTPT 1
/* Defines if you have Solaris' libkstat */
/* #undef HAVE_KSTAT */
/* Defines if you have libdevinfo of Solaris 7 or later */
#undef HAVE_LIBDEVINFO_H
/* Define to 1 if you have the <libutil.h> header file. */
#cmakedefine HAVE_LIBUTIL_H 1
/* Define to 1 if you have the <limits.h> header file. */
#cmakedefine HAVE_LIMITS_H 1
/* Define to 1 if you have the <linux/raw.h> header file. */
#cmakedefine HAVE_LINUX_RAW_H 1
/* Define if you have long long as datatype */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the <mntent.h> header file. */
#cmakedefine HAVE_MNTENT_H 1
/* Define to 1 if you have the `nice' function. */
#define HAVE_NICE 1
/* Defines whether we can use the openpty() function */
#cmakedefine HAVE_OPENPTY 1
/* Define to 1 if you have the <paths.h> header file. */
#cmakedefine HAVE_PATHS_H 1
/* Define to 1 if you have the <pty.h> header file. */
#cmakedefine HAVE_PTY_H 1
/* Define to 1 if you have the <sasl.h> header file. */
#cmakedefine HAVE_SASL_H 1
/* Define to 1 if you have the <sasl/sasl.h> header file. */
#cmakedefine HAVE_SASL_SASL_H 1
/* Define to 1 if you have the `setpriority' function. */
#cmakedefine HAVE_SETPRIORITY 1
/* Define to 1 if you have the `setproctitle' function. */
#cmakedefine HAVE_SETPROCTITLE 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define to 1 if you have the `sigset' function. */
#define HAVE_SIGSET 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the `strnlen' function. */
#cmakedefine HAVE_STRNLEN 1
/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
#cmakedefine HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
#cmakedefine HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
/* Define to 1 if `sa_len' is member of `struct sockaddr'. */
#cmakedefine HAVE_STRUCT_SOCKADDR_SA_LEN
/* Define if you have the struct ucred */
#cmakedefine HAVE_STRUCT_UCRED 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#cmakedefine HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/loadavg.h> header file. */
#cmakedefine HAVE_SYS_LOADAVG_H 1
/* Define to 1 if you have the <sys/raw.h> header file. */
#cmakedefine HAVE_SYS_RAW_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/sockio.h> header file. */
#cmakedefine HAVE_SYS_SOCKIO_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
#cmakedefine HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <termios.h> header file. */
#cmakedefine HAVE_TERMIOS_H 1
/* Define to 1 if you have the <termio.h> header file. */
#cmakedefine HAVE_TERMIO_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define if you have usleep */
#cmakedefine HAVE_USLEEP 1
/* Define if you have the usleep prototype */
#cmakedefine HAVE_USLEEP_PROTO 1
/* Define to 1 if you have the <util.h> header file. */
#cmakedefine HAVE_UTIL_H 1
/* Define to 1 if you have the `vsnprintf' function. */
#cmakedefine HAVE_VSNPRINTF 1
/* Define if you have the XComposite extension */
#cmakedefine HAVE_XCOMPOSITE 1
/* Define to 1 if you have Xcursor */
#cmakedefine HAVE_XCURSOR 1
/* Define if you have the xf86misc extension */
#cmakedefine HAVE_XF86MISC 1
/* Define if you have the XFixes extension */
#cmakedefine HAVE_XFIXES 1
/* Defines if you have Xft */
#define HAVE_XFT 1
/* Define if you have the XKB extension */
#cmakedefine HAVE_XKB 1
/* Define if you have XkbSetPerClientControls */
#cmakedefine HAVE_XKBSETPERCLIENTCONTROLS 1
/* Defined if your system has XRender support */
#cmakedefine HAVE_XRENDER 1
/* Define if you have the XScreenSaver extension */
#cmakedefine HAVE_XSCREENSAVER 1
/* Define if you have the XTest extension */
#cmakedefine HAVE_XTEST 1
/* KDE's binaries directory */
#define KDE_BINDIR "${CMAKE_INSTALL_PREFIX}/bin"
/* KDE's configuration directory */
#define KDE_CONFDIR "${CMAKE_INSTALL_PREFIX}/share/config"
/* KDE's static data directory */
#define KDE_DATADIR "${CMAKE_INSTALL_PREFIX}/share/apps"
/* Use mallinfo field hblkhd */
#define KDE_MALLINFO_FIELD_hblkhd 1
/* Use mallinfo field uordblks */
#define KDE_MALLINFO_FIELD_uordblks 1
/* Use mallinfo field usmblks */
/* #undef KDE_MALLINFO_FIELD_usmblks */
/* mallinfo() is available in <malloc.h> */
#cmakedefine KDE_MALLINFO_MALLOC 1
/* mallinfo() is available in <stdlib.h> */
#cmakedefine KDE_MALLINFO_STDLIB 1
/* Name of package */
#define PACKAGE "kdebase"
/* Define where your java executable is */
#undef PATH_JAVA
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG ${SIZEOF_LONG}
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#cmakedefine TIME_WITH_SYS_TIME 1
/* Define the file for utmp entries */
#define UTMP "${UTMP_FILE}"
/* Version number of package */
#define VERSION "3.9.02"
/* X binaries directory */
#define XBINDIR "/usr/X11R6/bin"
/* X libraries directory */
#define XLIBDIR "/usr/X11R6/lib/X11"
/* Number of bits in a file offset, on hosts where this is settable. */
#define _FILE_OFFSET_BITS 64
#if !defined(HAVE_USLEEP_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int usleep (unsigned int);
#ifdef __cplusplus
}
#endif
#endif
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#ifdef __cplusplus
extern "C"
#endif
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#ifdef __cplusplus
extern "C"
#endif
int snprintf(char *str, size_t n, char const *fmt, ...);
#endif
#if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* type to use in place of socklen_t if not defined */
#define kde_socklen_t socklen_t
......@@ -38,10 +38,6 @@
//
// #include <kdialogbase.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
class KPushButton;
class KTextEdit;
class KGameChat;
......
......@@ -20,10 +20,6 @@
#ifndef _KSIRKCONFIGDIALOG_H_
#define _KSIRKCONFIGDIALOG_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <kconfigdialog.h>
namespace Ui
......
......@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
{
kDebug() << "Hello World!" << endl;
KAboutData aboutData( "ksirk", I18N_NOOP("KsirK"),
VERSION, description, KAboutData::License_GPL,
KDE_VERSION_STRING, description, KAboutData::License_GPL,
"(c) 2002-2005, Gaël de Chalendar\nFor help and user manuel, please see \nThe KsirK Web site (http://home.gna.org/ksirk)", 0, 0, "kleag@free.fr");
aboutData.addAuthor("Gael de Chalendar aka Kleag",0, "kleag@free.fr");
aboutData.addAuthor("Robin Doer",0, "");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment