-
Notifications
You must be signed in to change notification settings - Fork 194
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
Link against frameTransformRC via target_link_libraries
#2637
Conversation
The frameTransformRC target is a `STATIC` library, hence it is not possible to use `$<TARGET_OBJECTS:xxx>` (although it seems to work for some reason in recent CMake releases, it does not in 3.12). Also, remove redundant `NAMESPACE` option which defaults to the first parameter to `cmrc_add_resource_library`.
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update the release notes by adding a file in |
Static builds are failing with:
I wonder if this was the reason behind using |
Another approach I considered before applying the target_sources(yarp_frameTransformClient PRIVATE $<TARGET_PROPERTY:frameTransformRC,SOURCES>)
# as stated earlier, it should be safe to remove the `target_include_directories` line that follows The |
Thanks @PeterBowman. |
Kudos, SonarCloud Quality Gate passed! |
I can confirm YARP master builds fine now with CMake 3.12: CI workflow run. Apparently this issue didn't show up on your own CMake 3.12-specific builds since Eigen is not installed, hence no YARP_math library, which is in turn a dependency for the frame transform devices. |
On latest YARP master (unreleased 3.5), a CMake 3.12 configure run throws the following error (logs):
The offending line is:
yarp/src/devices/frameTransformClient/CMakeLists.txt
Line 44 in d0058d1
According to CMake docs,
$<TARGET_OBJECTS:...>
requires anOBJECT
target. However, the target created bycmrc_add_resource_library
a few lines earlier is aSTATIC
library (ref). For some reason, this generator expression does acceptSTATIC
targets in recent CMake releases (tested at CMake 3.16.3), but it fails as expected for the minimum required CMake 3.12 version (tested at CMake 3.12.4).I believe this instruction was somewhat inspired by the way "FrameTransformUtils" was referenced at line 36, which is in fact an
OBJECT
library. I think the simplest way to handle "frameTransformRC" is viatarget_link_libraries
. That being said, this target does not register any interface include directory (regarding the now-deleted and supersededtarget_include_directories
command).Follows up #2624 (cc @elandini84). I'm also removing the
NAMESPACE
option tocmrc_add_resource_library
since it defaults to the target name anyway ("frameTransformRC", ref, docs).