Fix bugs in the search function and other "improvements".
[rattatechess.git] / CMakeLists.txt
blobe9647af9257c5cf6a93c25bb59949dca55105d2f
1 #***************************************************************************
2 #                        CMakeLists.txt - makefile
3 #                            -------------------
4 #   begin                : Sat Oct 06 2007
5 #   copyright            : (C) 2007 by Maurizio Monge
6 #   email                : monge@linuz.sns.it
7 #***************************************************************************
9 #***************************************************************************
10 #*                                                                         *
11 #*   This program is free software; you can redistribute it and/or modify  *
12 #*   it under the terms of the GNU General Public License as published by  *
13 #*   the Free Software Foundation; either version 2 of the License, or     *
14 #*   (at your option) any later version.                                   *
15 #*                                                                         *
16 #***************************************************************************
19 MACRO(ADDCFLAG SRCFILE FLAG)
20     GET_SOURCE_FILE_PROPERTY(loc_flags "${SRCFILE}" COMPILE_FLAGS)
21     IF(loc_flags)
22         SET_SOURCE_FILES_PROPERTIES("${SRCFILE}" PROPERTIES   COMPILE_FLAGS "${loc_flags} ${FLAG}")
23     ELSE(loc_flags)
24         SET_SOURCE_FILES_PROPERTIES("${SRCFILE}" PROPERTIES   COMPILE_FLAGS "${FLAG}")
25     ENDIF(loc_flags)
26     SET(loc_flags)
27 ENDMACRO(ADDCFLAG SRCFILE FLAG)
30 SET(GUI 0)
31 SET(CMAKE_BUILD_TYPE Release)
32 #SET(CMAKE_BUILD_TYPE Profile)
34 SET(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing")
35 SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
36 SET(CMAKE_C_FLAGS_PROFILE "-O3 -fexpensive-optimizations -fno-strict-aliasing -pg")
37 SET(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})
39 SET(rattatechess_SRC
40     attack.cpp
41     board.cpp
42     board_io.cpp
43     book.cpp
44     check.cpp
45     commands.cpp
46     debug.cpp
47     draw.cpp
48     engine.cpp
49     evaluate.cpp
50     genmoves.cpp
51     hash.cpp
52     hashkeys.cpp
53     io.cpp
54     main.cpp
55     mattracking.cpp
56     move.cpp
57     moveparse.cpp
58     pawntracking.cpp
59     platform.cpp
60     search.cpp
61     sort.cpp
62     static.cpp
63     track_attacks.cpp
64     utils.cpp
67 IF(GUI)
68     INCLUDE(FindQt4)
69     FIND_PACKAGE(Qt4)
71     SET(rattatechess_SRC ${rattatechess_SRC} search_gui.cpp)
72     QT4_AUTOMOC(search_gui.cpp)
73     ADD_DEFINITIONS(${QT_DEFINITIONS})
74     INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR})
75 ELSE(GUI)
76     ADD_DEFINITIONS(-DNO_GUI)
77 ENDIF(GUI)
80 ADD_EXECUTABLE(rattatechess ${rattatechess_SRC})
83 IF(GUI)
84     TARGET_LINK_LIBRARIES(rattatechess ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
85 ENDIF(GUI)