Initial porting to the new component API.
[tagua/yd.git] / src / CMakeLists.txt
blob7161c2ffbd8427e6de64027fab0667e3b7c633ac
1 set(tagua_SRC
2   controllers/editgame.cpp
3   controllers/abstract.cpp
4   controllers/editposition.cpp
5   controllers/entitytoken.cpp
7   loader/image.cpp
8   loader/theme.cpp
9   loader/context.cpp
11   luaapi/lfunclib.c
12   luaapi/options.cpp
13   luaapi/luahl.cpp
14   luaapi/genericwrapper.cpp
15   luaapi/loader.cpp
16   luaapi/imaging.cpp
17   luaapi/luavalue.cpp
19   entities/gameentity.cpp
20   entities/userentity.cpp
21   entities/examinationentity.cpp
22   entities/entity.cpp
23   entities/engineentity.cpp
24   entities/icsentity.cpp
25 #   
26 #   hlvariant/chess/variant.cpp
27 #   hlvariant/chess/san.cpp
28 #   hlvariant/chess/icsverbose.cpp
29 #   hlvariant/chess/move.cpp
30 #   hlvariant/chess/gamestate.cpp
31 #   hlvariant/chess/piece.cpp
32 #   hlvariant/chess/actions.cpp
33 #   
34 #   hlvariant/dummy/variant.cpp
35 #   
36 #   hlvariant/crazyhouse/variant.cpp
37 #   hlvariant/crazyhouse/piece.cpp
38 #   
39 #   hlvariant/minichess5/variant.cpp
40 #   
41 #   hlvariant/shogi/variant.cpp
42 #   hlvariant/shogi/piece.cpp
43 #   hlvariant/shogi/shogiactions.cpp
44
45 #   hlvariant/minishogi/variant.cpp
46
47 #   hlvariant/sho-shogi/variant.cpp
48
49 #   hlvariant/tori-shogi/variant.cpp
50 #   hlvariant/tori-shogi/piece.cpp
52   constrainedtext.cpp
53   movelist.cpp
54   infodisplay.cpp
55   engineinfo.cpp
56   mainanimation.cpp
57   random.cpp
58   sprite.cpp
59   pref_movelist.cpp
60   option.cpp
61   graphicalsystem.cpp
62   agentgroup.cpp
63   graphicalgame.cpp
64   imageeffects.cpp
65   crash.cpp
66   flash.cpp
67   histlineedit.cpp
68   pref_theme.cpp
69   gameinfo.cpp
70   console.cpp
71   animation.cpp
72   pref_engines.cpp
73   clock.cpp
74   chesstable.cpp
75   index.cpp
76   mastersettings.cpp
77   location.cpp
78   hline.cpp
79   xboardengine.cpp
80   gnushogiengine.cpp
81   settings.cpp
82   positioninfo.cpp
83   engine.cpp
84   ui.cpp
85   movelist_widget.cpp
86   pref_preferences.cpp
87   poolinfo.cpp
88   pixmaploader.cpp
89   qconnect.cpp
90   pref_board.cpp
91   game.cpp
92   piecepool.cpp
93   movelist_textual.cpp
94   icsconnection.cpp
95   mainwindow.cpp
96   chessboard.cpp
97   common.cpp
98   pgnparser.cpp
99   movement.cpp
100   connection.cpp
101   movelist_table.cpp
102   newgame.cpp
103   option_p.cpp
104   themeinfo.cpp
105   namedsprite_utils.cpp
106   icsgamedata.cpp
107   decoratedmove.cpp
108   variants.cpp
109   actioncollection.cpp
110   tabwidget.cpp
111   animationsettings.cpp
114 # remove spurious xpressive warnings
115 set_source_files_properties(icsconnection.cpp
116   PROPERTIES COMPILE_FLAGS -Wno-extra)
118 kde4_add_ui_files(tagua_SRC
119   ui/pref_highlight.ui
120   ui/newgamedialog.ui
121   ui/pref_engines.ui
122   ui/preferences.ui
123   ui/gametags.ui
124   ui/pref_movelist.ui
125   ui/quickconnect.ui
126   ui/pref_theme.ui
127   ui/pref_theme_page.ui
128   ui/pref_board.ui
131 include_directories(
132   ${KDE4_INCLUDES}
133   ${LUA_INCLUDE_DIRS}
134   ${Boost_INCLUDE_DIRS}
135   ${BLITZ_INCLUDES}
136   ${CMAKE_CURRENT_BINARY_DIR}
139 add_definitions(
140   ${LUA_CFLAGS}
143 if(NOT DEFINED COMPILER_HAVE_X86_MMX)
144   check_cxx_source_compiles(" int main() { __asm__(\"pxor %mm0, %mm0\") ; }" COMPILER_HAVE_X86_MMX)
145 endif(NOT DEFINED COMPILER_HAVE_X86_MMX)
147 if(NOT DEFINED COMPILER_HAVE_X86_SSE2)
148   check_cxx_source_compiles(" int main() { __asm__(\"xorpd %xmm0, %xmm0\"); }" COMPILER_HAVE_X86_SSE2)
149 endif(NOT DEFINED COMPILER_HAVE_X86_SSE2)
151 if(COMPILER_HAVE_X86_MMX)
152   list(APPEND tagua_SRC imageeffects_mmx.cpp)
153   set_source_files_properties(imageeffects_mmx.cpp PROPERTIES COMPILE_FLAGS -mmmx)
154   set_source_files_properties(imageeffects.cpp PROPERTIES COMPILE_FLAGS -DHAVE_X86_MMX)
155 endif(COMPILER_HAVE_X86_MMX)
157 if(COMPILER_HAVE_X86_SSE2)
158   list(APPEND tagua_SRC imageeffects_sse.cpp)
159   set_source_files_properties(imageeffects_sse.cpp PROPERTIES COMPILE_FLAGS -msse2)
160   set_source_files_properties(imageeffects.cpp PROPERTIES COMPILE_FLAGS -DHAVE_X86_SSE2)
161 endif(COMPILER_HAVE_X86_SSE2)
163 if(DEBUG_BUILD)
164   set(TAGUA_TARGET taguaprivate)
165   
166   kde4_add_library(taguaprivate SHARED ${tagua_SRC})
167   kde4_add_executable(tagua main.cpp)
168 else(DEBUG_BUILD)
169   set(TAGUA_TARGET tagua)
170   kde4_add_executable(tagua main.cpp ${tagua_SRC})
171 endif(DEBUG_BUILD)
173 add_subdirectory(core)
174 add_subdirectory(variants)
176 link_directories(
177   ${LUA_LIBRARY_DIRS}
178   ${Boost_LIBRARY_DIRS}
179   ${CMAKE_BINARY_DIR}/lib
181 target_link_libraries(${TAGUA_TARGET}
182   ${LUA_LINK_FLAGS}
183   ${KDE4_KDEUI_LIBS}
184   ${KDE4_KIO_LIBS}
185   ${BLITZ_LIBRARIES}
186   dl
187   kdegames
188   taguacore
189   taguachess
190 )  
191   
193   
194 if(DEBUG_BUILD)
195   target_link_libraries(tagua taguaprivate)
196   install(TARGETS taguaprivate DESTINATION ${LIB_INSTALL_DIR})
197 endif(DEBUG_BUILD)
200 INSTALL(TARGETS tagua DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
201 install(FILES tagua.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
202 install(FILES taguaui.rc DESTINATION  ${DATA_INSTALL_DIR}/tagua)