-
Notifications
You must be signed in to change notification settings - Fork 993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMakeToolchain: implement vs debugger path #15830
CMakeToolchain: implement vs debugger path #15830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great
if os.path.exists(CONAN_TOOLCHAIN_FILENAME): | ||
existing_include = load(CONAN_TOOLCHAIN_FILENAME) | ||
vs_debugger_environment = re.search(r"set\(CMAKE_VS_DEBUGGER_ENVIRONMENT \"PATH=([^)]*)>;%PATH%\"\)", | ||
existing_include) | ||
if vs_debugger_environment: | ||
capture = vs_debugger_environment.group(1) | ||
matches = re.findall(r"\$<\$<CONFIG:([A-Za-z]*)>:(.*)", capture) | ||
config_dict = dict(matches) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the part we might want to refactor, but that might be done later in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the string generation from the jinja, and into python, although still very tricky to get right with the regexes. Fixed some issues when we have more than 2 configs, so it should be more robust.
IN a later PR I have some ideas for how to support multiconfig in a more straightforward way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, but tests are not passing, please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😁 I'm only missing a test checking when the VS variable is not appearing.
Changelog: Feature: Set
CMAKE_VS_DEBUGGER_ENVIRONMENT
from CMakeToolchain to point to all binary directories when using Visual Studio. This negates the need to copy DLLs to launch executables from the Visual Studio IDE (requires CMake 3.27 or newer).Docs: conan-io/docs#3639