2016-09-19 11:50:08 +08:00
|
|
|
function(vcpkg_install_cmake)
|
2017-01-14 11:09:42 +08:00
|
|
|
cmake_parse_arguments(_bc "MSVC_64_TOOLSET;DISABLE_PARALLEL" "" "" ${ARGN})
|
|
|
|
|
2017-02-09 07:24:59 +08:00
|
|
|
set(MSVC_EXTRA_ARGS
|
|
|
|
"/p:VCPkgLocalAppDataDisabled=true"
|
|
|
|
"/p:UseIntelMKL=No"
|
|
|
|
)
|
2017-01-14 11:09:42 +08:00
|
|
|
|
|
|
|
# Specifies the architecture of the toolset, NOT the architecture of the produced binary
|
2017-02-09 07:24:59 +08:00
|
|
|
# This can help libraries that cause the linker to run out of memory.
|
|
|
|
# https://support.microsoft.com/en-us/help/2891057/linker-fatal-error-lnk1102-out-of-memory
|
2017-01-14 11:09:42 +08:00
|
|
|
if (_bc_MSVC_64_TOOLSET)
|
|
|
|
list(APPEND MSVC_EXTRA_ARGS "/p:PreferredToolArchitecture=x64")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT _bc_DISABLE_PARALLEL)
|
|
|
|
list(APPEND MSVC_EXTRA_ARGS "/m")
|
|
|
|
endif()
|
2017-02-04 00:16:13 +08:00
|
|
|
|
|
|
|
if(EXISTS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/build.ninja)
|
|
|
|
set(BUILD_ARGS -v) # verbose output
|
|
|
|
else()
|
|
|
|
set(BUILD_ARGS ${MSVC_EXTRA_ARGS})
|
|
|
|
endif()
|
2017-01-14 11:09:42 +08:00
|
|
|
|
2016-09-19 11:50:08 +08:00
|
|
|
message(STATUS "Package ${TARGET_TRIPLET}-rel")
|
|
|
|
vcpkg_execute_required_process(
|
2017-02-04 00:16:13 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} --build . --config Release --target install -- ${BUILD_ARGS}
|
2016-09-19 11:50:08 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
|
|
|
LOGNAME package-${TARGET_TRIPLET}-rel
|
|
|
|
)
|
|
|
|
message(STATUS "Package ${TARGET_TRIPLET}-rel done")
|
|
|
|
|
|
|
|
message(STATUS "Package ${TARGET_TRIPLET}-dbg")
|
|
|
|
vcpkg_execute_required_process(
|
2017-02-04 00:16:13 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} --build . --config Debug --target install -- ${BUILD_ARGS}
|
2016-09-19 11:50:08 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
|
|
|
|
LOGNAME package-${TARGET_TRIPLET}-dbg
|
|
|
|
)
|
|
|
|
message(STATUS "Package ${TARGET_TRIPLET}-dbg done")
|
|
|
|
endfunction()
|