-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
197 lines (169 loc) · 5.63 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
########### Project name ###########
PROJECT(lablove)
SET(LABLOVE_MAJOR "0")
SET(LABLOVE_MINOR "3")
SET(VERSION "${LABLOVE_MAJOR}.${LABLOVE_MINOR}")
SET(PACKAGE lablove)
########### Global settings ###########
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
OPTION(DEBUG "Debug settings" OFF)
OPTION(PROFILE "Profile settings" OFF)
SET(CMAKE_VERBOSE_MAKEFILE "OFF")
if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()
########### Compiler settings ###########
IF(PROFILE)
SET(CMAKE_CXX_FLAGS "-Wno-deprecated -g -pg")
ELSE(PROFILE)
IF(DEBUG)
SET(CMAKE_CXX_FLAGS "-Wno-deprecated -g")
ELSE(DEBUG)
SET(CMAKE_CXX_FLAGS "-O3")
ENDIF(DEBUG)
ENDIF(PROFILE)
########### System defines ###########
IF(UNIX)
ADD_DEFINITIONS(-D__UNIX)
ENDIF(UNIX)
IF(WIN32)
ADD_DEFINITIONS(-D__WIN32)
ENDIF(WIN32)
########### Sources ###########
SET(SOURCE_FILES
src/Simulation.cpp
src/SimArtist.cpp
src/Sim2D.cpp
src/SimObj.cpp
src/Fitness.cpp
src/SimObj2D.cpp
src/Target2D.cpp
src/Laser2D.cpp
src/PopulationDynamics.cpp
src/PopDynSEGA.cpp
src/Random.cpp
src/Species.cpp
src/Goal.cpp
src/Symbol.cpp
src/SymbolBitString.cpp
src/SymbolRGB.cpp
src/SymbolFixedString.cpp
src/SymbolFloat.cpp
src/SymbolFloatVector.cpp
src/SymbolUL.cpp
src/SymbolTable.cpp
src/TableSet.cpp
src/Log.cpp
src/LogBestBrain.cpp
src/Statistics.cpp
src/StatCommon.cpp
src/StatTime.cpp
src/Message.cpp
src/CompPER.cpp
src/CompACT.cpp
gridbrain/src/Gridbrain.cpp
gridbrain/src/GridbrainMutations.cpp
gridbrain/src/GridbrainRecombine.cpp
gridbrain/src/GridbrainWrite.cpp
gridbrain/src/Grid.cpp
gridbrain/src/Coord.cpp
gridbrain/src/Component.cpp
gridbrain/src/Connection.cpp
gridbrain/src/Gene.cpp
gridbrain/src/ComponentSet.cpp
gridbrain/src/CompNUL.cpp
gridbrain/src/CompIN.cpp
gridbrain/src/CompOUT.cpp
gridbrain/src/CompSUM.cpp
gridbrain/src/CompMAX.cpp
gridbrain/src/CompMIN.cpp
gridbrain/src/CompAVG.cpp
gridbrain/src/CompMUL.cpp
gridbrain/src/CompNOT.cpp
gridbrain/src/CompAND.cpp
gridbrain/src/CompINV.cpp
gridbrain/src/CompNEG.cpp
gridbrain/src/CompAMP.cpp
gridbrain/src/CompMOD.cpp
gridbrain/src/CompRAND.cpp
gridbrain/src/CompEQ.cpp
gridbrain/src/CompGTZ.cpp
gridbrain/src/CompZERO.cpp
gridbrain/src/CompCLK.cpp
gridbrain/src/CompCLKG.cpp
gridbrain/src/CompDMUL.cpp
gridbrain/src/CompSEL.cpp
gridbrain/src/CompMEM.cpp
gridbrain/src/CompTMEM.cpp
)
SET(UNIT_TEST_FILES
gridbrain/UnitTest++/AssertException.cpp
gridbrain/UnitTest++/Test.cpp
gridbrain/UnitTest++/Checks.cpp
gridbrain/UnitTest++/TestRunner.cpp
gridbrain/UnitTest++/TestResults.cpp
gridbrain/UnitTest++/TestReporter.cpp
gridbrain/UnitTest++/TestReporterStdout.cpp
gridbrain/UnitTest++/ReportAssert.cpp
gridbrain/UnitTest++/TestList.cpp
gridbrain/UnitTest++/TimeConstraint.cpp
gridbrain/UnitTest++/TestDetails.cpp
gridbrain/UnitTest++/MemoryOutStream.cpp
gridbrain/UnitTest++/DeferredTestReporter.cpp
gridbrain/UnitTest++/DeferredTestResult.cpp
gridbrain/UnitTest++/XmlTestReporter.cpp)
IF(MINGW)
SET(UNIT_TEST_FILES
${UNIT_TEST_FILES}
gridbrain/UnitTest++/Win32/TimeHelpers.cpp)
ELSE(MINGW)
SET(UNIT_TEST_FILES
${UNIT_TEST_FILES}
gridbrain/UnitTest++/Posix/SignalTranslator.cpp
gridbrain/UnitTest++/Posix/TimeHelpers.cpp)
ENDIF(MINGW)
SET(UNIT_TEST_FILES
${UNIT_TEST_FILES}
gridbrain/tests/Main.cpp
gridbrain/tests/TestGrid.cpp
gridbrain/tests/TestGridCoord.cpp
gridbrain/tests/TestGridbrain.cpp
gridbrain/tests/TestGridbrainMutations.cpp
gridbrain/tests/TestGridbrainRecombine.cpp
gridbrain/tests/TestGridbrainComponents.cpp
gridbrain/tests/TestGridbrainComponentSet.cpp
)
#IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# SET(EXTRA_SRC_FILES ${EXTRA_SRC_FILES} src/MacOSXSDL/SDLMain.m)
#ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
########### Include dirs ###########
find_package(Lua REQUIRED)
#INCLUDE(CMakeModules/FindLua.cmake)
INCLUDE(CMakeModules/FindArtist.cmake)
INCLUDE_DIRECTORIES("src")
INCLUDE_DIRECTORIES("gridbrain/UnitTest++")
INCLUDE_DIRECTORIES("gridbrain/mtwist")
INCLUDE_DIRECTORIES("gridbrain/include")
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${Artist_INCLUDE_DIR})
########### Targets ###########
ADD_LIBRARY(llove STATIC ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(llove ${Artist_LIBRARIES} ${LUA_LIBRARIES})
ADD_EXECUTABLE(lablove ${EXTRA_SRC_FILES} src/main.cpp)
TARGET_LINK_LIBRARIES(lablove llove ${Artist_LIBRARIES} ${LUA_LIBRARIES})
ADD_EXECUTABLE(tests ${UNIT_TEST_FILES})
SET(LINK_LIBS ${LINK_LIBS} ${Artist_LIBRARIES} ${LUA_LIBRARIES})
ADD_CUSTOM_COMMAND(TARGET tests POST_BUILD COMMAND "./tests")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(Freetype REQUIRED)
INCLUDE(${CMAKE_ROOT}/Modules/FindSDL.cmake)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR_freetype2})
SET(LINK_LIBS ${LINK_LIBS} ${FREETYPE_LIBRARY} ${SDL_LIBRARY})
SET(DEFINITIONS ${DEFINITIONS} -D_OSX_SDL_)
SET_TARGET_PROPERTIES(llove lablove tests PROPERTIES LINK_FLAGS "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ADD_DEFINITIONS(${DEFINITIONS})
TARGET_LINK_LIBRARIES(llove ${LINK_LIBS})
TARGET_LINK_LIBRARIES(lablove llove ${LINK_LIBS})
TARGET_LINK_LIBRARIES(tests llove ${LINK_LIBS})