boost.cmake 1.6 KB
Newer Older
1
set(boost_platform_options)
Ben Boeckel's avatar
Ben Boeckel committed
2

Ben Boeckel's avatar
Ben Boeckel committed
3
# 8.0 and below unsupported anyways.
4 5 6
if (NOT MSVC_VERSION VERSION_GREATER 1400)
  message(FATAL_ERROR "At least Visual Studio 9.0 is required")
elseif (NOT MSVC_VERSION VERSION_GREATER 1500)
Ben Boeckel's avatar
Ben Boeckel committed
7
  set(msvc_ver 9.0)
8
elseif (NOT MSVC_VERSION VERSION_GREATER 1600)
Ben Boeckel's avatar
Ben Boeckel committed
9
  set(msvc_ver 10.0)
10
elseif (NOT MSVC_VERSION VERSION_GREATER 1700)
Ben Boeckel's avatar
Ben Boeckel committed
11
  set(msvc_ver 11.0)
12
elseif (NOT MSVC_VERSION VERSION_GREATER 1800)
Ben Boeckel's avatar
Ben Boeckel committed
13
  set(msvc_ver 12.0)
14
elseif (NOT MSVC_VERSION VERSION_GREATER 1900)
Ben Boeckel's avatar
Ben Boeckel committed
15
  set(msvc_ver 14.0)
TJ Corona's avatar
TJ Corona committed
16 17
elseif (NOT MSVC_VERSION VERSION_GREATER 1910)
  set(msvc_ver 14.1)
Ben Boeckel's avatar
Ben Boeckel committed
18 19
elseif (NOT MSVC_VERSION VERSION_GREATER 1930)
  set(msvc_ver 14.2)
Ben Boeckel's avatar
Ben Boeckel committed
20
else ()
TJ Corona's avatar
TJ Corona committed
21
  message(FATAL_ERROR "Unrecognized MSVC version: ${MSVC_VERSION}")
Ben Boeckel's avatar
Ben Boeckel committed
22 23
endif ()

24
list(APPEND boost_platform_options
25
  "--toolset=msvc-${msvc_ver}")
Ben Boeckel's avatar
Ben Boeckel committed
26

27
if (superbuild_is_64bit)
28
  list(APPEND boost_platform_options
29 30
    address-model=64)
else ()
31
  list(APPEND boost_platform_options
32 33 34
    address-model=32)
endif ()

Ben Boeckel's avatar
Ben Boeckel committed
35
include(boost.common)
36 37 38 39

# This patch is applied so that a rogue junction is not left inside of the
# build tree for dashboard machines. CMake cannot delete such files, so we just
# remove the code which creates such things here.
40 41 42 43
if (NOT boost_no_junction_patch_necessary)
  superbuild_apply_patch(boost no-junction-test
    "Assume junctions work on Windows")
endif ()
44 45 46 47 48 49 50 51

superbuild_project_add_step(boost-copylibs
  COMMAND   "${CMAKE_COMMAND}"
            -Dinstall_location:PATH=<INSTALL_DIR>
            -P "${CMAKE_CURRENT_LIST_DIR}/scripts/boost.copylibs.cmake"
  DEPENDEES install
  COMMENT   "Copy .dll files to the bin/ directory"
  WORKING_DIRECTORY <SOURCE_DIR>)