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
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 if (BOOST_LIBRARIES AND BOOST_INCLUDE_DIRS)
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.
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")
49 $ENV{BOOST_ROOT}/include
58 set(BOOST_LIB_SUFFIX -vc71-mt)
62 set(BOOST_LIB_SUFFIX -mgw-mt)
66 set(BOOST_LIB_SUFFIX -gcc-mt)
70 find_path(BOOST_INCLUDE_DIR
83 find_library(BOOST_DATE_TIME_LIBRARY
85 boost_date_time${BOOST_LIB_SUFFIX}
93 find_library(BOOST_FILESYSTEM_LIBRARY
95 boost_filesystem${BOOST_LIB_SUFFIX}
103 find_library(BOOST_IOSTREAMS_LIBRARY
105 boost_iostreams${BOOST_LIB_SUFFIX}
113 find_library(BOOST_PRG_EXEC_MONITOR_LIBRARY
115 boost_prg_exec_monitor${BOOST_LIB_SUFFIX}
123 find_library(BOOST_PROGRAM_OPTIONS_LIBRARY
125 boost_program_options${BOOST_LIB_SUFFIX}
133 find_library(BOOST_PYTHON_LIBRARY
135 boost_python${BOOST_LIB_SUFFIX}
143 find_library(BOOST_REGEX_LIBRARY
145 boost_regex${BOOST_LIB_SUFFIX}
153 find_library(BOOST_SERIALIZATION_LIBRARY
155 boost_serialization${BOOST_LIB_SUFFIX}
163 find_library(BOOST_SIGNALS_LIBRARY
165 boost_signals${BOOST_LIB_SUFFIX}
173 find_library(BOOST_TEST_EXEC_MONITOR_LIBRARY
175 boost_test_exec_monitor${BOOST_LIB_SUFFIX}
183 find_library(BOOST_THREAD_LIBRARY
185 boost_thread${BOOST_LIB_SUFFIX}
194 find_library(BOOST_UNIT_TEST_FRAMEWORK_LIBRARY
196 boost_unit_test_framework${BOOST_LIB_SUFFIX}
204 find_library(BOOST_WAVE_LIBRARY
206 boost_wave${BOOST_LIB_SUFFIX}
214 find_library(BOOST_WSERIALIZATION_LIBRARY
216 boost_wserialization${BOOST_LIB_SUFFIX}
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
272 if (BOOST_DATE_TIME_FOUND)
275 ${BOOST_DATE_TIME_LIBRARY}
277 endif (BOOST_DATE_TIME_FOUND)
278 if (BOOST_FILESYSTEM_FOUND)
281 ${BOOST_FILESYSTEM_LIBRARY}
283 endif (BOOST_FILESYSTEM_FOUND)
284 if (BOOST_IOSTREAMS_FOUND)
287 ${BOOST_IOSTREAMS_LIBRARY}
289 endif (BOOST_IOSTREAMS_FOUND)
290 if (BOOST_PRG_EXEC_MONITOR_FOUND)
293 ${BOOST_PRG_EXEC_MONITOR_LIBRARY}
295 endif (BOOST_PRG_EXEC_MONITOR_FOUND)
296 if (BOOST_PROGRAM_OPTIONS_FOUND)
299 ${BOOST_PROGRAM_OPTIONS_LIBRARY}
301 endif (BOOST_PROGRAM_OPTIONS_FOUND)
302 if (BOOST_PYTHON_FOUND)
305 ${BOOST_PYTHON_LIBRARY}
307 endif (BOOST_PYTHON_FOUND)
308 if (BOOST_REGEX_FOUND)
311 ${BOOST_REGEX_LIBRARY}
313 endif (BOOST_REGEX_FOUND)
314 if (BOOST_SERIALIZATION_FOUND)
317 ${BOOST_SERIALIZATION_LIBRARY}
319 endif (BOOST_SERIALIZATION_FOUND)
320 if (BOOST_SIGNALS_FOUND)
323 ${BOOST_SIGNALS_LIBRARY}
325 endif (BOOST_SIGNALS_FOUND)
326 if (BOOST_TEST_EXEC_MONITOR_FOUND)
329 ${BOOST_TEST_EXEC_MONITOR_LIBRARY}
331 endif (BOOST_TEST_EXEC_MONITOR_FOUND)
332 if (BOOST_THREAD-MT_FOUND)
335 ${BOOST_THREAD_LIBRARY}
337 endif (BOOST_THREAD-MT_FOUND)
338 if (BOOST_UNIT_TEST_FRAMEWORK_FOUND)
341 ${BOOST_UNIT_TEST_FRAMEWORK_LIBRARY}
343 endif (BOOST_UNIT_TEST_FRAMEWORK_FOUND)
344 if (BOOST_WAVE_FOUND)
347 ${BOOST_WAVE_LIBRARY}
349 endif (BOOST_WAVE_FOUND)
350 if (BOOST_WSERIALIZATION_FOUND)
353 ${BOOST_WSERIALIZATION_LIBRARY}
355 endif (BOOST_WSERIALIZATION_FOUND)
357 if (BOOST_INCLUDE_DIRS AND BOOST_LIBRARIES)
358 set(BOOST_FOUND TRUE)
359 endif (BOOST_INCLUDE_DIRS AND BOOST_LIBRARIES)
362 if (NOT Boost_FIND_QUIETLY)
363 message(STATUS "Found Boost: ${BOOST_LIBRARIES}")
364 endif (NOT Boost_FIND_QUIETLY)
366 if (Boost_FIND_REQUIRED)
367 message(FATAL_ERROR "Could not find Boost")
368 endif (Boost_FIND_REQUIRED)
375 set(BOOST_PROGRAM_OPTIONS_LIBRARY
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)