-
Notifications
You must be signed in to change notification settings - Fork 63
COMP: Fix AUTOMOC by updating the minimum CMake version #290
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
base: master
Are you sure you want to change the base?
Conversation
|
That makes sense. You could do: Later, we could ensure all extension have the option set ... there is way to set policy through cmake option. |
|
The mystery here is why we don't have to set this anywhere in the Slicer or CTK CMake files and they work fine. Also I don't really understand what the code snippet you are suggesting is supposed to do. |
|
Ah, I see what is happening. It is the difference in the Slicer's: |
|
Yep, updating the minimum cmake required fixes it. Will push new commit that updates it to what is currently used in the extension template |
Older minimum versions enable the OLD behavior on CMP0071, which breaks AUTOMOC compilation
|
First pass at fix within Slicer: Slicer/Slicer#8845 |
|
Thanks a lot for working on this. Is the plan that we integrate the fix in Slicer and then this change will not be necessary? |
|
Yes, but updating the cmake minimum version to match Slicer is a good idea anyway I think |
|
Also, I will need to backport the Slicer fix to 5.10, fixing it here will fix both Stable and Preview immediately |
When building against current Slicer we see many of this type of warning:
CMake Warning (dev) in Beams/Widgets/CMakeLists.txt: Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files. Run "cmake --help-policy CMP0071" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For compatibility, CMake is excluding the GENERATED source file(s): "D:/srt-broken/inner-build/Beams/Widgets/generated_cpp/osm_qSlicerBeamsModuleWidgets/osm_qSlicerBeamsModuleWidgets_init.cpp" "D:/srt-broken/inner-build/Beams/Widgets/generated_cpp/osm_qSlicerBeamsModuleWidgets/osm_qSlicerBeamsModuleWidgets_module_init.cpp" "D:/srt-broken/inner-build/Beams/Widgets/generated_cpp/osm_qSlicerBeamsModuleWidgets/osm_qSlicerBeamsModuleWidgets.h" from processing by AUTOMOC. If any of the files should be processed, set CMP0071 to NEW. If any of the files should not be processed, explicitly exclude them by setting the source file property SKIP_AUTOMOC: set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON) This warning is for project developers. Use -Wno-dev to suppress it.We then later see errors of this type:
By explicitly setting CMP0071 to new for the extension, these errors seem to resolve