per test
[rattatechess.git] / CMakeLists.txt
blob3178f54bf7cf76cff6c87730b61ca5dad60605c6
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 Debug)
32 SET(CMAKE_BUILD_TYPE Release)
33 #SET(CMAKE_BUILD_TYPE Profile)
35 SET(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing -Wall")
36 SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
37 SET(CMAKE_C_FLAGS_PROFILE "-O3 -fexpensive-optimizations -fno-strict-aliasing -pg -Wall")
38 SET(CMAKE_CXX_FLAGS_PROFILE ${CMAKE_C_FLAGS_PROFILE})
39 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g3 -DDEBUG -fno-strict-aliasing -Wall")
40 SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
43 SET(rattatechess_SRC
44     attack.cpp
45     board.cpp
46     board_io.cpp
47     book.cpp
48     check.cpp
49     commands.cpp
50     debug.cpp
51     draw.cpp
52     engine.cpp
53     evaluate.cpp
54     genmoves.cpp
55     hash.cpp
56     hashkeys.cpp
57     io.cpp
58     main.cpp
59     mattracking.cpp
60     move.cpp
61     move_notation.cpp
62     moveparse.cpp
63     pawntracking.cpp
64     platform.cpp
65     search.cpp
66     sort.cpp
67     static.cpp
68     track_attacks.cpp
69     utils.cpp
72 IF(GUI)
73     INCLUDE(FindQt4)
74     FIND_PACKAGE(Qt4)
76     SET(rattatechess_SRC ${rattatechess_SRC} search_gui.cpp)
77     QT4_AUTOMOC(search_gui.cpp)
78     ADD_DEFINITIONS(${QT_DEFINITIONS})
79     INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR})
80 ELSE(GUI)
81     ADD_DEFINITIONS(-DNO_GUI)
82 ENDIF(GUI)
85 ADD_EXECUTABLE(rattatechess ${rattatechess_SRC})
88 IF(GUI)
89     TARGET_LINK_LIBRARIES(rattatechess ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
90 ENDIF(GUI)