-
-
Notifications
You must be signed in to change notification settings - Fork 715
Use normal cmake variables for output directories #5691
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
Use normal cmake variables for output directories #5691
Conversation
dzenanz
left a comment
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, but Hans and/or Matt should ideally review.
a144b3a to
a447bbe
Compare
a447bbe to
a0f17a3
Compare
|
@thewtex I removed the code consolidation and only have the variable type change. Please let me know if this PR is now more amendable. |
|
@thewtex The current behavior in main when doing a clean build with wrapping ITK_WRAP_PYTHON enable. The ITK unit test executable are being placed Regarding: What files need to be checked? libraries and unit test executables? |
Yes, the libraries and executables. @hjmjohnson should also review |
|
@thewtex What about current behavior ( before my change) of the ITK Unit tests being placed in |
|
@blowekamp if it is possible to pull unrelated unit tests without more complexity or breaking things, yes, that would be nice. |
a0f17a3 to
c960531
Compare
That is not controllable by these changes as both libraries and executables are controlled but CMAKE_RUNTIME_OUTPUT_DIRECTORY. I made more aggressive changes to remove the NO_WRAP cache variables as well. These are not needed with the described desired behavior and simplified logic. It can be summarized as: If wrapping is enabled always set the cmake output variables. Other wise if the cmake output variable is not set ( by user provided cache variable ) then set the default. I went through numerous configurations and reconfigurations comparing the location where libraries and executables. Including the sequence described. The build outputs were consistent. There were some inconsistencies in some temporary CMake files, addressed here: #5700 Additionally, GDCM archive output path is always the runtime directory, so GDCM static libraries are always in a different place. This is related to old code for executable_output_path and library_output_path. But that is another issue. |
|
/azp run ITK.Linux |
1 similar comment
|
/azp run ITK.Linux |
|
@thewtex @hjmjohnson This PR should be ready to go. Please note, that switching to ITK before this PR and then after will have the old OUTPUT_DIRECTORY CMake variables in the cache. After building before this change with wrapping, then building after this change the OUTPUT_DIRECTORY CMake variable may need to be removed from the cache, or a clean configuration done when switching back to building without wrapping. Here is the PR I have for SimpleITK to make use of these changed with using ITK with FetchContent. Having the ITK and the SimpleITK targets tightly integrated is a very nice feature when making changes in ITK source code and only rebuilding the ITK needed by the requested SimpleITK targets. |
dzenanz
left a comment
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.
Looks good on a glance. Deferring to Hans and Matt.
CMake/ITKModuleExternal.cmake
Outdated
| # When Wrapping is enabled the CMAKE_*_OUTPUT_DIRECTORY(s) will be explicitly set | ||
| include(WrappingConfigCommon) | ||
|
|
||
| # Only set default is not prior configured by wrapping or the user |
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.
is -> if?
Normal CMake variable take priority over cache variables. The implemented logic is if ITK_WRAP is enabled then always set the output directories to known paths. Otherwise, if not user provided cache variable exists set the normal cmake variable to the default. This ignores user settings when wrapping is enabled, but restores then with wrapping is disabled. Remove cache variable setting of the following: - CMAKE_RUNTIME_OUTPUT_DIRECTORY - CMAKE_LIBRARY_OUTPUT_DIRECTORY - CMAKE_ARCHIVE_OUTPUT_DIRECTORY - NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY - NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY Not force setting cmake output directories enables better usage with ITK as a FetchContent library.
CMake document this as "Old executable location variable". And the RUNTIME_OUTPUT_DIRECTORY target property supersedes this variable. Additionally the CXX_TEST_PATH variable was not used.
c960531 to
ffaa0c9
Compare
|
@thewtex @hjmjohnson This PR is ready to be reviewed and merged. Thank you for your time. |
thewtex
left a comment
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 but @hjmjohnson should review
PR Checklist
Refer to the ITK Software Guide for
further development details if necessary.