deps-windows.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
  2. if (MSVC_VERSION EQUAL 1800)
  3. # 1800 = VS 12.0 (v120 toolset)
  4. set(DEP_VS_VER "12")
  5. set(DEP_BOOST_TOOLSET "msvc-12.0")
  6. elseif (MSVC_VERSION EQUAL 1900)
  7. # 1900 = VS 14.0 (v140 toolset)
  8. set(DEP_VS_VER "14")
  9. set(DEP_BOOST_TOOLSET "msvc-14.0")
  10. elseif (MSVC_VERSION LESS 1920)
  11. # 1910-1919 = VS 15.0 (v141 toolset)
  12. set(DEP_VS_VER "15")
  13. set(DEP_BOOST_TOOLSET "msvc-14.1")
  14. elseif (MSVC_VERSION LESS 1930)
  15. # 1920-1929 = VS 16.0 (v142 toolset)
  16. set(DEP_VS_VER "16")
  17. set(DEP_BOOST_TOOLSET "msvc-14.2")
  18. elseif (MSVC_VERSION LESS 1940)
  19. # 1930-1939 = VS 17.0 (v143 toolset)
  20. set(DEP_VS_VER "17")
  21. set(DEP_BOOST_TOOLSET "msvc-14.3")
  22. else ()
  23. message(FATAL_ERROR "Unsupported MSVC version")
  24. endif ()
  25. if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
  26. set(DEP_BOOST_TOOLSET "clang-win")
  27. endif ()
  28. if (${DEPS_BITS} EQUAL 32)
  29. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
  30. set(DEP_PLATFORM "Win32")
  31. else ()
  32. if (DEP_VS_VER LESS 16)
  33. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
  34. else ()
  35. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
  36. endif ()
  37. set(DEP_PLATFORM "x64")
  38. endif ()
  39. if (${DEP_DEBUG})
  40. set(DEP_BOOST_DEBUG "debug")
  41. else ()
  42. set(DEP_BOOST_DEBUG "")
  43. endif ()
  44. macro(add_debug_dep _dep)
  45. if (${DEP_DEBUG})
  46. ExternalProject_Get_Property(${_dep} BINARY_DIR)
  47. ExternalProject_Add_Step(${_dep} build_debug
  48. DEPENDEES build
  49. DEPENDERS install
  50. COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
  51. WORKING_DIRECTORY "${BINARY_DIR}"
  52. )
  53. endif ()
  54. endmacro()
  55. if (${DEPS_BITS} EQUAL 32)
  56. set(DEP_WXWIDGETS_TARGET "")
  57. set(DEP_WXWIDGETS_LIBDIR "vc_lib")
  58. else ()
  59. set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
  60. set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
  61. endif ()
  62. find_package(Git REQUIRED)