2019-06-06 09:40:35 +00:00
|
|
|
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
|
2019-01-29 14:48:30 +00:00
|
|
|
if (MSVC_VERSION EQUAL 1800)
|
2019-06-06 09:40:35 +00:00
|
|
|
# 1800 = VS 12.0 (v120 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "12")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-12.0")
|
|
|
|
elseif (MSVC_VERSION EQUAL 1900)
|
2019-06-06 09:40:35 +00:00
|
|
|
# 1900 = VS 14.0 (v140 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "14")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.0")
|
2019-06-06 09:40:35 +00:00
|
|
|
elseif (MSVC_VERSION LESS 1920)
|
|
|
|
# 1910-1919 = VS 15.0 (v141 toolset)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_VS_VER "15")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.1")
|
2019-06-06 09:40:35 +00:00
|
|
|
elseif (MSVC_VERSION LESS 1930)
|
|
|
|
# 1920-1929 = VS 16.0 (v142 toolset)
|
|
|
|
set(DEP_VS_VER "16")
|
|
|
|
set(DEP_BOOST_TOOLSET "msvc-14.2")
|
2019-01-29 14:48:30 +00:00
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Unsupported MSVC version")
|
|
|
|
endif ()
|
|
|
|
|
2019-08-01 14:03:52 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|
|
|
set(DEP_BOOST_TOOLSET "clang-win")
|
|
|
|
endif ()
|
|
|
|
|
2018-10-23 17:08:26 +00:00
|
|
|
if (${DEPS_BITS} EQUAL 32)
|
2019-01-29 14:48:30 +00:00
|
|
|
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
2019-06-06 09:40:35 +00:00
|
|
|
set(DEP_PLATFORM "Win32")
|
2018-10-23 17:08:26 +00:00
|
|
|
else ()
|
2019-06-06 09:40:35 +00:00
|
|
|
if (DEP_VS_VER LESS 16)
|
|
|
|
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
|
|
|
|
else ()
|
|
|
|
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
|
|
|
|
endif ()
|
|
|
|
set(DEP_PLATFORM "x64")
|
2018-10-23 17:08:26 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (${DEP_DEBUG})
|
|
|
|
set(DEP_BOOST_DEBUG "debug")
|
|
|
|
else ()
|
|
|
|
set(DEP_BOOST_DEBUG "")
|
|
|
|
endif ()
|
|
|
|
|
2019-10-25 11:09:25 +00:00
|
|
|
macro(add_debug_dep _dep)
|
|
|
|
if (${DEP_DEBUG})
|
|
|
|
ExternalProject_Get_Property(${_dep} BINARY_DIR)
|
|
|
|
ExternalProject_Add_Step(${_dep} build_debug
|
|
|
|
DEPENDEES build
|
|
|
|
DEPENDERS install
|
|
|
|
COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
|
|
|
|
WORKING_DIRECTORY "${BINARY_DIR}"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
endmacro()
|
|
|
|
|
2018-10-16 09:06:26 +00:00
|
|
|
if (${DEPS_BITS} EQUAL 32)
|
2018-10-12 12:19:08 +00:00
|
|
|
set(DEP_WXWIDGETS_TARGET "")
|
|
|
|
set(DEP_WXWIDGETS_LIBDIR "vc_lib")
|
|
|
|
else ()
|
|
|
|
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
|
|
|
|
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
|
|
|
|
endif ()
|
|
|
|
|
2019-06-19 12:52:55 +00:00
|
|
|
find_package(Git REQUIRED)
|