push 916d6ae32ef88182ddeeedd2a4b2365cc3694db5
[tagua/yd.git] / src / CMakeLists.txt
blob8e3ffa34f28748f90493c427e9f3c4771a0c11b0
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   variantfactories/kdepluginvariants.cpp
28   actioncollection.cpp
29   agentgroup.cpp
30   animation.cpp
31   animationmanager.cpp
32   chessboard.cpp
33   chesstable.cpp
34   clock.cpp
35   common.cpp
36   components.cpp
37   connection.cpp
38   console.cpp
39   constrainedtext.cpp
40   crash.cpp
41   decoratedmove.cpp
42   engine.cpp
43   engineinfo.cpp
44   flash.cpp
45   game.cpp
46   gameinfo.cpp
47   gnushogiengine.cpp
48   graphicalgame.cpp
49   graphicalsystem.cpp
50   histlineedit.cpp
51   hline.cpp
52   icsconnection.cpp
53   icsgamedata.cpp
54   imageeffects.cpp
55   index.cpp
56   infodisplay.cpp
57   location.cpp
58   mainanimation.cpp
59   mainwindow.cpp
60   mastersettings.cpp
61   movelist.cpp
62   movelist_table.cpp
63   movelist_textual.cpp
64   movelist_widget.cpp
65   movement.cpp
66   namedsprite_utils.cpp
67   newgame.cpp
68   option.cpp
69   option_p.cpp
70   pgnparser.cpp
71   piecepool.cpp
72   pixmaploader.cpp
73   poolinfo.cpp
74   positioninfo.cpp
75   pref_board.cpp
76   pref_engines.cpp
77   pref_movelist.cpp
78   pref_preferences.cpp
79   pref_theme.cpp
80   qconnect.cpp
81   random.cpp
82   settings.cpp
83   sprite.cpp
84   tabwidget.cpp
85   themeinfo.cpp
86   ui.cpp
87   variant.cpp
88   variantfactory.cpp
89   xboardengine.cpp
92 # remove spurious xpressive warnings
93 set_source_files_properties(icsconnection.cpp
94   PROPERTIES COMPILE_FLAGS -Wno-extra)
96 kde4_add_ui_files(tagua_SRC
97   ui/pref_highlight.ui
98   ui/newgamedialog.ui
99   ui/pref_engines.ui
100   ui/preferences.ui
101   ui/gametags.ui
102   ui/pref_movelist.ui
103   ui/quickconnect.ui
104   ui/pref_theme.ui
105   ui/pref_theme_page.ui
106   ui/pref_board.ui
109 include_directories(
110   ${KDE4_INCLUDES}
111   ${LUA_INCLUDE_DIRS}
112   ${Boost_INCLUDE_DIRS}
113   ${BLITZ_INCLUDES}
114   ${CMAKE_CURRENT_BINARY_DIR}
117 add_definitions(
118   ${LUA_CFLAGS}
121 if(NOT DEFINED COMPILER_HAVE_X86_MMX)
122   check_cxx_source_compiles(" int main() { __asm__(\"pxor %mm0, %mm0\") ; }" COMPILER_HAVE_X86_MMX)
123 endif(NOT DEFINED COMPILER_HAVE_X86_MMX)
125 if(NOT DEFINED COMPILER_HAVE_X86_SSE2)
126   check_cxx_source_compiles(" int main() { __asm__(\"xorpd %xmm0, %xmm0\"); }" COMPILER_HAVE_X86_SSE2)
127 endif(NOT DEFINED COMPILER_HAVE_X86_SSE2)
129 if(COMPILER_HAVE_X86_MMX)
130   list(APPEND tagua_SRC imageeffects_mmx.cpp)
131   set_source_files_properties(imageeffects_mmx.cpp PROPERTIES COMPILE_FLAGS -mmmx)
132   set_source_files_properties(imageeffects.cpp PROPERTIES COMPILE_FLAGS -DHAVE_X86_MMX)
133 endif(COMPILER_HAVE_X86_MMX)
135 if(COMPILER_HAVE_X86_SSE2)
136   list(APPEND tagua_SRC imageeffects_sse.cpp)
137   set_source_files_properties(imageeffects_sse.cpp PROPERTIES COMPILE_FLAGS -msse2)
138   set_source_files_properties(imageeffects.cpp PROPERTIES COMPILE_FLAGS -DHAVE_X86_SSE2)
139 endif(COMPILER_HAVE_X86_SSE2)
141 if(DEBUG_BUILD)
142   set(TAGUA_TARGET taguaprivate)
143   
144   kde4_add_library(taguaprivate SHARED ${tagua_SRC})
145   kde4_add_executable(tagua main.cpp)
146 else(DEBUG_BUILD)
147   set(TAGUA_TARGET tagua)
148   kde4_add_executable(tagua main.cpp ${tagua_SRC})
149 endif(DEBUG_BUILD)
151 add_subdirectory(core)
152 add_subdirectory(variants)
154 link_directories(
155   ${LUA_LIBRARY_DIRS}
156   ${Boost_LIBRARY_DIRS}
157   ${CMAKE_BINARY_DIR}/lib
159 target_link_libraries(${TAGUA_TARGET}
160   ${LUA_LINK_FLAGS}
161   ${KDE4_KDEUI_LIBS}
162   ${KDE4_KIO_LIBS}
163   ${BLITZ_LIBRARIES}
164   dl
165   kdegames
166   taguacore
167 )  
168   
170   
171 if(DEBUG_BUILD)
172   target_link_libraries(tagua taguaprivate)
173   install(TARGETS taguaprivate DESTINATION ${LIB_INSTALL_DIR})
174 endif(DEBUG_BUILD)
177 INSTALL(TARGETS tagua DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
178 install(FILES tagua.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
179 install(FILES taguaui.rc DESTINATION  ${DATA_INSTALL_DIR}/tagua)