FindBoost.cmake 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindBoost
  5. ---------
  6. Find Boost include dirs and libraries
  7. Use this module by invoking find_package with the form::
  8. find_package(Boost
  9. [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
  10. [REQUIRED] # Fail with error if Boost is not found
  11. [COMPONENTS <libs>...] # Boost libraries by their canonical name
  12. # e.g. "date_time" for "libboost_date_time"
  13. [OPTIONAL_COMPONENTS <libs>...]
  14. # Optional Boost libraries by their canonical name)
  15. ) # e.g. "date_time" for "libboost_date_time"
  16. This module finds headers and requested component libraries OR a CMake
  17. package configuration file provided by a "Boost CMake" build. For the
  18. latter case skip to the "Boost CMake" section below. For the former
  19. case results are reported in variables::
  20. Boost_FOUND - True if headers and requested libraries were found
  21. Boost_INCLUDE_DIRS - Boost include directories
  22. Boost_LIBRARY_DIRS - Link directories for Boost libraries
  23. Boost_LIBRARIES - Boost component libraries to be linked
  24. Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
  25. Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
  26. target_link_libraries debug/optimized keywords)
  27. Boost_VERSION - BOOST_VERSION value from boost/version.hpp
  28. Boost_LIB_VERSION - Version string appended to library filenames
  29. Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
  30. Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
  31. Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
  32. Boost_VERSION_STRING - Boost version number in x.y.z format
  33. Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
  34. - Pass to add_definitions() to have diagnostic
  35. information about Boost's automatic linking
  36. displayed during compilation
  37. Note that Boost Python components require a Python version suffix
  38. (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
  39. versions built against Python 3.6 and 2.7, respectively. This also
  40. applies to additional components using Python including
  41. ``mpi_python`` and ``numpy``. Earlier Boost releases may use
  42. distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
  43. These may also be used as suffixes, but note that they are not
  44. portable.
  45. This module reads hints about search locations from variables::
  46. BOOST_ROOT - Preferred installation prefix
  47. (or BOOSTROOT)
  48. BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
  49. BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
  50. Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
  51. specified by these hint variables. Default is OFF.
  52. Boost_ADDITIONAL_VERSIONS
  53. - List of Boost versions not known to this module
  54. (Boost install locations may contain the version)
  55. and saves search results persistently in CMake cache entries::
  56. Boost_INCLUDE_DIR - Directory containing Boost headers
  57. Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
  58. Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
  59. Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
  60. Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
  61. The following :prop_tgt:`IMPORTED` targets are also defined::
  62. Boost::boost - Target for header-only dependencies
  63. (Boost include directory)
  64. Boost::<C> - Target for specific component dependency
  65. (shared or static library); <C> is lower-
  66. case
  67. Boost::diagnostic_definitions - interface target to enable diagnostic
  68. information about Boost's automatic linking
  69. during compilation (adds BOOST_LIB_DIAGNOSTIC)
  70. Boost::disable_autolinking - interface target to disable automatic
  71. linking with MSVC (adds BOOST_ALL_NO_LIB)
  72. Boost::dynamic_linking - interface target to enable dynamic linking
  73. linking with MSVC (adds BOOST_ALL_DYN_LINK)
  74. Implicit dependencies such as Boost::filesystem requiring
  75. Boost::system will be automatically detected and satisfied, even
  76. if system is not specified when using find_package and if
  77. Boost::system is not added to target_link_libraries. If using
  78. Boost::thread, then Threads::Threads will also be added automatically.
  79. It is important to note that the imported targets behave differently
  80. than variables created by this module: multiple calls to
  81. find_package(Boost) in the same directory or sub-directories with
  82. different options (e.g. static or shared) will not override the
  83. values of the targets created by the first call.
  84. Users may set these hints or results as cache entries. Projects
  85. should not read these entries directly but instead use the above
  86. result variables. Note that some hint names start in upper-case
  87. "BOOST". One may specify these as environment variables if they are
  88. not specified as CMake variables or cache entries.
  89. This module first searches for the Boost header files using the above
  90. hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
  91. Boost_INCLUDE_DIR. Then it searches for requested component libraries
  92. using the above hints (excluding BOOST_INCLUDEDIR and
  93. Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
  94. and the library name configuration settings below. It saves the
  95. library directories in Boost_LIBRARY_DIR_DEBUG and
  96. Boost_LIBRARY_DIR_RELEASE and individual library
  97. locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
  98. When one changes settings used by previous searches in the same build
  99. tree (excluding environment variables) this module discards previous
  100. search results affected by the changes and searches again.
  101. Boost libraries come in many variants encoded in their file name.
  102. Users or projects may tell this module which variant to find by
  103. setting variables::
  104. Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
  105. and use the debug libraries. Default is ON.
  106. Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
  107. and use the release libraries. Default is ON.
  108. Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
  109. libraries ('mt' tag). Default is ON.
  110. Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
  111. libraries. Default is OFF.
  112. Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
  113. libraries linked statically to the C++ runtime
  114. ('s' tag). Default is platform dependent.
  115. Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
  116. libraries linked to the MS debug C++ runtime
  117. ('g' tag). Default is ON.
  118. Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
  119. debug Python build ('y' tag). Default is OFF.
  120. Boost_USE_STLPORT - Set to ON to use libraries compiled with
  121. STLPort ('p' tag). Default is OFF.
  122. Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
  123. - Set to ON to use libraries compiled with
  124. STLPort deprecated "native iostreams"
  125. ('n' tag). Default is OFF.
  126. Boost_COMPILER - Set to the compiler-specific library suffix
  127. (e.g. "-gcc43"). Default is auto-computed
  128. for the C++ compiler in use. A list may be
  129. used if multiple compatible suffixes should
  130. be tested for, in decreasing order of
  131. preference.
  132. Boost_ARCHITECTURE - Set to the architecture-specific library suffix
  133. (e.g. "-x64"). Default is auto-computed for the
  134. C++ compiler in use.
  135. Boost_THREADAPI - Suffix for "thread" component library name,
  136. such as "pthread" or "win32". Names with
  137. and without this suffix will both be tried.
  138. Boost_NAMESPACE - Alternate namespace used to build boost with
  139. e.g. if set to "myboost", will search for
  140. myboost_thread instead of boost_thread.
  141. Other variables one may set to control this module are::
  142. Boost_DEBUG - Set to ON to enable debug output from FindBoost.
  143. Please enable this before filing any bug report.
  144. Boost_DETAILED_FAILURE_MSG
  145. - Set to ON to add detailed information to the
  146. failure message even when the REQUIRED option
  147. is not given to the find_package call.
  148. Boost_REALPATH - Set to ON to resolve symlinks for discovered
  149. libraries to assist with packaging. For example,
  150. the "system" component library may be resolved to
  151. "/usr/lib/libboost_system.so.1.67.0" instead of
  152. "/usr/lib/libboost_system.so". This does not
  153. affect linking and should not be enabled unless
  154. the user needs this information.
  155. Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
  156. Boost_LIBRARY_DIR_DEBUG.
  157. On Visual Studio and Borland compilers Boost headers request automatic
  158. linking to corresponding libraries. This requires matching libraries
  159. to be linked explicitly or available in the link library search path.
  160. In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
  161. dynamic linking. Boost automatic linking typically requests static
  162. libraries with a few exceptions (such as Boost.Python). Use::
  163. add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
  164. to ask Boost to report information about automatic linking requests.
  165. Example to find Boost headers only::
  166. find_package(Boost 1.36.0)
  167. if(Boost_FOUND)
  168. include_directories(${Boost_INCLUDE_DIRS})
  169. add_executable(foo foo.cc)
  170. endif()
  171. Example to find Boost libraries and use imported targets::
  172. find_package(Boost 1.56 REQUIRED COMPONENTS
  173. date_time filesystem iostreams)
  174. add_executable(foo foo.cc)
  175. target_link_libraries(foo Boost::date_time Boost::filesystem
  176. Boost::iostreams)
  177. Example to find Boost Python 3.6 libraries and use imported targets::
  178. find_package(Boost 1.67 REQUIRED COMPONENTS
  179. python36 numpy36)
  180. add_executable(foo foo.cc)
  181. target_link_libraries(foo Boost::python36 Boost::numpy36)
  182. Example to find Boost headers and some *static* (release only) libraries::
  183. set(Boost_USE_STATIC_LIBS ON) # only find static libs
  184. set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
  185. set(Boost_USE_RELEASE_LIBS ON) # only find release libs
  186. set(Boost_USE_MULTITHREADED ON)
  187. set(Boost_USE_STATIC_RUNTIME OFF)
  188. find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
  189. if(Boost_FOUND)
  190. include_directories(${Boost_INCLUDE_DIRS})
  191. add_executable(foo foo.cc)
  192. target_link_libraries(foo ${Boost_LIBRARIES})
  193. endif()
  194. Boost CMake
  195. ^^^^^^^^^^^
  196. If Boost was built using the boost-cmake project it provides a package
  197. configuration file for use with find_package's Config mode. This
  198. module looks for the package configuration file called
  199. BoostConfig.cmake or boost-config.cmake and stores the result in cache
  200. entry "Boost_DIR". If found, the package configuration file is loaded
  201. and this module returns with no further action. See documentation of
  202. the Boost CMake package configuration for details on what it provides.
  203. Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
  204. #]=======================================================================]
  205. # Save project's policies
  206. cmake_policy(PUSH)
  207. cmake_policy(SET CMP0057 NEW) # if IN_LIST
  208. #-------------------------------------------------------------------------------
  209. # Before we go searching, check whether boost-cmake is available, unless the
  210. # user specifically asked NOT to search for boost-cmake.
  211. #
  212. # If Boost_DIR is set, this behaves as any find_package call would. If not,
  213. # it looks at BOOST_ROOT and BOOSTROOT to find Boost.
  214. #
  215. if (NOT Boost_NO_BOOST_CMAKE)
  216. # If Boost_DIR is not set, look for BOOSTROOT and BOOST_ROOT as alternatives,
  217. # since these are more conventional for Boost.
  218. if ("$ENV{Boost_DIR}" STREQUAL "")
  219. if (NOT "$ENV{BOOST_ROOT}" STREQUAL "")
  220. set(ENV{Boost_DIR} $ENV{BOOST_ROOT})
  221. elseif (NOT "$ENV{BOOSTROOT}" STREQUAL "")
  222. set(ENV{Boost_DIR} $ENV{BOOSTROOT})
  223. endif()
  224. endif()
  225. # Do the same find_package call but look specifically for the CMake version.
  226. # Note that args are passed in the Boost_FIND_xxxxx variables, so there is no
  227. # need to delegate them to this find_package call.
  228. find_package(Boost QUIET NO_MODULE)
  229. mark_as_advanced(Boost_DIR)
  230. # If we found boost-cmake, then we're done. Print out what we found.
  231. # Otherwise let the rest of the module try to find it.
  232. if (Boost_FOUND)
  233. message(STATUS "Boost ${Boost_FIND_VERSION} found.")
  234. if (Boost_FIND_COMPONENTS)
  235. message(STATUS "Found Boost components:\n ${Boost_FIND_COMPONENTS}")
  236. endif()
  237. # Restore project's policies
  238. cmake_policy(POP)
  239. return()
  240. endif()
  241. endif()
  242. #-------------------------------------------------------------------------------
  243. # FindBoost functions & macros
  244. #
  245. ############################################
  246. #
  247. # Check the existence of the libraries.
  248. #
  249. ############################################
  250. # This macro was taken directly from the FindQt4.cmake file that is included
  251. # with the CMake distribution. This is NOT my work. All work was done by the
  252. # original authors of the FindQt4.cmake file. Only minor modifications were
  253. # made to remove references to Qt and make this file more generally applicable
  254. # And ELSE/ENDIF pairs were removed for readability.
  255. #########################################################################
  256. macro(_Boost_ADJUST_LIB_VARS basename)
  257. if(Boost_INCLUDE_DIR )
  258. if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
  259. # if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
  260. # single-config generators, set optimized and debug libraries
  261. get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
  262. if(_isMultiConfig OR CMAKE_BUILD_TYPE)
  263. set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  264. else()
  265. # For single-config generators where CMAKE_BUILD_TYPE has no value,
  266. # just use the release libraries
  267. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  268. endif()
  269. # FIXME: This probably should be set for both cases
  270. set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
  271. endif()
  272. # if only the release version was found, set the debug variable also to the release version
  273. if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
  274. set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
  275. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
  276. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
  277. endif()
  278. # if only the debug version was found, set the release variable also to the debug version
  279. if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
  280. set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
  281. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
  282. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
  283. endif()
  284. # If the debug & release library ends up being the same, omit the keywords
  285. if("${Boost_${basename}_LIBRARY_RELEASE}" STREQUAL "${Boost_${basename}_LIBRARY_DEBUG}")
  286. set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
  287. set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE} )
  288. endif()
  289. if(Boost_${basename}_LIBRARY AND Boost_${basename}_HEADER)
  290. set(Boost_${basename}_FOUND ON)
  291. if("x${basename}" STREQUAL "xTHREAD" AND NOT TARGET Threads::Threads)
  292. string(APPEND Boost_ERROR_REASON_THREAD " (missing dependency: Threads)")
  293. set(Boost_THREAD_FOUND OFF)
  294. endif()
  295. endif()
  296. endif()
  297. # Make variables changeable to the advanced user
  298. mark_as_advanced(
  299. Boost_${basename}_LIBRARY_RELEASE
  300. Boost_${basename}_LIBRARY_DEBUG
  301. )
  302. endmacro()
  303. # Detect changes in used variables.
  304. # Compares the current variable value with the last one.
  305. # In short form:
  306. # v != v_LAST -> CHANGED = 1
  307. # v is defined, v_LAST not -> CHANGED = 1
  308. # v is not defined, but v_LAST is -> CHANGED = 1
  309. # otherwise -> CHANGED = 0
  310. # CHANGED is returned in variable named ${changed_var}
  311. macro(_Boost_CHANGE_DETECT changed_var)
  312. set(${changed_var} 0)
  313. foreach(v ${ARGN})
  314. if(DEFINED _Boost_COMPONENTS_SEARCHED)
  315. if(${v})
  316. if(_${v}_LAST)
  317. string(COMPARE NOTEQUAL "${${v}}" "${_${v}_LAST}" _${v}_CHANGED)
  318. else()
  319. set(_${v}_CHANGED 1)
  320. endif()
  321. elseif(_${v}_LAST)
  322. set(_${v}_CHANGED 1)
  323. endif()
  324. if(_${v}_CHANGED)
  325. set(${changed_var} 1)
  326. endif()
  327. else()
  328. set(_${v}_CHANGED 0)
  329. endif()
  330. endforeach()
  331. endmacro()
  332. #
  333. # Find the given library (var).
  334. # Use 'build_type' to support different lib paths for RELEASE or DEBUG builds
  335. #
  336. macro(_Boost_FIND_LIBRARY var build_type)
  337. find_library(${var} ${ARGN})
  338. if(${var})
  339. # If this is the first library found then save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
  340. if(NOT Boost_LIBRARY_DIR_${build_type})
  341. get_filename_component(_dir "${${var}}" PATH)
  342. set(Boost_LIBRARY_DIR_${build_type} "${_dir}" CACHE PATH "Boost library directory ${build_type}" FORCE)
  343. endif()
  344. elseif(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  345. # Try component-specific hints but do not save Boost_LIBRARY_DIR_[RELEASE,DEBUG].
  346. find_library(${var} HINTS ${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT} ${ARGN})
  347. endif()
  348. # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is known then search only there.
  349. if(Boost_LIBRARY_DIR_${build_type})
  350. set(_boost_LIBRARY_SEARCH_DIRS_${build_type} ${Boost_LIBRARY_DIR_${build_type}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  351. if(Boost_DEBUG)
  352. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  353. " Boost_LIBRARY_DIR_${build_type} = ${Boost_LIBRARY_DIR_${build_type}}"
  354. " _boost_LIBRARY_SEARCH_DIRS_${build_type} = ${_boost_LIBRARY_SEARCH_DIRS_${build_type}}")
  355. endif()
  356. endif()
  357. endmacro()
  358. #-------------------------------------------------------------------------------
  359. # Convert CMAKE_CXX_COMPILER_VERSION to boost compiler suffix version.
  360. function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION _OUTPUT_VERSION_MAJOR _OUTPUT_VERSION_MINOR)
  361. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1"
  362. _boost_COMPILER_VERSION_MAJOR "${CMAKE_CXX_COMPILER_VERSION}")
  363. string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\2"
  364. _boost_COMPILER_VERSION_MINOR "${CMAKE_CXX_COMPILER_VERSION}")
  365. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}${_boost_COMPILER_VERSION_MINOR}")
  366. set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
  367. set(${_OUTPUT_VERSION_MAJOR} ${_boost_COMPILER_VERSION_MAJOR} PARENT_SCOPE)
  368. set(${_OUTPUT_VERSION_MINOR} ${_boost_COMPILER_VERSION_MINOR} PARENT_SCOPE)
  369. endfunction()
  370. #
  371. # Take a list of libraries with "thread" in it
  372. # and prepend duplicates with "thread_${Boost_THREADAPI}"
  373. # at the front of the list
  374. #
  375. function(_Boost_PREPEND_LIST_WITH_THREADAPI _output)
  376. set(_orig_libnames ${ARGN})
  377. string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames "${_orig_libnames}")
  378. set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE)
  379. endfunction()
  380. #
  381. # If a library is found, replace its cache entry with its REALPATH
  382. #
  383. function(_Boost_SWAP_WITH_REALPATH _library _docstring)
  384. if(${_library})
  385. get_filename_component(_boost_filepathreal ${${_library}} REALPATH)
  386. unset(${_library} CACHE)
  387. set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}")
  388. endif()
  389. endfunction()
  390. function(_Boost_CHECK_SPELLING _var)
  391. if(${_var})
  392. string(TOUPPER ${_var} _var_UC)
  393. message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.")
  394. endif()
  395. endfunction()
  396. # Guesses Boost's compiler prefix used in built library names
  397. # Returns the guess by setting the variable pointed to by _ret
  398. function(_Boost_GUESS_COMPILER_PREFIX _ret)
  399. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
  400. if(WIN32)
  401. set (_boost_COMPILER "-iw")
  402. else()
  403. set (_boost_COMPILER "-il")
  404. endif()
  405. elseif (GHSMULTI)
  406. set(_boost_COMPILER "-ghs")
  407. elseif("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
  408. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
  409. set(_boost_COMPILER "-vc141;-vc140")
  410. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
  411. set(_boost_COMPILER "-vc${MSVC_TOOLSET_VERSION}")
  412. elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10)
  413. set(_boost_COMPILER "-vc71")
  414. elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) # Good luck!
  415. set(_boost_COMPILER "-vc7") # yes, this is correct
  416. else() # VS 6.0 Good luck!
  417. set(_boost_COMPILER "-vc6") # yes, this is correct
  418. endif()
  419. elseif (BORLAND)
  420. set(_boost_COMPILER "-bcb")
  421. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
  422. set(_boost_COMPILER "-sw")
  423. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
  424. set(_boost_COMPILER "-xlc")
  425. elseif (MINGW)
  426. if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
  427. set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34
  428. else()
  429. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
  430. set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}")
  431. endif()
  432. elseif (UNIX)
  433. _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION _boost_COMPILER_VERSION_MAJOR _boost_COMPILER_VERSION_MINOR)
  434. if(NOT Boost_VERSION VERSION_LESS 106900)
  435. # From GCC 5 and clang 4, versioning changes and minor becomes patch.
  436. # For those compilers, patch is exclude from compiler tag in Boost 1.69+ library naming.
  437. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 4)
  438. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
  439. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND _boost_COMPILER_VERSION_MAJOR VERSION_GREATER 3)
  440. set(_boost_COMPILER_VERSION "${_boost_COMPILER_VERSION_MAJOR}")
  441. endif()
  442. endif()
  443. if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
  444. if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34)
  445. set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34
  446. else()
  447. # Determine which version of GCC we have.
  448. if(APPLE)
  449. if(Boost_MINOR_VERSION)
  450. if(${Boost_MINOR_VERSION} GREATER 35)
  451. # In Boost 1.36.0 and newer, the mangled compiler name used
  452. # on macOS/Darwin is "xgcc".
  453. set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}")
  454. else()
  455. # In Boost <= 1.35.0, there is no mangled compiler name for
  456. # the macOS/Darwin version of GCC.
  457. set(_boost_COMPILER "")
  458. endif()
  459. else()
  460. # We don't know the Boost version, so assume it's
  461. # pre-1.36.0.
  462. set(_boost_COMPILER "")
  463. endif()
  464. else()
  465. set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
  466. endif()
  467. endif()
  468. elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  469. # TODO: Find out any Boost version constraints vs clang support.
  470. set(_boost_COMPILER "-clang${_boost_COMPILER_VERSION}")
  471. endif()
  472. else()
  473. # TODO at least Boost_DEBUG here?
  474. set(_boost_COMPILER "")
  475. endif()
  476. set(${_ret} ${_boost_COMPILER} PARENT_SCOPE)
  477. endfunction()
  478. #
  479. # Get component dependencies. Requires the dependencies to have been
  480. # defined for the Boost release version.
  481. #
  482. # component - the component to check
  483. # _ret - list of library dependencies
  484. #
  485. function(_Boost_COMPONENT_DEPENDENCIES component _ret)
  486. # Note: to add a new Boost release, run
  487. #
  488. # % cmake -DBOOST_DIR=/path/to/boost/source -P Utilities/Scripts/BoostScanDeps.cmake
  489. #
  490. # The output may be added in a new block below. If it's the same as
  491. # the previous release, simply update the version range of the block
  492. # for the previous release. Also check if any new components have
  493. # been added, and add any new components to
  494. # _Boost_COMPONENT_HEADERS.
  495. #
  496. # This information was originally generated by running
  497. # BoostScanDeps.cmake against every boost release to date supported
  498. # by FindBoost:
  499. #
  500. # % for version in /path/to/boost/sources/*
  501. # do
  502. # cmake -DBOOST_DIR=$version -P Utilities/Scripts/BoostScanDeps.cmake
  503. # done
  504. #
  505. # The output was then updated by search and replace with these regexes:
  506. #
  507. # - Strip message(STATUS) prefix dashes
  508. # s;^-- ;;
  509. # - Indent
  510. # s;^set(; set(;;
  511. # - Add conditionals
  512. # s;Scanning /path/to/boost/sources/boost_\(.*\)_\(.*\)_\(.*); elseif(NOT Boost_VERSION VERSION_LESS \10\20\3 AND Boost_VERSION VERSION_LESS xxxx);
  513. #
  514. # This results in the logic seen below, but will require the xxxx
  515. # replacing with the following Boost release version (or the next
  516. # minor version to be released, e.g. 1.59 was the latest at the time
  517. # of writing, making 1.60 the next, so 106000 is the needed version
  518. # number). Identical consecutive releases were then merged together
  519. # by updating the end range of the first block and removing the
  520. # following redundant blocks.
  521. #
  522. # Running the script against all historical releases should be
  523. # required only if the BoostScanDeps.cmake script logic is changed.
  524. # The addition of a new release should only require it to be run
  525. # against the new release.
  526. # Handle Python version suffixes
  527. if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
  528. set(component "${CMAKE_MATCH_1}")
  529. set(component_python_version "${CMAKE_MATCH_2}")
  530. endif()
  531. set(_Boost_IMPORTED_TARGETS TRUE)
  532. if(Boost_VERSION AND Boost_VERSION VERSION_LESS 103300)
  533. message(WARNING "Imported targets and dependency information not available for Boost version ${Boost_VERSION} (all versions older than 1.33)")
  534. set(_Boost_IMPORTED_TARGETS FALSE)
  535. elseif(NOT Boost_VERSION VERSION_LESS 103300 AND Boost_VERSION VERSION_LESS 103500)
  536. set(_Boost_IOSTREAMS_DEPENDENCIES regex thread)
  537. set(_Boost_REGEX_DEPENDENCIES thread)
  538. set(_Boost_WAVE_DEPENDENCIES filesystem thread)
  539. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  540. elseif(NOT Boost_VERSION VERSION_LESS 103500 AND Boost_VERSION VERSION_LESS 103600)
  541. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  542. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  543. set(_Boost_MPI_DEPENDENCIES serialization)
  544. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  545. set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
  546. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  547. elseif(NOT Boost_VERSION VERSION_LESS 103600 AND Boost_VERSION VERSION_LESS 103800)
  548. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  549. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  550. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
  551. set(_Boost_MPI_DEPENDENCIES serialization)
  552. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  553. set(_Boost_WAVE_DEPENDENCIES filesystem system thread)
  554. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  555. elseif(NOT Boost_VERSION VERSION_LESS 103800 AND Boost_VERSION VERSION_LESS 104300)
  556. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  557. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  558. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
  559. set(_Boost_MPI_DEPENDENCIES serialization)
  560. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  561. set(_Boost_THREAD_DEPENDENCIES date_time)
  562. set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
  563. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  564. elseif(NOT Boost_VERSION VERSION_LESS 104300 AND Boost_VERSION VERSION_LESS 104400)
  565. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  566. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  567. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  568. set(_Boost_MPI_DEPENDENCIES serialization)
  569. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  570. set(_Boost_THREAD_DEPENDENCIES date_time)
  571. set(_Boost_WAVE_DEPENDENCIES filesystem system thread date_time)
  572. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  573. elseif(NOT Boost_VERSION VERSION_LESS 104400 AND Boost_VERSION VERSION_LESS 104500)
  574. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  575. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  576. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random serialization)
  577. set(_Boost_MPI_DEPENDENCIES serialization)
  578. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  579. set(_Boost_THREAD_DEPENDENCIES date_time)
  580. set(_Boost_WAVE_DEPENDENCIES serialization filesystem system thread date_time)
  581. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  582. elseif(NOT Boost_VERSION VERSION_LESS 104500 AND Boost_VERSION VERSION_LESS 104700)
  583. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  584. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  585. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  586. set(_Boost_MPI_DEPENDENCIES serialization)
  587. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  588. set(_Boost_THREAD_DEPENDENCIES date_time)
  589. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  590. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  591. elseif(NOT Boost_VERSION VERSION_LESS 104700 AND Boost_VERSION VERSION_LESS 104800)
  592. set(_Boost_CHRONO_DEPENDENCIES system)
  593. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  594. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  595. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  596. set(_Boost_MPI_DEPENDENCIES serialization)
  597. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  598. set(_Boost_THREAD_DEPENDENCIES date_time)
  599. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  600. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  601. elseif(NOT Boost_VERSION VERSION_LESS 104800 AND Boost_VERSION VERSION_LESS 105000)
  602. set(_Boost_CHRONO_DEPENDENCIES system)
  603. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  604. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  605. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l random)
  606. set(_Boost_MPI_DEPENDENCIES serialization)
  607. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  608. set(_Boost_THREAD_DEPENDENCIES date_time)
  609. set(_Boost_TIMER_DEPENDENCIES chrono system)
  610. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread date_time)
  611. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  612. elseif(NOT Boost_VERSION VERSION_LESS 105000 AND Boost_VERSION VERSION_LESS 105300)
  613. set(_Boost_CHRONO_DEPENDENCIES system)
  614. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  615. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  616. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  617. set(_Boost_MPI_DEPENDENCIES serialization)
  618. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  619. set(_Boost_THREAD_DEPENDENCIES chrono system date_time)
  620. set(_Boost_TIMER_DEPENDENCIES chrono system)
  621. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
  622. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  623. elseif(NOT Boost_VERSION VERSION_LESS 105300 AND Boost_VERSION VERSION_LESS 105400)
  624. set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
  625. set(_Boost_CHRONO_DEPENDENCIES system)
  626. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  627. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  628. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  629. set(_Boost_MPI_DEPENDENCIES serialization)
  630. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  631. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  632. set(_Boost_TIMER_DEPENDENCIES chrono system)
  633. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time)
  634. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  635. elseif(NOT Boost_VERSION VERSION_LESS 105400 AND Boost_VERSION VERSION_LESS 105500)
  636. set(_Boost_ATOMIC_DEPENDENCIES thread chrono system date_time)
  637. set(_Boost_CHRONO_DEPENDENCIES system)
  638. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  639. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  640. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  641. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  642. set(_Boost_MPI_DEPENDENCIES serialization)
  643. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  644. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  645. set(_Boost_TIMER_DEPENDENCIES chrono system)
  646. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  647. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  648. elseif(NOT Boost_VERSION VERSION_LESS 105500 AND Boost_VERSION VERSION_LESS 105600)
  649. set(_Boost_CHRONO_DEPENDENCIES system)
  650. set(_Boost_COROUTINE_DEPENDENCIES context system)
  651. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  652. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  653. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  654. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l regex random)
  655. set(_Boost_MPI_DEPENDENCIES serialization)
  656. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  657. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  658. set(_Boost_TIMER_DEPENDENCIES chrono system)
  659. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  660. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  661. elseif(NOT Boost_VERSION VERSION_LESS 105600 AND Boost_VERSION VERSION_LESS 105900)
  662. set(_Boost_CHRONO_DEPENDENCIES system)
  663. set(_Boost_COROUTINE_DEPENDENCIES context system)
  664. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  665. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  666. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono)
  667. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  668. set(_Boost_MPI_DEPENDENCIES serialization)
  669. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  670. set(_Boost_RANDOM_DEPENDENCIES system)
  671. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  672. set(_Boost_TIMER_DEPENDENCIES chrono system)
  673. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  674. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  675. elseif(NOT Boost_VERSION VERSION_LESS 105900 AND Boost_VERSION VERSION_LESS 106000)
  676. set(_Boost_CHRONO_DEPENDENCIES system)
  677. set(_Boost_COROUTINE_DEPENDENCIES context system)
  678. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  679. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  680. set(_Boost_LOG_DEPENDENCIES log_setup date_time system filesystem thread regex chrono atomic)
  681. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  682. set(_Boost_MPI_DEPENDENCIES serialization)
  683. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  684. set(_Boost_RANDOM_DEPENDENCIES system)
  685. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  686. set(_Boost_TIMER_DEPENDENCIES chrono system)
  687. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  688. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  689. elseif(NOT Boost_VERSION VERSION_LESS 106000 AND Boost_VERSION VERSION_LESS 106100)
  690. set(_Boost_CHRONO_DEPENDENCIES system)
  691. set(_Boost_COROUTINE_DEPENDENCIES context system)
  692. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  693. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  694. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  695. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  696. set(_Boost_MPI_DEPENDENCIES serialization)
  697. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  698. set(_Boost_RANDOM_DEPENDENCIES system)
  699. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  700. set(_Boost_TIMER_DEPENDENCIES chrono system)
  701. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  702. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  703. elseif(NOT Boost_VERSION VERSION_LESS 106100 AND Boost_VERSION VERSION_LESS 106200)
  704. set(_Boost_CHRONO_DEPENDENCIES system)
  705. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  706. set(_Boost_COROUTINE_DEPENDENCIES context system)
  707. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  708. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  709. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  710. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  711. set(_Boost_MPI_DEPENDENCIES serialization)
  712. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  713. set(_Boost_RANDOM_DEPENDENCIES system)
  714. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  715. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  716. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  717. elseif(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106300)
  718. set(_Boost_CHRONO_DEPENDENCIES system)
  719. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  720. set(_Boost_COROUTINE_DEPENDENCIES context system)
  721. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  722. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  723. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  724. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  725. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  726. set(_Boost_MPI_DEPENDENCIES serialization)
  727. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  728. set(_Boost_RANDOM_DEPENDENCIES system)
  729. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  730. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  731. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  732. elseif(NOT Boost_VERSION VERSION_LESS 106300 AND Boost_VERSION VERSION_LESS 106500)
  733. set(_Boost_CHRONO_DEPENDENCIES system)
  734. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  735. set(_Boost_COROUTINE_DEPENDENCIES context system)
  736. set(_Boost_COROUTINE2_DEPENDENCIES context fiber thread chrono system date_time)
  737. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  738. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  739. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  740. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  741. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  742. set(_Boost_MPI_DEPENDENCIES serialization)
  743. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  744. set(_Boost_RANDOM_DEPENDENCIES system)
  745. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  746. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  747. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  748. elseif(NOT Boost_VERSION VERSION_LESS 106500 AND Boost_VERSION VERSION_LESS 106700)
  749. set(_Boost_CHRONO_DEPENDENCIES system)
  750. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  751. set(_Boost_COROUTINE_DEPENDENCIES context system)
  752. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  753. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  754. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  755. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  756. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  757. set(_Boost_MPI_DEPENDENCIES serialization)
  758. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  759. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  760. set(_Boost_RANDOM_DEPENDENCIES system)
  761. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  762. set(_Boost_TIMER_DEPENDENCIES chrono system)
  763. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  764. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  765. elseif(NOT Boost_VERSION VERSION_LESS 106700 AND Boost_VERSION VERSION_LESS 106800)
  766. set(_Boost_CHRONO_DEPENDENCIES system)
  767. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  768. set(_Boost_COROUTINE_DEPENDENCIES context system)
  769. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  770. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  771. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  772. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  773. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  774. set(_Boost_MPI_DEPENDENCIES serialization)
  775. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  776. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  777. set(_Boost_RANDOM_DEPENDENCIES system)
  778. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  779. set(_Boost_TIMER_DEPENDENCIES chrono system)
  780. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  781. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  782. elseif(NOT Boost_VERSION VERSION_LESS 106800 AND Boost_VERSION VERSION_LESS 106900)
  783. set(_Boost_CHRONO_DEPENDENCIES system)
  784. set(_Boost_CONTEXT_DEPENDENCIES thread chrono system date_time)
  785. set(_Boost_CONTRACT_DEPENDENCIES thread chrono system date_time)
  786. set(_Boost_COROUTINE_DEPENDENCIES context system)
  787. set(_Boost_FIBER_DEPENDENCIES context thread chrono system date_time)
  788. set(_Boost_FILESYSTEM_DEPENDENCIES system)
  789. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  790. set(_Boost_LOG_DEPENDENCIES date_time log_setup system filesystem thread regex chrono atomic)
  791. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  792. set(_Boost_MPI_DEPENDENCIES serialization)
  793. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  794. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  795. set(_Boost_RANDOM_DEPENDENCIES system)
  796. set(_Boost_THREAD_DEPENDENCIES chrono system date_time atomic)
  797. set(_Boost_TIMER_DEPENDENCIES chrono system)
  798. set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
  799. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  800. elseif(NOT Boost_VERSION VERSION_LESS 106900 AND Boost_VERSION VERSION_LESS 107000)
  801. set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
  802. set(_Boost_COROUTINE_DEPENDENCIES context)
  803. set(_Boost_FIBER_DEPENDENCIES context)
  804. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  805. set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
  806. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  807. set(_Boost_MPI_DEPENDENCIES serialization)
  808. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  809. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  810. set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
  811. set(_Boost_TIMER_DEPENDENCIES chrono system)
  812. set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
  813. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  814. else()
  815. if(NOT Boost_VERSION VERSION_LESS 107000)
  816. set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
  817. set(_Boost_COROUTINE_DEPENDENCIES context)
  818. set(_Boost_FIBER_DEPENDENCIES context)
  819. set(_Boost_IOSTREAMS_DEPENDENCIES regex)
  820. set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
  821. set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
  822. set(_Boost_MPI_DEPENDENCIES serialization)
  823. set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
  824. set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
  825. set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
  826. set(_Boost_TIMER_DEPENDENCIES chrono system)
  827. set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
  828. set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
  829. endif()
  830. if(NOT Boost_VERSION VERSION_LESS 107100)
  831. message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
  832. endif()
  833. endif()
  834. string(TOUPPER ${component} uppercomponent)
  835. set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  836. set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
  837. string(REGEX REPLACE ";" " " _boost_DEPS_STRING "${_Boost_${uppercomponent}_DEPENDENCIES}")
  838. if (NOT _boost_DEPS_STRING)
  839. set(_boost_DEPS_STRING "(none)")
  840. endif()
  841. # message(STATUS "Dependencies for Boost::${component}: ${_boost_DEPS_STRING}")
  842. endfunction()
  843. #
  844. # Get component headers. This is the primary header (or headers) for
  845. # a given component, and is used to check that the headers are present
  846. # as well as the library itself as an extra sanity check of the build
  847. # environment.
  848. #
  849. # component - the component to check
  850. # _hdrs
  851. #
  852. function(_Boost_COMPONENT_HEADERS component _hdrs)
  853. # Handle Python version suffixes
  854. if(component MATCHES "^(python|mpi_python|numpy)([0-9][0-9]?|[0-9]\\.[0-9])\$")
  855. set(component "${CMAKE_MATCH_1}")
  856. set(component_python_version "${CMAKE_MATCH_2}")
  857. endif()
  858. # Note: new boost components will require adding here. The header
  859. # must be present in all versions of Boost providing a library.
  860. set(_Boost_ATOMIC_HEADERS "boost/atomic.hpp")
  861. set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
  862. set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
  863. set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
  864. if(Boost_VERSION VERSION_LESS 106100)
  865. set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
  866. else()
  867. set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
  868. endif()
  869. set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
  870. set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
  871. set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
  872. set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
  873. set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
  874. set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
  875. set(_Boost_GRAPH_PARALLEL_HEADERS "boost/graph/adjacency_list.hpp")
  876. set(_Boost_IOSTREAMS_HEADERS "boost/iostreams/stream.hpp")
  877. set(_Boost_LOCALE_HEADERS "boost/locale.hpp")
  878. set(_Boost_LOG_HEADERS "boost/log/core.hpp")
  879. set(_Boost_LOG_SETUP_HEADERS "boost/log/detail/setup_config.hpp")
  880. set(_Boost_MATH_HEADERS "boost/math_fwd.hpp")
  881. set(_Boost_MATH_C99_HEADERS "boost/math/tr1.hpp")
  882. set(_Boost_MATH_C99F_HEADERS "boost/math/tr1.hpp")
  883. set(_Boost_MATH_C99L_HEADERS "boost/math/tr1.hpp")
  884. set(_Boost_MATH_TR1_HEADERS "boost/math/tr1.hpp")
  885. set(_Boost_MATH_TR1F_HEADERS "boost/math/tr1.hpp")
  886. set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp")
  887. set(_Boost_MPI_HEADERS "boost/mpi.hpp")
  888. set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp")
  889. set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp")
  890. set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
  891. set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
  892. set(_Boost_PYTHON_HEADERS "boost/python.hpp")
  893. set(_Boost_RANDOM_HEADERS "boost/random.hpp")
  894. set(_Boost_REGEX_HEADERS "boost/regex.hpp")
  895. set(_Boost_SERIALIZATION_HEADERS "boost/serialization/serialization.hpp")
  896. set(_Boost_SIGNALS_HEADERS "boost/signals.hpp")
  897. set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
  898. set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
  899. set(_Boost_STACKTRACE_BASIC_HEADERS "boost/stacktrace.hpp")
  900. set(_Boost_STACKTRACE_NOOP_HEADERS "boost/stacktrace.hpp")
  901. set(_Boost_STACKTRACE_WINDBG_CACHED_HEADERS "boost/stacktrace.hpp")
  902. set(_Boost_STACKTRACE_WINDBG_HEADERS "boost/stacktrace.hpp")
  903. set(_Boost_SYSTEM_HEADERS "boost/system/config.hpp")
  904. set(_Boost_TEST_EXEC_MONITOR_HEADERS "boost/test/test_exec_monitor.hpp")
  905. set(_Boost_THREAD_HEADERS "boost/thread.hpp")
  906. set(_Boost_TIMER_HEADERS "boost/timer.hpp")
  907. set(_Boost_TYPE_ERASURE_HEADERS "boost/type_erasure/config.hpp")
  908. set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp")
  909. set(_Boost_WAVE_HEADERS "boost/wave.hpp")
  910. set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp")
  911. if(WIN32)
  912. set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp")
  913. set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp")
  914. endif()
  915. string(TOUPPER ${component} uppercomponent)
  916. set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE)
  917. string(REGEX REPLACE ";" " " _boost_HDRS_STRING "${_Boost_${uppercomponent}_HEADERS}")
  918. if (NOT _boost_HDRS_STRING)
  919. set(_boost_HDRS_STRING "(none)")
  920. endif()
  921. # message(STATUS "Headers for Boost::${component}: ${_boost_HDRS_STRING}")
  922. endfunction()
  923. #
  924. # Determine if any missing dependencies require adding to the component list.
  925. #
  926. # Sets _Boost_${COMPONENT}_DEPENDENCIES for each required component,
  927. # plus _Boost_IMPORTED_TARGETS (TRUE if imported targets should be
  928. # defined; FALSE if dependency information is unavailable).
  929. #
  930. # componentvar - the component list variable name
  931. # extravar - the indirect dependency list variable name
  932. #
  933. #
  934. function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
  935. # _boost_unprocessed_components - list of components requiring processing
  936. # _boost_processed_components - components already processed (or currently being processed)
  937. # _boost_new_components - new components discovered for future processing
  938. #
  939. list(APPEND _boost_unprocessed_components ${${componentvar}})
  940. while(_boost_unprocessed_components)
  941. list(APPEND _boost_processed_components ${_boost_unprocessed_components})
  942. foreach(component ${_boost_unprocessed_components})
  943. string(TOUPPER ${component} uppercomponent)
  944. set(${_ret} ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  945. _Boost_COMPONENT_DEPENDENCIES("${component}" _Boost_${uppercomponent}_DEPENDENCIES)
  946. set(_Boost_${uppercomponent}_DEPENDENCIES ${_Boost_${uppercomponent}_DEPENDENCIES} PARENT_SCOPE)
  947. set(_Boost_IMPORTED_TARGETS ${_Boost_IMPORTED_TARGETS} PARENT_SCOPE)
  948. foreach(componentdep ${_Boost_${uppercomponent}_DEPENDENCIES})
  949. if (NOT ("${componentdep}" IN_LIST _boost_processed_components OR "${componentdep}" IN_LIST _boost_new_components))
  950. list(APPEND _boost_new_components ${componentdep})
  951. endif()
  952. endforeach()
  953. endforeach()
  954. set(_boost_unprocessed_components ${_boost_new_components})
  955. unset(_boost_new_components)
  956. endwhile()
  957. set(_boost_extra_components ${_boost_processed_components})
  958. if(_boost_extra_components AND ${componentvar})
  959. list(REMOVE_ITEM _boost_extra_components ${${componentvar}})
  960. endif()
  961. set(${componentvar} ${_boost_processed_components} PARENT_SCOPE)
  962. set(${extravar} ${_boost_extra_components} PARENT_SCOPE)
  963. endfunction()
  964. #
  965. # Some boost libraries may require particular set of compler features.
  966. # The very first one was `boost::fiber` introduced in Boost 1.62.
  967. # One can check required compiler features of it in
  968. # `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`.
  969. #
  970. function(_Boost_COMPILER_FEATURES component _ret)
  971. # Boost >= 1.62 and < 1.67
  972. if(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106700)
  973. set(_Boost_FIBER_COMPILER_FEATURES
  974. cxx_alias_templates
  975. cxx_auto_type
  976. cxx_constexpr
  977. cxx_defaulted_functions
  978. cxx_final
  979. cxx_lambdas
  980. cxx_noexcept
  981. cxx_nullptr
  982. cxx_rvalue_references
  983. cxx_thread_local
  984. cxx_variadic_templates
  985. )
  986. endif()
  987. string(TOUPPER ${component} uppercomponent)
  988. set(${_ret} ${_Boost_${uppercomponent}_COMPILER_FEATURES} PARENT_SCOPE)
  989. endfunction()
  990. #
  991. # Update library search directory hint variable with paths used by prebuilt boost binaries.
  992. #
  993. # Prebuilt windows binaries (https://sourceforge.net/projects/boost/files/boost-binaries/)
  994. # have library directories named using MSVC compiler version and architecture.
  995. # This function would append corresponding directories if MSVC is a current compiler,
  996. # so having `BOOST_ROOT` would be enough to specify to find everything.
  997. #
  998. function(_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS componentlibvar basedir)
  999. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
  1000. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  1001. set(_arch_suffix 64)
  1002. else()
  1003. set(_arch_suffix 32)
  1004. endif()
  1005. if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
  1006. list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.1)
  1007. list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-14.0)
  1008. elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 80)
  1009. math(EXPR _toolset_major_version "${MSVC_TOOLSET_VERSION} / 10")
  1010. list(APPEND ${componentlibvar} ${basedir}/lib${_arch_suffix}-msvc-${_toolset_major_version}.0)
  1011. endif()
  1012. set(${componentlibvar} ${${componentlibvar}} PARENT_SCOPE)
  1013. endif()
  1014. endfunction()
  1015. #
  1016. # End functions/macros
  1017. #
  1018. #-------------------------------------------------------------------------------
  1019. #-------------------------------------------------------------------------------
  1020. # main.
  1021. #-------------------------------------------------------------------------------
  1022. # If the user sets Boost_LIBRARY_DIR, use it as the default for both
  1023. # configurations.
  1024. if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR)
  1025. set(Boost_LIBRARY_DIR_RELEASE "${Boost_LIBRARY_DIR}")
  1026. endif()
  1027. if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR)
  1028. set(Boost_LIBRARY_DIR_DEBUG "${Boost_LIBRARY_DIR}")
  1029. endif()
  1030. if(NOT DEFINED Boost_USE_DEBUG_LIBS)
  1031. set(Boost_USE_DEBUG_LIBS TRUE)
  1032. endif()
  1033. if(NOT DEFINED Boost_USE_RELEASE_LIBS)
  1034. set(Boost_USE_RELEASE_LIBS TRUE)
  1035. endif()
  1036. if(NOT DEFINED Boost_USE_MULTITHREADED)
  1037. set(Boost_USE_MULTITHREADED TRUE)
  1038. endif()
  1039. if(NOT DEFINED Boost_USE_DEBUG_RUNTIME)
  1040. set(Boost_USE_DEBUG_RUNTIME TRUE)
  1041. endif()
  1042. # Check the version of Boost against the requested version.
  1043. if(Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR)
  1044. message(SEND_ERROR "When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34")
  1045. endif()
  1046. if(Boost_FIND_VERSION_EXACT)
  1047. # The version may appear in a directory with or without the patch
  1048. # level, even when the patch level is non-zero.
  1049. set(_boost_TEST_VERSIONS
  1050. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
  1051. "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1052. else()
  1053. # The user has not requested an exact version. Among known
  1054. # versions, find those that are acceptable to the user request.
  1055. #
  1056. # Note: When adding a new Boost release, also update the dependency
  1057. # information in _Boost_COMPONENT_DEPENDENCIES and
  1058. # _Boost_COMPONENT_HEADERS. See the instructions at the top of
  1059. # _Boost_COMPONENT_DEPENDENCIES.
  1060. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
  1061. "1.70.0" "1.70" "1.69.0" "1.69"
  1062. "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
  1063. "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
  1064. "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
  1065. "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
  1066. "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1"
  1067. "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
  1068. "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
  1069. "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
  1070. "1.34" "1.33.1" "1.33.0" "1.33")
  1071. set(_boost_TEST_VERSIONS)
  1072. if(Boost_FIND_VERSION)
  1073. set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1074. # Select acceptable versions.
  1075. foreach(version ${_Boost_KNOWN_VERSIONS})
  1076. if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
  1077. # This version is high enough.
  1078. list(APPEND _boost_TEST_VERSIONS "${version}")
  1079. elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
  1080. # This version is a short-form for the requested version with
  1081. # the patch level dropped.
  1082. list(APPEND _boost_TEST_VERSIONS "${version}")
  1083. endif()
  1084. endforeach()
  1085. else()
  1086. # Any version is acceptable.
  1087. set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
  1088. endif()
  1089. endif()
  1090. # The reason that we failed to find Boost. This will be set to a
  1091. # user-friendly message when we fail to find some necessary piece of
  1092. # Boost.
  1093. set(Boost_ERROR_REASON)
  1094. if(Boost_DEBUG)
  1095. # Output some of their choices
  1096. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1097. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  1098. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1099. "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}")
  1100. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1101. "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}")
  1102. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1103. "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}")
  1104. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1105. "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}")
  1106. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1107. "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}")
  1108. endif()
  1109. # Supply Boost_LIB_DIAGNOSTIC_DEFINITIONS as a convenience target. It
  1110. # will only contain any interface definitions on WIN32, but is created
  1111. # on all platforms to keep end user code free from platform dependent
  1112. # code. Also provide convenience targets to disable autolinking and
  1113. # enable dynamic linking.
  1114. if(NOT TARGET Boost::diagnostic_definitions)
  1115. add_library(Boost::diagnostic_definitions INTERFACE IMPORTED)
  1116. add_library(Boost::disable_autolinking INTERFACE IMPORTED)
  1117. add_library(Boost::dynamic_linking INTERFACE IMPORTED)
  1118. endif()
  1119. if(WIN32)
  1120. # In windows, automatic linking is performed, so you do not have
  1121. # to specify the libraries. If you are linking to a dynamic
  1122. # runtime, then you can choose to link to either a static or a
  1123. # dynamic Boost library, the default is to do a static link. You
  1124. # can alter this for a specific library "whatever" by defining
  1125. # BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
  1126. # linked dynamically. Alternatively you can force all Boost
  1127. # libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
  1128. # This feature can be disabled for Boost library "whatever" by
  1129. # defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
  1130. # BOOST_ALL_NO_LIB.
  1131. # If you want to observe which libraries are being linked against
  1132. # then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
  1133. # code to emit a #pragma message each time a library is selected
  1134. # for linking.
  1135. set(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
  1136. set_target_properties(Boost::diagnostic_definitions PROPERTIES
  1137. INTERFACE_COMPILE_DEFINITIONS "BOOST_LIB_DIAGNOSTIC")
  1138. set_target_properties(Boost::disable_autolinking PROPERTIES
  1139. INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_NO_LIB")
  1140. set_target_properties(Boost::dynamic_linking PROPERTIES
  1141. INTERFACE_COMPILE_DEFINITIONS "BOOST_ALL_DYN_LINK")
  1142. endif()
  1143. _Boost_CHECK_SPELLING(Boost_ROOT)
  1144. _Boost_CHECK_SPELLING(Boost_LIBRARYDIR)
  1145. _Boost_CHECK_SPELLING(Boost_INCLUDEDIR)
  1146. # Collect environment variable inputs as hints. Do not consider changes.
  1147. foreach(v BOOSTROOT BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR)
  1148. set(_env $ENV{${v}})
  1149. if(_env)
  1150. file(TO_CMAKE_PATH "${_env}" _ENV_${v})
  1151. else()
  1152. set(_ENV_${v} "")
  1153. endif()
  1154. endforeach()
  1155. if(NOT _ENV_BOOST_ROOT AND _ENV_BOOSTROOT)
  1156. set(_ENV_BOOST_ROOT "${_ENV_BOOSTROOT}")
  1157. endif()
  1158. # Collect inputs and cached results. Detect changes since the last run.
  1159. if(NOT BOOST_ROOT AND BOOSTROOT)
  1160. set(BOOST_ROOT "${BOOSTROOT}")
  1161. endif()
  1162. set(_Boost_VARS_DIR
  1163. BOOST_ROOT
  1164. Boost_NO_SYSTEM_PATHS
  1165. )
  1166. if(Boost_DEBUG)
  1167. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1168. "Declared as CMake or Environmental Variables:")
  1169. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1170. " BOOST_ROOT = ${BOOST_ROOT}")
  1171. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1172. " BOOST_INCLUDEDIR = ${BOOST_INCLUDEDIR}")
  1173. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1174. " BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
  1175. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1176. "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}")
  1177. endif()
  1178. # ------------------------------------------------------------------------
  1179. # Search for Boost include DIR
  1180. # ------------------------------------------------------------------------
  1181. set(_Boost_VARS_INC BOOST_INCLUDEDIR Boost_INCLUDE_DIR Boost_ADDITIONAL_VERSIONS)
  1182. _Boost_CHANGE_DETECT(_Boost_CHANGE_INCDIR ${_Boost_VARS_DIR} ${_Boost_VARS_INC})
  1183. # Clear Boost_INCLUDE_DIR if it did not change but other input affecting the
  1184. # location did. We will find a new one based on the new inputs.
  1185. if(_Boost_CHANGE_INCDIR AND NOT _Boost_INCLUDE_DIR_CHANGED)
  1186. unset(Boost_INCLUDE_DIR CACHE)
  1187. endif()
  1188. if(NOT Boost_INCLUDE_DIR)
  1189. set(_boost_INCLUDE_SEARCH_DIRS "")
  1190. if(BOOST_INCLUDEDIR)
  1191. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR})
  1192. elseif(_ENV_BOOST_INCLUDEDIR)
  1193. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_INCLUDEDIR})
  1194. endif()
  1195. if( BOOST_ROOT )
  1196. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${BOOST_ROOT})
  1197. elseif( _ENV_BOOST_ROOT )
  1198. list(APPEND _boost_INCLUDE_SEARCH_DIRS ${_ENV_BOOST_ROOT}/include ${_ENV_BOOST_ROOT})
  1199. endif()
  1200. if( Boost_NO_SYSTEM_PATHS)
  1201. list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
  1202. else()
  1203. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
  1204. foreach(ver ${_boost_TEST_VERSIONS})
  1205. string(REPLACE "." "_" ver "${ver}")
  1206. list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
  1207. endforeach()
  1208. endif()
  1209. list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS
  1210. C:/boost/include
  1211. C:/boost
  1212. /sw/local/include
  1213. )
  1214. endif()
  1215. # Try to find Boost by stepping backwards through the Boost versions
  1216. # we know about.
  1217. # Build a list of path suffixes for each version.
  1218. set(_boost_PATH_SUFFIXES)
  1219. foreach(_boost_VER ${_boost_TEST_VERSIONS})
  1220. # Add in a path suffix, based on the required version, ideally
  1221. # we could read this from version.hpp, but for that to work we'd
  1222. # need to know the include dir already
  1223. set(_boost_BOOSTIFIED_VERSION)
  1224. # Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
  1225. if(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
  1226. set(_boost_BOOSTIFIED_VERSION
  1227. "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}")
  1228. elseif(_boost_VER MATCHES "([0-9]+)\\.([0-9]+)")
  1229. set(_boost_BOOSTIFIED_VERSION
  1230. "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
  1231. endif()
  1232. list(APPEND _boost_PATH_SUFFIXES
  1233. "boost-${_boost_BOOSTIFIED_VERSION}"
  1234. "boost_${_boost_BOOSTIFIED_VERSION}"
  1235. "boost/boost-${_boost_BOOSTIFIED_VERSION}"
  1236. "boost/boost_${_boost_BOOSTIFIED_VERSION}"
  1237. )
  1238. endforeach()
  1239. if(Boost_DEBUG)
  1240. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1241. "Include debugging info:")
  1242. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1243. " _boost_INCLUDE_SEARCH_DIRS = ${_boost_INCLUDE_SEARCH_DIRS}")
  1244. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1245. " _boost_PATH_SUFFIXES = ${_boost_PATH_SUFFIXES}")
  1246. endif()
  1247. # Look for a standard boost header file.
  1248. find_path(Boost_INCLUDE_DIR
  1249. NAMES boost/config.hpp
  1250. HINTS ${_boost_INCLUDE_SEARCH_DIRS}
  1251. PATH_SUFFIXES ${_boost_PATH_SUFFIXES}
  1252. )
  1253. endif()
  1254. # ------------------------------------------------------------------------
  1255. # Extract version information from version.hpp
  1256. # ------------------------------------------------------------------------
  1257. # Set Boost_FOUND based only on header location and version.
  1258. # It will be updated below for component libraries.
  1259. if(Boost_INCLUDE_DIR)
  1260. if(Boost_DEBUG)
  1261. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1262. "location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
  1263. endif()
  1264. # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp
  1265. set(Boost_VERSION 0)
  1266. set(Boost_LIB_VERSION "")
  1267. file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
  1268. set(_Boost_VERSION_REGEX "([0-9]+)")
  1269. set(_Boost_LIB_VERSION_REGEX "\"([0-9_]+)\"")
  1270. foreach(v VERSION LIB_VERSION)
  1271. if("${_boost_VERSION_HPP_CONTENTS}" MATCHES "#define BOOST_${v} ${_Boost_${v}_REGEX}")
  1272. set(Boost_${v} "${CMAKE_MATCH_1}")
  1273. endif()
  1274. endforeach()
  1275. unset(_boost_VERSION_HPP_CONTENTS)
  1276. math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
  1277. math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
  1278. math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
  1279. set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  1280. string(APPEND Boost_ERROR_REASON
  1281. "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
  1282. if(Boost_DEBUG)
  1283. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1284. "version.hpp reveals boost "
  1285. "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  1286. endif()
  1287. if(Boost_FIND_VERSION)
  1288. # Set Boost_FOUND based on requested version.
  1289. set(_Boost_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  1290. if("${_Boost_VERSION}" VERSION_LESS "${Boost_FIND_VERSION}")
  1291. set(Boost_FOUND 0)
  1292. set(_Boost_VERSION_AGE "old")
  1293. elseif(Boost_FIND_VERSION_EXACT AND
  1294. NOT "${_Boost_VERSION}" VERSION_EQUAL "${Boost_FIND_VERSION}")
  1295. set(Boost_FOUND 0)
  1296. set(_Boost_VERSION_AGE "new")
  1297. else()
  1298. set(Boost_FOUND 1)
  1299. endif()
  1300. if(NOT Boost_FOUND)
  1301. # State that we found a version of Boost that is too new or too old.
  1302. string(APPEND Boost_ERROR_REASON
  1303. "\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
  1304. if (Boost_FIND_VERSION_PATCH)
  1305. string(APPEND Boost_ERROR_REASON
  1306. ".${Boost_FIND_VERSION_PATCH}")
  1307. endif ()
  1308. if (NOT Boost_FIND_VERSION_EXACT)
  1309. string(APPEND Boost_ERROR_REASON " (or newer)")
  1310. endif ()
  1311. string(APPEND Boost_ERROR_REASON ".")
  1312. endif ()
  1313. else()
  1314. # Caller will accept any Boost version.
  1315. set(Boost_FOUND 1)
  1316. endif()
  1317. else()
  1318. set(Boost_FOUND 0)
  1319. string(APPEND Boost_ERROR_REASON
  1320. "Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
  1321. endif()
  1322. # ------------------------------------------------------------------------
  1323. # Prefix initialization
  1324. # ------------------------------------------------------------------------
  1325. set(Boost_LIB_PREFIX "")
  1326. if ( (GHSMULTI AND Boost_USE_STATIC_LIBS) OR
  1327. (WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) )
  1328. set(Boost_LIB_PREFIX "lib")
  1329. endif()
  1330. if ( NOT Boost_NAMESPACE )
  1331. set(Boost_NAMESPACE "boost")
  1332. endif()
  1333. if(Boost_DEBUG)
  1334. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1335. "Boost_LIB_PREFIX = ${Boost_LIB_PREFIX}")
  1336. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1337. "Boost_NAMESPACE = ${Boost_NAMESPACE}")
  1338. endif()
  1339. # ------------------------------------------------------------------------
  1340. # Suffix initialization and compiler suffix detection.
  1341. # ------------------------------------------------------------------------
  1342. set(_Boost_VARS_NAME
  1343. Boost_NAMESPACE
  1344. Boost_COMPILER
  1345. Boost_THREADAPI
  1346. Boost_USE_DEBUG_PYTHON
  1347. Boost_USE_MULTITHREADED
  1348. Boost_USE_STATIC_LIBS
  1349. Boost_USE_STATIC_RUNTIME
  1350. Boost_USE_STLPORT
  1351. Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
  1352. )
  1353. _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBNAME ${_Boost_VARS_NAME})
  1354. # Setting some more suffixes for the library
  1355. if (Boost_COMPILER)
  1356. set(_boost_COMPILER ${Boost_COMPILER})
  1357. if(Boost_DEBUG)
  1358. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1359. "using user-specified Boost_COMPILER = ${_boost_COMPILER}")
  1360. endif()
  1361. else()
  1362. # Attempt to guess the compiler suffix
  1363. # NOTE: this is not perfect yet, if you experience any issues
  1364. # please report them and use the Boost_COMPILER variable
  1365. # to work around the problems.
  1366. _Boost_GUESS_COMPILER_PREFIX(_boost_COMPILER)
  1367. if(Boost_DEBUG)
  1368. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1369. "guessed _boost_COMPILER = ${_boost_COMPILER}")
  1370. endif()
  1371. endif()
  1372. set (_boost_MULTITHREADED "-mt")
  1373. if( NOT Boost_USE_MULTITHREADED )
  1374. set (_boost_MULTITHREADED "")
  1375. endif()
  1376. if(Boost_DEBUG)
  1377. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1378. "_boost_MULTITHREADED = ${_boost_MULTITHREADED}")
  1379. endif()
  1380. #======================
  1381. # Systematically build up the Boost ABI tag for the 'tagged' and 'versioned' layouts
  1382. # http://boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming
  1383. # http://boost.org/doc/libs/1_66_0/boost/config/auto_link.hpp
  1384. # http://boost.org/doc/libs/1_66_0/tools/build/src/tools/common.jam
  1385. # http://boost.org/doc/libs/1_66_0/boostcpp.jam
  1386. set( _boost_RELEASE_ABI_TAG "-")
  1387. set( _boost_DEBUG_ABI_TAG "-")
  1388. # Key Use this library when:
  1389. # s linking statically to the C++ standard library and
  1390. # compiler runtime support libraries.
  1391. if(Boost_USE_STATIC_RUNTIME)
  1392. set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s")
  1393. set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s")
  1394. endif()
  1395. # g using debug versions of the standard and runtime
  1396. # support libraries
  1397. if(WIN32 AND Boost_USE_DEBUG_RUNTIME)
  1398. if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
  1399. OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang"
  1400. OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
  1401. string(APPEND _boost_DEBUG_ABI_TAG "g")
  1402. endif()
  1403. endif()
  1404. # y using special debug build of python
  1405. if(Boost_USE_DEBUG_PYTHON)
  1406. string(APPEND _boost_DEBUG_ABI_TAG "y")
  1407. endif()
  1408. # d using a debug version of your code
  1409. string(APPEND _boost_DEBUG_ABI_TAG "d")
  1410. # p using the STLport standard library rather than the
  1411. # default one supplied with your compiler
  1412. if(Boost_USE_STLPORT)
  1413. string(APPEND _boost_RELEASE_ABI_TAG "p")
  1414. string(APPEND _boost_DEBUG_ABI_TAG "p")
  1415. endif()
  1416. # n using the STLport deprecated "native iostreams" feature
  1417. # removed from the documentation in 1.43.0 but still present in
  1418. # boost/config/auto_link.hpp
  1419. if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
  1420. string(APPEND _boost_RELEASE_ABI_TAG "n")
  1421. string(APPEND _boost_DEBUG_ABI_TAG "n")
  1422. endif()
  1423. # -x86 Architecture and address model tag
  1424. # First character is the architecture, then word-size, either 32 or 64
  1425. # Only used in 'versioned' layout, added in Boost 1.66.0
  1426. if(DEFINED Boost_ARCHITECTURE)
  1427. set(_boost_ARCHITECTURE_TAG "${Boost_ARCHITECTURE}")
  1428. if(Boost_DEBUG)
  1429. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1430. "using user-specified Boost_ARCHITECTURE = ${_boost_ARCHITECTURE_TAG}")
  1431. endif()
  1432. else()
  1433. set(_boost_ARCHITECTURE_TAG "")
  1434. # {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
  1435. if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
  1436. string(APPEND _boost_ARCHITECTURE_TAG "-")
  1437. # This needs to be kept in-sync with the section of CMakePlatformId.h.in
  1438. # inside 'defined(_WIN32) && defined(_MSC_VER)'
  1439. if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "IA64")
  1440. string(APPEND _boost_ARCHITECTURE_TAG "i")
  1441. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "X86"
  1442. OR CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
  1443. string(APPEND _boost_ARCHITECTURE_TAG "x")
  1444. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "^ARM")
  1445. string(APPEND _boost_ARCHITECTURE_TAG "a")
  1446. elseif(CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL "MIPS")
  1447. string(APPEND _boost_ARCHITECTURE_TAG "m")
  1448. endif()
  1449. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  1450. string(APPEND _boost_ARCHITECTURE_TAG "64")
  1451. else()
  1452. string(APPEND _boost_ARCHITECTURE_TAG "32")
  1453. endif()
  1454. endif()
  1455. endif()
  1456. if(Boost_DEBUG)
  1457. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1458. "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
  1459. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1460. "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}")
  1461. endif()
  1462. # ------------------------------------------------------------------------
  1463. # Begin finding boost libraries
  1464. # ------------------------------------------------------------------------
  1465. set(_Boost_VARS_LIB "")
  1466. foreach(c DEBUG RELEASE)
  1467. set(_Boost_VARS_LIB_${c} BOOST_LIBRARYDIR Boost_LIBRARY_DIR_${c})
  1468. list(APPEND _Boost_VARS_LIB ${_Boost_VARS_LIB_${c}})
  1469. _Boost_CHANGE_DETECT(_Boost_CHANGE_LIBDIR_${c} ${_Boost_VARS_DIR} ${_Boost_VARS_LIB_${c}} Boost_INCLUDE_DIR)
  1470. # Clear Boost_LIBRARY_DIR_${c} if it did not change but other input affecting the
  1471. # location did. We will find a new one based on the new inputs.
  1472. if(_Boost_CHANGE_LIBDIR_${c} AND NOT _Boost_LIBRARY_DIR_${c}_CHANGED)
  1473. unset(Boost_LIBRARY_DIR_${c} CACHE)
  1474. endif()
  1475. # If Boost_LIBRARY_DIR_[RELEASE,DEBUG] is set, prefer its value.
  1476. if(Boost_LIBRARY_DIR_${c})
  1477. set(_boost_LIBRARY_SEARCH_DIRS_${c} ${Boost_LIBRARY_DIR_${c}} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  1478. else()
  1479. set(_boost_LIBRARY_SEARCH_DIRS_${c} "")
  1480. if(BOOST_LIBRARYDIR)
  1481. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_LIBRARYDIR})
  1482. elseif(_ENV_BOOST_LIBRARYDIR)
  1483. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_LIBRARYDIR})
  1484. endif()
  1485. if(BOOST_ROOT)
  1486. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${BOOST_ROOT}/lib ${BOOST_ROOT}/stage/lib)
  1487. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${BOOST_ROOT}")
  1488. elseif(_ENV_BOOST_ROOT)
  1489. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} ${_ENV_BOOST_ROOT}/lib ${_ENV_BOOST_ROOT}/stage/lib)
  1490. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${_ENV_BOOST_ROOT}")
  1491. endif()
  1492. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c}
  1493. ${Boost_INCLUDE_DIR}/lib
  1494. ${Boost_INCLUDE_DIR}/../lib
  1495. ${Boost_INCLUDE_DIR}/stage/lib
  1496. )
  1497. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}/..")
  1498. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}")
  1499. if( Boost_NO_SYSTEM_PATHS )
  1500. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
  1501. else()
  1502. foreach(ver ${_boost_TEST_VERSIONS})
  1503. string(REPLACE "." "_" ver "${ver}")
  1504. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
  1505. endforeach()
  1506. _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/boost")
  1507. list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} PATHS
  1508. C:/boost/lib
  1509. C:/boost
  1510. /sw/local/lib
  1511. )
  1512. endif()
  1513. endif()
  1514. endforeach()
  1515. if(Boost_DEBUG)
  1516. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1517. "_boost_LIBRARY_SEARCH_DIRS_RELEASE = ${_boost_LIBRARY_SEARCH_DIRS_RELEASE}"
  1518. "_boost_LIBRARY_SEARCH_DIRS_DEBUG = ${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
  1519. endif()
  1520. # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  1521. if( Boost_USE_STATIC_LIBS )
  1522. set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  1523. if(WIN32)
  1524. list(INSERT CMAKE_FIND_LIBRARY_SUFFIXES 0 .lib .a)
  1525. else()
  1526. set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
  1527. endif()
  1528. endif()
  1529. # We want to use the tag inline below without risking double dashes
  1530. if(_boost_RELEASE_ABI_TAG)
  1531. if(${_boost_RELEASE_ABI_TAG} STREQUAL "-")
  1532. set(_boost_RELEASE_ABI_TAG "")
  1533. endif()
  1534. endif()
  1535. if(_boost_DEBUG_ABI_TAG)
  1536. if(${_boost_DEBUG_ABI_TAG} STREQUAL "-")
  1537. set(_boost_DEBUG_ABI_TAG "")
  1538. endif()
  1539. endif()
  1540. # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled
  1541. # on WIN32 was to:
  1542. # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
  1543. # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
  1544. # We maintain this behavior since changing it could break people's builds.
  1545. # To disable the ambiguous behavior, the user need only
  1546. # set Boost_USE_STATIC_RUNTIME either ON or OFF.
  1547. set(_boost_STATIC_RUNTIME_WORKAROUND false)
  1548. if(WIN32 AND Boost_USE_STATIC_LIBS)
  1549. if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
  1550. set(_boost_STATIC_RUNTIME_WORKAROUND TRUE)
  1551. endif()
  1552. endif()
  1553. # On versions < 1.35, remove the System library from the considered list
  1554. # since it wasn't added until 1.35.
  1555. if(Boost_VERSION AND Boost_FIND_COMPONENTS)
  1556. if(Boost_VERSION LESS 103500)
  1557. list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
  1558. endif()
  1559. endif()
  1560. # Additional components may be required via component dependencies.
  1561. # Add any missing components to the list.
  1562. _Boost_MISSING_DEPENDENCIES(Boost_FIND_COMPONENTS _Boost_EXTRA_FIND_COMPONENTS)
  1563. # If thread is required, get the thread libs as a dependency
  1564. if("thread" IN_LIST Boost_FIND_COMPONENTS)
  1565. if(Boost_FIND_QUIETLY)
  1566. set(_Boost_find_quiet QUIET)
  1567. else()
  1568. set(_Boost_find_quiet "")
  1569. endif()
  1570. find_package(Threads ${_Boost_find_quiet})
  1571. unset(_Boost_find_quiet)
  1572. endif()
  1573. # If the user changed any of our control inputs flush previous results.
  1574. if(_Boost_CHANGE_LIBDIR_DEBUG OR _Boost_CHANGE_LIBDIR_RELEASE OR _Boost_CHANGE_LIBNAME)
  1575. foreach(COMPONENT ${_Boost_COMPONENTS_SEARCHED})
  1576. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1577. foreach(c DEBUG RELEASE)
  1578. set(_var Boost_${UPPERCOMPONENT}_LIBRARY_${c})
  1579. unset(${_var} CACHE)
  1580. set(${_var} "${_var}-NOTFOUND")
  1581. endforeach()
  1582. endforeach()
  1583. set(_Boost_COMPONENTS_SEARCHED "")
  1584. endif()
  1585. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1586. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1587. set( _boost_docstring_release "Boost ${COMPONENT} library (release)")
  1588. set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)")
  1589. # Compute component-specific hints.
  1590. set(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT "")
  1591. if(${COMPONENT} STREQUAL "mpi" OR ${COMPONENT} STREQUAL "mpi_python" OR
  1592. ${COMPONENT} STREQUAL "graph_parallel")
  1593. foreach(lib ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES})
  1594. if(IS_ABSOLUTE "${lib}")
  1595. get_filename_component(libdir "${lib}" PATH)
  1596. string(REPLACE "\\" "/" libdir "${libdir}")
  1597. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT ${libdir})
  1598. endif()
  1599. endforeach()
  1600. endif()
  1601. # Handle Python version suffixes
  1602. unset(COMPONENT_PYTHON_VERSION_MAJOR)
  1603. unset(COMPONENT_PYTHON_VERSION_MINOR)
  1604. if(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\$")
  1605. set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
  1606. set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
  1607. elseif(${COMPONENT} MATCHES "^(python|mpi_python|numpy)([0-9])\\.?([0-9])\$")
  1608. set(COMPONENT_UNVERSIONED "${CMAKE_MATCH_1}")
  1609. set(COMPONENT_PYTHON_VERSION_MAJOR "${CMAKE_MATCH_2}")
  1610. set(COMPONENT_PYTHON_VERSION_MINOR "${CMAKE_MATCH_3}")
  1611. endif()
  1612. unset(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1613. if (COMPONENT_PYTHON_VERSION_MINOR)
  1614. # Boost >= 1.67
  1615. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1616. # Debian/Ubuntu (Some versions omit the 2 and/or 3 from the suffix)
  1617. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1618. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-py${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1619. # Gentoo
  1620. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1621. # RPMs
  1622. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}-${COMPONENT_PYTHON_VERSION_MAJOR}${COMPONENT_PYTHON_VERSION_MINOR}")
  1623. endif()
  1624. if (COMPONENT_PYTHON_VERSION_MAJOR AND NOT COMPONENT_PYTHON_VERSION_MINOR)
  1625. # Boost < 1.67
  1626. list(APPEND _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME "${COMPONENT_UNVERSIONED}${COMPONENT_PYTHON_VERSION_MAJOR}")
  1627. endif()
  1628. # Consolidate and report component-specific hints.
  1629. if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1630. list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME)
  1631. if(Boost_DEBUG)
  1632. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1633. "Component-specific library search names for ${COMPONENT_NAME}: "
  1634. "${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME}")
  1635. endif()
  1636. endif()
  1637. if(_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  1638. list(REMOVE_DUPLICATES _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT)
  1639. if(Boost_DEBUG)
  1640. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1641. "Component-specific library search paths for ${COMPONENT}: "
  1642. "${_Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT}")
  1643. endif()
  1644. endif()
  1645. #
  1646. # Find headers
  1647. #
  1648. _Boost_COMPONENT_HEADERS("${COMPONENT}" Boost_${UPPERCOMPONENT}_HEADER_NAME)
  1649. # Look for a standard boost header file.
  1650. if(Boost_${UPPERCOMPONENT}_HEADER_NAME)
  1651. if(EXISTS "${Boost_INCLUDE_DIR}/${Boost_${UPPERCOMPONENT}_HEADER_NAME}")
  1652. set(Boost_${UPPERCOMPONENT}_HEADER ON)
  1653. else()
  1654. set(Boost_${UPPERCOMPONENT}_HEADER OFF)
  1655. endif()
  1656. else()
  1657. set(Boost_${UPPERCOMPONENT}_HEADER ON)
  1658. message(WARNING "No header defined for ${COMPONENT}; skipping header check")
  1659. endif()
  1660. #
  1661. # Find RELEASE libraries
  1662. #
  1663. unset(_boost_RELEASE_NAMES)
  1664. foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
  1665. foreach(compiler IN LISTS _boost_COMPILER)
  1666. list(APPEND _boost_RELEASE_NAMES
  1667. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1668. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1669. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
  1670. endforeach()
  1671. list(APPEND _boost_RELEASE_NAMES
  1672. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1673. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1674. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
  1675. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
  1676. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
  1677. if(_boost_STATIC_RUNTIME_WORKAROUND)
  1678. set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
  1679. foreach(compiler IN LISTS _boost_COMPILER)
  1680. list(APPEND _boost_RELEASE_NAMES
  1681. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1682. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1683. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
  1684. endforeach()
  1685. list(APPEND _boost_RELEASE_NAMES
  1686. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1687. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1688. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
  1689. endif()
  1690. endforeach()
  1691. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  1692. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES})
  1693. endif()
  1694. if(Boost_DEBUG)
  1695. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1696. "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}")
  1697. endif()
  1698. # if Boost_LIBRARY_DIR_RELEASE is not defined,
  1699. # but Boost_LIBRARY_DIR_DEBUG is, look there first for RELEASE libs
  1700. if(NOT Boost_LIBRARY_DIR_RELEASE AND Boost_LIBRARY_DIR_DEBUG)
  1701. list(INSERT _boost_LIBRARY_SEARCH_DIRS_RELEASE 0 ${Boost_LIBRARY_DIR_DEBUG})
  1702. endif()
  1703. # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
  1704. string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_RELEASE}")
  1705. if(Boost_USE_RELEASE_LIBS)
  1706. _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE RELEASE
  1707. NAMES ${_boost_RELEASE_NAMES}
  1708. HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
  1709. NAMES_PER_DIR
  1710. DOC "${_boost_docstring_release}"
  1711. )
  1712. endif()
  1713. #
  1714. # Find DEBUG libraries
  1715. #
  1716. unset(_boost_DEBUG_NAMES)
  1717. foreach(component IN LISTS _Boost_FIND_LIBRARY_HINTS_FOR_COMPONENT_NAME COMPONENT)
  1718. foreach(compiler IN LISTS _boost_COMPILER)
  1719. list(APPEND _boost_DEBUG_NAMES
  1720. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1721. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1722. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
  1723. endforeach()
  1724. list(APPEND _boost_DEBUG_NAMES
  1725. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1726. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1727. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
  1728. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
  1729. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
  1730. if(_boost_STATIC_RUNTIME_WORKAROUND)
  1731. set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
  1732. foreach(compiler IN LISTS _boost_COMPILER)
  1733. list(APPEND _boost_DEBUG_NAMES
  1734. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1735. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1736. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
  1737. endforeach()
  1738. list(APPEND _boost_DEBUG_NAMES
  1739. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
  1740. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
  1741. ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
  1742. endif()
  1743. endforeach()
  1744. if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
  1745. _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES})
  1746. endif()
  1747. if(Boost_DEBUG)
  1748. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
  1749. "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}")
  1750. endif()
  1751. # if Boost_LIBRARY_DIR_DEBUG is not defined,
  1752. # but Boost_LIBRARY_DIR_RELEASE is, look there first for DEBUG libs
  1753. if(NOT Boost_LIBRARY_DIR_DEBUG AND Boost_LIBRARY_DIR_RELEASE)
  1754. list(INSERT _boost_LIBRARY_SEARCH_DIRS_DEBUG 0 ${Boost_LIBRARY_DIR_RELEASE})
  1755. endif()
  1756. # Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
  1757. string(REPLACE "\\" "/" _boost_LIBRARY_SEARCH_DIRS_tmp "${_boost_LIBRARY_SEARCH_DIRS_DEBUG}")
  1758. if(Boost_USE_DEBUG_LIBS)
  1759. _Boost_FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG DEBUG
  1760. NAMES ${_boost_DEBUG_NAMES}
  1761. HINTS ${_boost_LIBRARY_SEARCH_DIRS_tmp}
  1762. NAMES_PER_DIR
  1763. DOC "${_boost_docstring_debug}"
  1764. )
  1765. endif ()
  1766. if(Boost_REALPATH)
  1767. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}")
  1768. _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" )
  1769. endif()
  1770. _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT})
  1771. # Check if component requires some compiler features
  1772. _Boost_COMPILER_FEATURES(${COMPONENT} _Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
  1773. endforeach()
  1774. # Restore the original find library ordering
  1775. if( Boost_USE_STATIC_LIBS )
  1776. set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
  1777. endif()
  1778. # ------------------------------------------------------------------------
  1779. # End finding boost libraries
  1780. # ------------------------------------------------------------------------
  1781. set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
  1782. set(Boost_LIBRARY_DIRS)
  1783. if(Boost_LIBRARY_DIR_RELEASE)
  1784. list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_RELEASE})
  1785. endif()
  1786. if(Boost_LIBRARY_DIR_DEBUG)
  1787. list(APPEND Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR_DEBUG})
  1788. endif()
  1789. if(Boost_LIBRARY_DIRS)
  1790. list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS)
  1791. endif()
  1792. # The above setting of Boost_FOUND was based only on the header files.
  1793. # Update it for the requested component libraries.
  1794. if(Boost_FOUND)
  1795. # The headers were found. Check for requested component libs.
  1796. set(_boost_CHECKED_COMPONENT FALSE)
  1797. set(_Boost_MISSING_COMPONENTS "")
  1798. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1799. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1800. set(_boost_CHECKED_COMPONENT TRUE)
  1801. if(NOT Boost_${UPPERCOMPONENT}_FOUND AND Boost_FIND_REQUIRED_${COMPONENT})
  1802. list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT})
  1803. endif()
  1804. endforeach()
  1805. if(_Boost_MISSING_COMPONENTS AND _Boost_EXTRA_FIND_COMPONENTS)
  1806. # Optional indirect dependencies are not counted as missing.
  1807. list(REMOVE_ITEM _Boost_MISSING_COMPONENTS ${_Boost_EXTRA_FIND_COMPONENTS})
  1808. endif()
  1809. if(Boost_DEBUG)
  1810. message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] Boost_FOUND = ${Boost_FOUND}")
  1811. endif()
  1812. if (_Boost_MISSING_COMPONENTS)
  1813. set(Boost_FOUND 0)
  1814. # We were unable to find some libraries, so generate a sensible
  1815. # error message that lists the libraries we were unable to find.
  1816. string(APPEND Boost_ERROR_REASON
  1817. "\nCould not find the following")
  1818. if(Boost_USE_STATIC_LIBS)
  1819. string(APPEND Boost_ERROR_REASON " static")
  1820. endif()
  1821. string(APPEND Boost_ERROR_REASON
  1822. " Boost libraries:\n")
  1823. foreach(COMPONENT ${_Boost_MISSING_COMPONENTS})
  1824. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1825. string(APPEND Boost_ERROR_REASON
  1826. " ${Boost_NAMESPACE}_${COMPONENT}${Boost_ERROR_REASON_${UPPERCOMPONENT}}\n")
  1827. endforeach()
  1828. list(LENGTH Boost_FIND_COMPONENTS Boost_NUM_COMPONENTS_WANTED)
  1829. list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS)
  1830. if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS})
  1831. string(APPEND Boost_ERROR_REASON
  1832. "No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
  1833. else ()
  1834. string(APPEND Boost_ERROR_REASON
  1835. "Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.")
  1836. endif ()
  1837. endif ()
  1838. if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT )
  1839. # Compatibility Code for backwards compatibility with CMake
  1840. # 2.4's FindBoost module.
  1841. # Look for the boost library path.
  1842. # Note that the user may not have installed any libraries
  1843. # so it is quite possible the Boost_LIBRARY_DIRS may not exist.
  1844. set(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
  1845. if("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
  1846. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1847. endif()
  1848. if("${_boost_LIB_DIR}" MATCHES "/include$")
  1849. # Strip off the trailing "/include" in the path.
  1850. get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
  1851. endif()
  1852. if(EXISTS "${_boost_LIB_DIR}/lib")
  1853. string(APPEND _boost_LIB_DIR /lib)
  1854. elseif(EXISTS "${_boost_LIB_DIR}/stage/lib")
  1855. string(APPEND _boost_LIB_DIR "/stage/lib")
  1856. else()
  1857. set(_boost_LIB_DIR "")
  1858. endif()
  1859. if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
  1860. set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR})
  1861. endif()
  1862. endif()
  1863. else()
  1864. # Boost headers were not found so no components were found.
  1865. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1866. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1867. set(Boost_${UPPERCOMPONENT}_FOUND 0)
  1868. endforeach()
  1869. endif()
  1870. # ------------------------------------------------------------------------
  1871. # Add imported targets
  1872. # ------------------------------------------------------------------------
  1873. if(Boost_FOUND)
  1874. # For header-only libraries
  1875. if(NOT TARGET Boost::boost)
  1876. add_library(Boost::boost INTERFACE IMPORTED)
  1877. if(Boost_INCLUDE_DIRS)
  1878. set_target_properties(Boost::boost PROPERTIES
  1879. INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
  1880. endif()
  1881. endif()
  1882. foreach(COMPONENT ${Boost_FIND_COMPONENTS})
  1883. if(_Boost_IMPORTED_TARGETS AND NOT TARGET Boost::${COMPONENT})
  1884. string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
  1885. if(Boost_${UPPERCOMPONENT}_FOUND)
  1886. if(Boost_USE_STATIC_LIBS)
  1887. add_library(Boost::${COMPONENT} STATIC IMPORTED)
  1888. else()
  1889. # Even if Boost_USE_STATIC_LIBS is OFF, we might have static
  1890. # libraries as a result.
  1891. add_library(Boost::${COMPONENT} UNKNOWN IMPORTED)
  1892. endif()
  1893. if(Boost_INCLUDE_DIRS)
  1894. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1895. INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}")
  1896. endif()
  1897. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY}")
  1898. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1899. IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
  1900. IMPORTED_LOCATION "${Boost_${UPPERCOMPONENT}_LIBRARY}")
  1901. endif()
  1902. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
  1903. set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
  1904. IMPORTED_CONFIGURATIONS RELEASE)
  1905. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1906. IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
  1907. IMPORTED_LOCATION_RELEASE "${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
  1908. endif()
  1909. if(EXISTS "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
  1910. set_property(TARGET Boost::${COMPONENT} APPEND PROPERTY
  1911. IMPORTED_CONFIGURATIONS DEBUG)
  1912. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1913. IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
  1914. IMPORTED_LOCATION_DEBUG "${Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG}")
  1915. endif()
  1916. if(_Boost_${UPPERCOMPONENT}_DEPENDENCIES)
  1917. unset(_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES)
  1918. foreach(dep ${_Boost_${UPPERCOMPONENT}_DEPENDENCIES})
  1919. list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Boost::${dep})
  1920. endforeach()
  1921. if(COMPONENT STREQUAL "thread")
  1922. list(APPEND _Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES Threads::Threads)
  1923. endif()
  1924. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1925. INTERFACE_LINK_LIBRARIES "${_Boost_${UPPERCOMPONENT}_TARGET_DEPENDENCIES}")
  1926. endif()
  1927. if(_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES)
  1928. set_target_properties(Boost::${COMPONENT} PROPERTIES
  1929. INTERFACE_COMPILE_FEATURES "${_Boost_${UPPERCOMPONENT}_COMPILER_FEATURES}")
  1930. endif()
  1931. endif()
  1932. endif()
  1933. endforeach()
  1934. endif()
  1935. # ------------------------------------------------------------------------
  1936. # Notification to end user about what was found
  1937. # ------------------------------------------------------------------------
  1938. set(Boost_LIBRARIES "")
  1939. if(Boost_FOUND)
  1940. if(NOT Boost_FIND_QUIETLY)
  1941. message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
  1942. if(Boost_FIND_COMPONENTS)
  1943. message(STATUS "Found the following Boost libraries:")
  1944. endif()
  1945. endif()
  1946. foreach( COMPONENT ${Boost_FIND_COMPONENTS} )
  1947. string( TOUPPER ${COMPONENT} UPPERCOMPONENT )
  1948. if( Boost_${UPPERCOMPONENT}_FOUND )
  1949. if(NOT Boost_FIND_QUIETLY)
  1950. message (STATUS " ${COMPONENT}")
  1951. endif()
  1952. list(APPEND Boost_LIBRARIES ${Boost_${UPPERCOMPONENT}_LIBRARY})
  1953. if(COMPONENT STREQUAL "thread")
  1954. list(APPEND Boost_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
  1955. endif()
  1956. endif()
  1957. endforeach()
  1958. else()
  1959. if(Boost_FIND_REQUIRED)
  1960. message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}")
  1961. else()
  1962. if(NOT Boost_FIND_QUIETLY)
  1963. # we opt not to automatically output Boost_ERROR_REASON here as
  1964. # it could be quite lengthy and somewhat imposing in its requests
  1965. # Since Boost is not always a required dependency we'll leave this
  1966. # up to the end-user.
  1967. if(Boost_DEBUG OR Boost_DETAILED_FAILURE_MSG)
  1968. message(STATUS "Could NOT find Boost\n${Boost_ERROR_REASON}")
  1969. else()
  1970. message(STATUS "Could NOT find Boost")
  1971. endif()
  1972. endif()
  1973. endif()
  1974. endif()
  1975. # Configure display of cache entries in GUI.
  1976. foreach(v BOOSTROOT BOOST_ROOT ${_Boost_VARS_INC} ${_Boost_VARS_LIB})
  1977. get_property(_type CACHE ${v} PROPERTY TYPE)
  1978. if(_type)
  1979. set_property(CACHE ${v} PROPERTY ADVANCED 1)
  1980. if("x${_type}" STREQUAL "xUNINITIALIZED")
  1981. if("x${v}" STREQUAL "xBoost_ADDITIONAL_VERSIONS")
  1982. set_property(CACHE ${v} PROPERTY TYPE STRING)
  1983. else()
  1984. set_property(CACHE ${v} PROPERTY TYPE PATH)
  1985. endif()
  1986. endif()
  1987. endif()
  1988. endforeach()
  1989. # Record last used values of input variables so we can
  1990. # detect on the next run if the user changed them.
  1991. foreach(v
  1992. ${_Boost_VARS_INC} ${_Boost_VARS_LIB}
  1993. ${_Boost_VARS_DIR} ${_Boost_VARS_NAME}
  1994. )
  1995. if(DEFINED ${v})
  1996. set(_${v}_LAST "${${v}}" CACHE INTERNAL "Last used ${v} value.")
  1997. else()
  1998. unset(_${v}_LAST CACHE)
  1999. endif()
  2000. endforeach()
  2001. # Maintain a persistent list of components requested anywhere since
  2002. # the last flush.
  2003. set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}")
  2004. list(APPEND _Boost_COMPONENTS_SEARCHED ${Boost_FIND_COMPONENTS})
  2005. list(REMOVE_DUPLICATES _Boost_COMPONENTS_SEARCHED)
  2006. list(SORT _Boost_COMPONENTS_SEARCHED)
  2007. set(_Boost_COMPONENTS_SEARCHED "${_Boost_COMPONENTS_SEARCHED}"
  2008. CACHE INTERNAL "Components requested for this build tree.")
  2009. # Restore project's policies
  2010. cmake_policy(POP)