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