Pass native install dir to nmake (#22095)

This commit is contained in:
Kai Pastor 2021-12-20 17:34:01 +01:00 committed by GitHub
parent 6dbe00f6c4
commit 4b1c874451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,6 +128,7 @@ function(vcpkg_build_nmake)
endif() endif()
vcpkg_backup_env_variables(VARS CL) vcpkg_backup_env_variables(VARS CL)
cmake_path(NATIVE_PATH CURRENT_PACKAGES_DIR NORMALIZE install_dir_native)
foreach(build_type IN ITEMS debug release) foreach(build_type IN ITEMS debug release)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL build_type) if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL build_type)
if(build_type STREQUAL "debug") if(build_type STREQUAL "debug")
@ -136,7 +137,7 @@ function(vcpkg_build_nmake)
# Add install command and arguments # Add install command and arguments
set(make_opts "${make_opts_base}") set(make_opts "${make_opts_base}")
if (arg_ENABLE_INSTALL) if (arg_ENABLE_INSTALL)
vcpkg_list(APPEND make_opts "INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug") vcpkg_list(APPEND make_opts "INSTALLDIR=${install_dir_native}\\debug")
endif() endif()
vcpkg_list(APPEND make_opts ${arg_OPTIONS} ${arg_OPTIONS_DEBUG}) vcpkg_list(APPEND make_opts ${arg_OPTIONS} ${arg_OPTIONS_DEBUG})
set(ENV{CL} "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}") set(ENV{CL} "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
@ -147,7 +148,7 @@ function(vcpkg_build_nmake)
# Add install command and arguments # Add install command and arguments
set(make_opts "${make_opts_base}") set(make_opts "${make_opts_base}")
if (arg_ENABLE_INSTALL) if (arg_ENABLE_INSTALL)
vcpkg_list(APPEND make_opts "INSTALLDIR=${CURRENT_PACKAGES_DIR}") vcpkg_list(APPEND make_opts "INSTALLDIR=${install_dir_native}")
endif() endif()
vcpkg_list(APPEND make_opts ${arg_OPTIONS} ${arg_OPTIONS_RELEASE}) vcpkg_list(APPEND make_opts ${arg_OPTIONS} ${arg_OPTIONS_RELEASE})