[ignition-cmake2/ignition-modularscripts/ignition-common3] Add options, support pkgconfig and fix usage for common3-graph#25021
Conversation
|
Thank you for the fix |
ras0219-msft
left a comment
There was a problem hiding this comment.
First, we should wait for #25034 to merge which adds a standardized method for consuming GTS (pkg-config).
Then,
FindGTS.cmakeshould be replaced/implemented via the pkgconfig mechanism aboveign_find_packageshould probably be patched to makePRIVATE_FORnot suppressfind_dependency- We should not need a
vcpkg-cmake-wrapperhere. Any changes needed should be written into the-config.cmakecreated by the port.
|
@ras0219-msft The official doc said: This parameter only affects foreach(component ${ign_find_package_PRIVATE_FOR})
set(${component}_${PACKAGE_NAME}_PRIVATE true)
endforeach() foreach(component ${ign_find_package_REQUIRED_BY})
if(NOT ${component}_${PACKAGE_NAME}_PRIVATE)
ign_string_append(${component}_CMAKE_DEPENDENCIES "${${PACKAGE_NAME}_find_dependency}" DELIM "\n")
endif()
endforeach() if(${component}_${PACKAGE_NAME}_PRIVATE)
# If this is a private library or module, use the _PRIVATE suffix
set(${component}_${PACKAGE_NAME}_PKGCONFIG_TYPE ${component}_${${PACKAGE_NAME}_PKGCONFIG_TYPE}_PRIVATE)
else()
# Otherwise, use the plain type
set(${component}_${PACKAGE_NAME}_PKGCONFIG_TYPE ${component}_${${PACKAGE_NAME}_PKGCONFIG_TYPE})
endif() if(${component}_${PACKAGE_NAME}_PRIVATE)
# If this is a private library or module, use the _PRIVATE suffix
set(${component}_${PACKAGE_NAME}_PKGCONFIG_TYPE ${component}_${${PACKAGE_NAME}_PKGCONFIG_TYPE}_PRIVATE)
else()
# Otherwise, use the plain type
set(${component}_${PACKAGE_NAME}_PKGCONFIG_TYPE ${component}_${${PACKAGE_NAME}_PKGCONFIG_TYPE})
endif()
# Append the entry as a string onto the component-specific variable
# for whichever required type we selected
ign_string_append(${${component}_${PACKAGE_NAME}_PKGCONFIG_TYPE} ${${PACKAGE_NAME}_PKGCONFIG_ENTRY})@component_cmake_dependencies@In fact, the configuration of cmake should be the same as that of pkgconfig. So I think "make PRIVATE_FOR not suppress find_dependency" is consistent with the modification (current modification) of directly removing |
I cannot test it now but I disagree. I expect that your current modification changes the link type from |
…jack/fix-ignition-comm3-graph-usage
|
Already tested usage on x64-linux. |
Fix usage when using
find_package(ignition-common3-graphics CONFIG REQUIRED):Related: #24969
Already tested this usage in x64-linux.