deps-windows.cmake 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. else ()
  19. message(FATAL_ERROR "Unsupported MSVC version")
  20. endif ()
  21. if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
  22. set(DEP_BOOST_TOOLSET "clang-win")
  23. endif ()
  24. if (${DEPS_BITS} EQUAL 32)
  25. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
  26. # set(DEP_PLATFORM "Win32")
  27. else ()
  28. if (DEP_VS_VER LESS 16)
  29. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
  30. else ()
  31. set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
  32. set(DEP_PLATFORM "x64")
  33. endif ()
  34. # set(DEP_PLATFORM "x64")
  35. endif ()
  36. if (${DEP_DEBUG})
  37. set(DEP_BOOST_DEBUG "debug")
  38. else ()
  39. set(DEP_BOOST_DEBUG "")
  40. endif ()
  41. macro(add_debug_dep _dep)
  42. if (${DEP_DEBUG})
  43. ExternalProject_Get_Property(${_dep} BINARY_DIR)
  44. ExternalProject_Add_Step(${_dep} build_debug
  45. DEPENDEES build
  46. DEPENDERS install
  47. COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
  48. WORKING_DIRECTORY "${BINARY_DIR}"
  49. )
  50. endif ()
  51. endmacro()
  52. if (${DEPS_BITS} EQUAL 32)
  53. set(DEP_WXWIDGETS_TARGET "")
  54. set(DEP_WXWIDGETS_LIBDIR "vc_lib")
  55. else ()
  56. set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
  57. set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
  58. endif ()
  59. find_package(Git REQUIRED)