Merge topic 'vs-CMAKE_MSVCIDE_RUN_PATH'

542bd343e3 VS: Always enable CMAKE_MSVCIDE_RUN_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6334
This commit is contained in:
Brad King
2021-07-13 12:20:29 +00:00
committed by Kitware Robot
7 changed files with 17 additions and 1 deletions

View File

@@ -171,7 +171,7 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
// for visual studio IDE add extra stuff to the PATH
// if CMAKE_MSVCIDE_RUN_PATH is set.
if (this->Makefile->GetDefinition("MSVC_IDE")) {
if (this->GetGlobalGenerator()->IsVisualStudio()) {
cmProp extraPath = this->Makefile->GetDefinition("CMAKE_MSVCIDE_RUN_PATH");
if (extraPath) {
script += newline;

View File

@@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.21)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@@ -0,0 +1 @@
This message is printed by echo_message.bat

View File

@@ -0,0 +1,2 @@
set(CMAKE_MSVCIDE_RUN_PATH "${CMAKE_SOURCE_DIR}")
add_custom_target(main COMMAND echo_message)

View File

@@ -0,0 +1,8 @@
include(RunCMake)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CheckEnvironmentVar-build)
run_cmake(CheckEnvironmentVar)
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(CheckEnvironmentVar-build ${CMAKE_COMMAND} --build . --config Debug --target main)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)

View File

@@ -0,0 +1 @@
echo This message is printed by echo_message.bat

View File

@@ -555,6 +555,7 @@ if(CMake_TEST_FindGTK2)
endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_RunCMake_test(CMAKE_MSVCIDE_RUN_PATH)
add_RunCMake_test(include_external_msproject -DVS_PLATFORM_NAME=${CMAKE_VS_PLATFORM_NAME})
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio (9|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
set(NO_USE_FOLDERS 1)