CMakeLists.txt 3.5 KB
Newer Older
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
1
# search packages used by KDE
2
3
4
IF(NOT KDE4_FOUND)
     find_package(KDE4 REQUIRED)
ENDIF(NOT KDE4_FOUND)
5
6
7
8
include(FindPythonLibrary)
include(FindPyQt4)
include(FindPyKDE4)
include(FindSqlite)
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
9

10
11
12
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}  ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules )
find_package(Twisted REQUIRED)

Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
13
# The name of the project
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
14
# cmake does not really support python projects...
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
15
16
#project(kajongg python) # FIXME this is currently a C++ project and requires a C++ compilier.
set(PROJECT_NAME kajongg)
17
set(PROGRAM_VERSION 4.6.0)
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
18

19
add_subdirectory( voices )
20
add_subdirectory( doc )
21

22
set(SRCFILES
23
src/permutations.py
24
src/about.py
25
src/animation.py
26
27
28
src/background.py
src/backgroundselector.py
src/board.py
29
src/chat.py
30
src/handboard.py
31
src/message.py
32
src/client.py
33
src/intelligence.py
34
src/altint.py
35
src/common.py
36
src/wind.py
37
src/compat.py
38
src/rand.py
39
src/config.py
40
src/kdestub.py
41
src/deferredutil.py
42
src/differ.py
43
src/meld.py
44
src/player.py
45
46
47
48
src/game.py
src/games.py
src/genericdelegates.py
src/guiutil.py
49
src/humanclient.py
50
src/login.py
51
src/kde.py
52
src/dialogs.py
53
src/mainwindow.py
54
src/move.py
55
src/modeltest.py
56
57
58
59
60
src/playerlist.py
src/predefined.py
src/qt4reactor.py
src/query.py
src/rulesetselector.py
61
src/hand.py
62
src/rule.py
63
src/rulecode.py
64
src/scene.py
65
src/scoringdialog.py
66
src/scoring.py
67
68
69
src/user.py
src/servertable.py
src/servercommon.py
70
src/server.py
Johannes Obermayr's avatar
Johannes Obermayr committed
71
src/sound.py
72
73
src/tables.py
src/tile.py
74
src/uitile.py
75
76
src/tileset.py
src/tilesetselector.py
77
src/tree.py
78
src/statesaver.py
79
80
src/wall.py
src/uiwall.py
81
src/visible.py
82
src/log.py
83
84
85
86
87
src/qstring.py
src/qt.py
src/qt4.py
src/qt5.py
src/configdialog.py
88
src/tilesource.py
89
90
src/util.py)

91
IF(NOT PYQT4_FOUND)
92
    macro_log_feature(PYQT4_FOUND "PyQt4" "PyQt4 was not found. It is needed by kajongg to run. (Use -DINSTALL_KAJONGG=TRUE to install anyway)" "http://www.riverbankcomputing.co.uk/software/pyqt/intro" FALSE "" "")
93
94
95
ENDIF(NOT PYQT4_FOUND)

IF(NOT PYKDE4_FOUND)
96
    macro_log_feature(PYKDE4_FOUND "PyKDE4" "PyKDE4 was not found. It is needed by kajongg to run. (Use -DINSTALL_KAJONGG=TRUE to install anyway)" "http://websvn.kde.org/trunk/KDE/kdebindings/python/pykde4/" FALSE "" "")
97
98
99
ENDIF(NOT PYKDE4_FOUND)

IF(NOT SQLITE_FOUND)
100
    macro_log_feature(SQLITE_FOUND "SQLite" "SQLite was not found. It is needed by kajongg to run. (Use -DINSTALL_KAJONGG=TRUE to install anyway)" "http://www.sqlite.org/" FALSE "" "")
101
ENDIF(NOT SQLITE_FOUND)
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
102

103
IF(NOT TWISTED_FOUND)
104
    MESSAGE("Twisted was not found. It is needed by kajongg to run.")
105
    macro_log_feature(TWISTED_FOUND "Twisted" "Twisted was not found. It is needed by kajongg to run. (Use -DINSTALL_KAJONGG=TRUE to install anyway)" "http://www.twistedmatrix.com/" FALSE "" "")
106
107
ENDIF(NOT TWISTED_FOUND)

108
IF(PYQT4_FOUND AND PYKDE4_FOUND AND SQLITE_FOUND AND TWISTED_FOUND)
109
    SET(INSTALL_KAJONGG TRUE)
110
ENDIF(PYQT4_FOUND AND PYKDE4_FOUND AND SQLITE_FOUND AND TWISTED_FOUND)
111
112
113

IF(INSTALL_KAJONGG)
    PYKDE4_INSTALL_PYTHON_FILES(${SRCFILES})
114
    install(FILES src/kajongg.py src/kajonggserver.py DESTINATION ${DATA_INSTALL_DIR}/kajongg)
Wolfgang Rohdewald's avatar
Wolfgang Rohdewald committed
115
    install(FILES src/tilesetselector.ui src/backgroundselector.ui DESTINATION ${DATA_INSTALL_DIR}/kajongg)
116
    install(FILES src/kajonggui.rc DESTINATION ${DATA_INSTALL_DIR}/kajongg)
117
118
    PYKDE4_ADD_EXECUTABLE(kajongg.py kajongg)
    PYKDE4_ADD_EXECUTABLE(kajonggserver.py kajonggserver)
119
    kde4_install_icons(${ICON_INSTALL_DIR})
120
121
    install(PROGRAMS org.kde.kajongg.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
    install(FILES org.kde.kajongg.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo)
122
ENDIF(INSTALL_KAJONGG)
123
124

macro_display_feature_log()