-
Notifications
You must be signed in to change notification settings - Fork 1
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
Layout set_property("cmake_build_modules") #1
base: main
Are you sure you want to change the base?
Conversation
@@ -33,13 +33,7 @@ install( | |||
DESTINATION visualizers | |||
) | |||
|
|||
file( |
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.
One of the issues is that the same file with the fixed path cannot work for 2 different layouts, the "build/editable" layout, and the "package" layout.
I moved this to the "source" tree, so I could keep the same relative position of the add_visualizers.cmake
file and the lib.natvis
file. Another strategy would be to have different files: one file written at "build" time, but then, do not copy that file as-is to the package folder at install()
time but instead generate a new one with an updated relative position.
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 doesn't quite solve my problem, because now I have to define the add_visualizers.cmake
script manually. Instead I would like to automate the process. That was what the CMake script file
invocation represents. In reality the scripts to generate it are somewhat more involved. I can generate the file using Conan too if that's more appropriate, but it seemed to me that I probably shouldn't generate files in package_info
.
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.
I guessed that the process could be more complicated, this is why I suggested the above. The main issue is that the relative path between the add_visualizers.cmake
and the nat.vis
file should be correct in both places, and this cannot happen if you use exactly the same file copied at install()
time. So the automated solution, if you want to support both the create
and the editable
different layouts, would be to make sure that 2 different files are generated:
- One
add_visualizers.cmake
that you create atbuild()
time, with the relative path in the "build" or editable layout - Another
add_visualizers.cmake
that you create atpackage()
time, with the relative path of the "package" layout - It is not necessary to create the files in
package_info()
only inbuild()
andpackage()
- If it is easier, the
add_visualizers.cmake
could be "patched" atpackage()
time, doing a copy to the package folder, then patching the relative paths (it could be already an easy to patch variable that is reused in the script)
Please let me know if this helps.
@@ -0,0 +1,2 @@ | |||
message(STATUS "Adding target_sources() in add_visualizers.cmake") |
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.
I moved this here, so the relative position of add_visualizers.cmake
and nat.vis
was the same.
No description provided.