Added total size attribute to ScrollArea.
[fail.git] / FindBoost.cmake
blob57574248545cf34cc322fe2d0132fcf8dfa03429
1 # - Try to find Boost
2 # Once done this will define
4 #  BOOST_FOUND - system has Boost
5 #  BOOST_INCLUDE_DIRS - the Boost include directory
6 #  BOOST_LIBRARIES - Link these to use Boost
7 #  BOOST_DEFINITIONS - Compiler switches required for using Boost
9 #  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
11 #  Redistribution and use is allowed according to the terms of the New
12 #  BSD license.
13 #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 if (BOOST_LIBRARIES AND BOOST_INCLUDE_DIRS)
18   # in cache already
19   set(BOOST_FOUND TRUE)
20 else (BOOST_LIBRARIES AND BOOST_INCLUDE_DIRS)
21   # Add in some path suffixes. These will have to be updated whenever
22   # a new Boost version comes out.
23   set(BOOST_PATH_SUFFIX
24     boost-1_34_1
25     boost-1_34_0
26     boost-1_33_1
27     boost-1_33_0
28   )
30   if (WIN32)
31     # In windows, automatic linking is performed, so you do not have to specify the libraries.
32     # If you are linking to a dynamic runtime, then you can choose to link to either a static or a
33     # dynamic Boost library, the default is to do a static link.  You can alter this for a specific
34     # library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
35     # be linked dynamically.  Alternatively you can force all Boost libraries to dynamic link by
36     # defining BOOST_ALL_DYN_LINK.
38     # This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
39     # or for all of Boost by defining BOOST_ALL_NO_LIB.
41     # If you want to observe which libraries are being linked against then defining
42     # BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
43     # a library is selected for linking.
44     set(BOOST_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
46     set(BOOST_SEARCH_DIRS
47       C:/boost/include
48       D:/boost/include
49       $ENV{BOOST_ROOT}/include
50       $ENV{BOOSTINCLUDEDIR}
51       C:/boost/lib
52       D:/boost/lib
53       $ENV{BOOST_ROOT}/lib
54       $ENV{BOOSTLIBDIR}
55     )
57     if (MSVC)
58       set(BOOST_LIB_SUFFIX -vc71-mt)
59     endif (MSVC)
61     if (MINGW)
62       set(BOOST_LIB_SUFFIX -mgw-mt)
63     endif (MINGW)
65     if (CYGWIN)
66       set(BOOST_LIB_SUFFIX -gcc-mt)
67     endif (CYGWIN)
68   endif (WIN32)
70   find_path(BOOST_INCLUDE_DIR
71     NAMES
72       boost/config.hpp
73     PATHS
74       /usr/include
75       /usr/local/include
76       /opt/local/include
77       /sw/include
78       ${BOOST_SEARCH_DIRS}
79     PATH_SUFFIXES
80       ${BOOST_PATH_SUFFIX}
81   )
83   find_library(BOOST_DATE_TIME_LIBRARY
84     NAMES
85       boost_date_time${BOOST_LIB_SUFFIX}
86     PATHS
87       ${BOOST_SEARCH_DIRS}
88       /usr/lib
89       /usr/local/lib
90       /opt/local/lib
91       /sw/lib
92   )
93   find_library(BOOST_FILESYSTEM_LIBRARY
94     NAMES
95       boost_filesystem${BOOST_LIB_SUFFIX}
96     PATHS
97       ${BOOST_SEARCH_DIRS}
98       /usr/lib
99       /usr/local/lib
100       /opt/local/lib
101       /sw/lib
102   )
103   find_library(BOOST_IOSTREAMS_LIBRARY
104     NAMES
105       boost_iostreams${BOOST_LIB_SUFFIX}
106     PATHS
107       ${BOOST_SEARCH_DIRS}
108       /usr/lib
109       /usr/local/lib
110       /opt/local/lib
111       /sw/lib
112   )
113   find_library(BOOST_PRG_EXEC_MONITOR_LIBRARY
114     NAMES
115       boost_prg_exec_monitor${BOOST_LIB_SUFFIX}
116     PATHS
117       ${BOOST_SEARCH_DIRS}
118       /usr/lib
119       /usr/local/lib
120       /opt/local/lib
121       /sw/lib
122   )
123   find_library(BOOST_PROGRAM_OPTIONS_LIBRARY
124     NAMES
125       boost_program_options${BOOST_LIB_SUFFIX}
126     PATHS
127       ${BOOST_SEARCH_DIRS}
128       /usr/lib
129       /usr/local/lib
130       /opt/local/lib
131       /sw/lib
132   )
133   find_library(BOOST_PYTHON_LIBRARY
134     NAMES
135       boost_python${BOOST_LIB_SUFFIX}
136     PATHS
137       ${BOOST_SEARCH_DIRS}
138       /usr/lib
139       /usr/local/lib
140       /opt/local/lib
141       /sw/lib
142   )
143   find_library(BOOST_REGEX_LIBRARY
144     NAMES
145       boost_regex${BOOST_LIB_SUFFIX}
146     PATHS
147       ${BOOST_SEARCH_DIRS}
148       /usr/lib
149       /usr/local/lib
150       /opt/local/lib
151       /sw/lib
152   )
153   find_library(BOOST_SERIALIZATION_LIBRARY
154     NAMES
155       boost_serialization${BOOST_LIB_SUFFIX}
156     PATHS
157       ${BOOST_SEARCH_DIRS}
158       /usr/lib
159       /usr/local/lib
160       /opt/local/lib
161       /sw/lib
162   )
163   find_library(BOOST_SIGNALS_LIBRARY
164     NAMES
165       boost_signals${BOOST_LIB_SUFFIX}
166     PATHS
167       ${BOOST_SEARCH_DIRS}
168       /usr/lib
169       /usr/local/lib
170       /opt/local/lib
171       /sw/lib
172   )
173   find_library(BOOST_TEST_EXEC_MONITOR_LIBRARY
174     NAMES
175       boost_test_exec_monitor${BOOST_LIB_SUFFIX}
176     PATHS
177       ${BOOST_SEARCH_DIRS}
178       /usr/lib
179       /usr/local/lib
180       /opt/local/lib
181       /sw/lib
182   )
183   find_library(BOOST_THREAD_LIBRARY
184     NAMES
185       boost_thread${BOOST_LIB_SUFFIX}
186       boost_thread-mt
187     PATHS
188       ${BOOST_SEARCH_DIRS}
189       /usr/lib
190       /usr/local/lib
191       /opt/local/lib
192       /sw/lib
193   )
194   find_library(BOOST_UNIT_TEST_FRAMEWORK_LIBRARY
195     NAMES
196       boost_unit_test_framework${BOOST_LIB_SUFFIX}
197     PATHS
198       ${BOOST_SEARCH_DIRS}
199       /usr/lib
200       /usr/local/lib
201       /opt/local/lib
202       /sw/lib
203   )
204   find_library(BOOST_WAVE_LIBRARY
205     NAMES
206       boost_wave${BOOST_LIB_SUFFIX}
207     PATHS
208       ${BOOST_SEARCH_DIRS}
209       /usr/lib
210       /usr/local/lib
211       /opt/local/lib
212       /sw/lib
213   )
214   find_library(BOOST_WSERIALIZATION_LIBRARY
215     NAMES
216       boost_wserialization${BOOST_LIB_SUFFIX}
217     PATHS
218       ${BOOST_SEARCH_DIRS}
219       /usr/lib
220       /usr/local/lib
221       /opt/local/lib
222       /sw/lib
223   )
225   if (BOOST_DATE_TIME_LIBRARY)
226     set(BOOST_DATE_TIME_FOUND TRUE)
227   endif (BOOST_DATE_TIME_LIBRARY)
228   if (BOOST_FILESYSTEM_LIBRARY)
229     set(BOOST_FILESYSTEM_FOUND TRUE)
230   endif (BOOST_FILESYSTEM_LIBRARY)
231   if (BOOST_IOSTREAMS_LIBRARY)
232     set(BOOST_IOSTREAMS_FOUND TRUE)
233   endif (BOOST_IOSTREAMS_LIBRARY)
234   if (BOOST_PRG_EXEC_MONITOR_LIBRARY)
235     set(BOOST_PRG_EXEC_MONITOR_FOUND TRUE)
236   endif (BOOST_PRG_EXEC_MONITOR_LIBRARY)
237   if (BOOST_PROGRAM_OPTIONS_LIBRARY)
238     set(BOOST_PROGRAM_OPTIONS_FOUND TRUE)
239   endif (BOOST_PROGRAM_OPTIONS_LIBRARY)
240   if (BOOST_PYTHON_LIBRARY)
241     set(BOOST_PYTHON_FOUND TRUE)
242   endif (BOOST_PYTHON_LIBRARY)
243   if (BOOST_REGEX_LIBRARY)
244     set(BOOST_REGEX_FOUND TRUE)
245   endif (BOOST_REGEX_LIBRARY)
246   if (BOOST_SERIALIZATION_LIBRARY)
247     set(BOOST_SERIALIZATION_FOUND TRUE)
248   endif (BOOST_SERIALIZATION_LIBRARY)
249   if (BOOST_SIGNALS_LIBRARY)
250     set(BOOST_SIGNALS_FOUND TRUE)
251   endif (BOOST_SIGNALS_LIBRARY)
252   if (BOOST_TEST_EXEC_MONITOR_LIBRARY)
253     set(BOOST_TEST_EXEC_MONITOR_FOUND TRUE)
254   endif (BOOST_TEST_EXEC_MONITOR_LIBRARY)
255   if (BOOST_THREAD_LIBRARY)
256     set(BOOST_THREAD-MT_FOUND TRUE)
257   endif (BOOST_THREAD_LIBRARY)
258   if (BOOST_UNIT_TEST_FRAMEWORK_LIBRARY)
259     set(BOOST_UNIT_TEST_FRAMEWORK_FOUND TRUE)
260   endif (BOOST_UNIT_TEST_FRAMEWORK_LIBRARY)
261   if (BOOST_WAVE_LIBRARY)
262     set(BOOST_WAVE_FOUND TRUE)
263   endif (BOOST_WAVE_LIBRARY)
264   if (BOOST_WSERIALIZATION_LIBRARY)
265     set(BOOST_WSERIALIZATION_FOUND TRUE)
266   endif (BOOST_WSERIALIZATION_LIBRARY)
268   set(BOOST_INCLUDE_DIRS
269     ${BOOST_INCLUDE_DIR}
270   )
272   if (BOOST_DATE_TIME_FOUND)
273     set(BOOST_LIBRARIES
274       ${BOOST_LIBRARIES}
275       ${BOOST_DATE_TIME_LIBRARY}
276     )
277   endif (BOOST_DATE_TIME_FOUND)
278   if (BOOST_FILESYSTEM_FOUND)
279     set(BOOST_LIBRARIES
280       ${BOOST_LIBRARIES}
281       ${BOOST_FILESYSTEM_LIBRARY}
282     )
283   endif (BOOST_FILESYSTEM_FOUND)
284   if (BOOST_IOSTREAMS_FOUND)
285     set(BOOST_LIBRARIES
286       ${BOOST_LIBRARIES}
287       ${BOOST_IOSTREAMS_LIBRARY}
288     )
289   endif (BOOST_IOSTREAMS_FOUND)
290   if (BOOST_PRG_EXEC_MONITOR_FOUND)
291     set(BOOST_LIBRARIES
292       ${BOOST_LIBRARIES}
293       ${BOOST_PRG_EXEC_MONITOR_LIBRARY}
294     )
295   endif (BOOST_PRG_EXEC_MONITOR_FOUND)
296   if (BOOST_PROGRAM_OPTIONS_FOUND)
297     set(BOOST_LIBRARIES
298       ${BOOST_LIBRARIES}
299       ${BOOST_PROGRAM_OPTIONS_LIBRARY}
300     )
301   endif (BOOST_PROGRAM_OPTIONS_FOUND)
302   if (BOOST_PYTHON_FOUND)
303     set(BOOST_LIBRARIES
304       ${BOOST_LIBRARIES}
305       ${BOOST_PYTHON_LIBRARY}
306     )
307   endif (BOOST_PYTHON_FOUND)
308   if (BOOST_REGEX_FOUND)
309     set(BOOST_LIBRARIES
310       ${BOOST_LIBRARIES}
311       ${BOOST_REGEX_LIBRARY}
312     )
313   endif (BOOST_REGEX_FOUND)
314   if (BOOST_SERIALIZATION_FOUND)
315     set(BOOST_LIBRARIES
316       ${BOOST_LIBRARIES}
317       ${BOOST_SERIALIZATION_LIBRARY}
318     )
319   endif (BOOST_SERIALIZATION_FOUND)
320   if (BOOST_SIGNALS_FOUND)
321     set(BOOST_LIBRARIES
322       ${BOOST_LIBRARIES}
323       ${BOOST_SIGNALS_LIBRARY}
324     )
325   endif (BOOST_SIGNALS_FOUND)
326   if (BOOST_TEST_EXEC_MONITOR_FOUND)
327     set(BOOST_LIBRARIES
328       ${BOOST_LIBRARIES}
329       ${BOOST_TEST_EXEC_MONITOR_LIBRARY}
330     )
331   endif (BOOST_TEST_EXEC_MONITOR_FOUND)
332   if (BOOST_THREAD-MT_FOUND)
333     set(BOOST_LIBRARIES
334       ${BOOST_LIBRARIES}
335       ${BOOST_THREAD_LIBRARY}
336     )
337   endif (BOOST_THREAD-MT_FOUND)
338   if (BOOST_UNIT_TEST_FRAMEWORK_FOUND)
339     set(BOOST_LIBRARIES
340       ${BOOST_LIBRARIES}
341       ${BOOST_UNIT_TEST_FRAMEWORK_LIBRARY}
342     )
343   endif (BOOST_UNIT_TEST_FRAMEWORK_FOUND)
344   if (BOOST_WAVE_FOUND)
345     set(BOOST_LIBRARIES
346       ${BOOST_LIBRARIES}
347       ${BOOST_WAVE_LIBRARY}
348     )
349   endif (BOOST_WAVE_FOUND)
350   if (BOOST_WSERIALIZATION_FOUND)
351     set(BOOST_LIBRARIES
352       ${BOOST_LIBRARIES}
353       ${BOOST_WSERIALIZATION_LIBRARY}
354     )
355   endif (BOOST_WSERIALIZATION_FOUND)
356   
357   if (BOOST_INCLUDE_DIRS AND BOOST_LIBRARIES)
358      set(BOOST_FOUND TRUE)
359   endif (BOOST_INCLUDE_DIRS AND BOOST_LIBRARIES)
361   if (BOOST_FOUND)
362     if (NOT Boost_FIND_QUIETLY)
363       message(STATUS "Found Boost: ${BOOST_LIBRARIES}")
364     endif (NOT Boost_FIND_QUIETLY)
365   else (BOOST_FOUND)
366     if (Boost_FIND_REQUIRED)
367       message(FATAL_ERROR "Could not find Boost")
368     endif (Boost_FIND_REQUIRED)
369   endif (BOOST_FOUND)
371   if (MSVC)
372     set(BOOST_LIBRARIES
373       ""
374     )
375     set(BOOST_PROGRAM_OPTIONS_LIBRARY
376       ""
377     )
378   endif (MSVC)
380   # show the BOOST_INCLUDE_DIRS and BOOST_LIBRARIES variables only in the advanced view
381   mark_as_advanced(BOOST_INCLUDE_DIRS BOOST_LIBRARIES)
383 endif (BOOST_LIBRARIES AND BOOST_INCLUDE_DIRS)