Skip to content
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

Be louder when graphics is missing for geospatial #573

Merged
merged 4 commits into from
Jan 29, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions geospatial/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
gz_get_libsources_and_unittests(sources gtest_sources)
if (TARGET ${PROJECT_LIBRARY_TARGET_NAME}-graphics)
gz_get_libsources_and_unittests(sources gtest_sources)
gz_add_component(geospatial
SOURCES ${sources}
DEPENDS_ON_COMPONENTS graphics
GET_TARGET_NAME geospatial_target)

gz_add_component(geospatial
SOURCES ${sources}
DEPENDS_ON_COMPONENTS graphics
GET_TARGET_NAME geospatial_target)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the DEPENDS_ON_COMPONENTS parameter would generate a complaint if the needed component wasn't available, but apparently it doesn't

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was also my understanding, but does not seem to be the case.

target_link_libraries(${geospatial_target}
PUBLIC
${PROJECT_LIBRARY_TARGET_NAME}-graphics
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
PRIVATE
${GDAL_LIBRARY})

target_link_libraries(${geospatial_target}
PUBLIC
${PROJECT_LIBRARY_TARGET_NAME}-graphics
gz-math${GZ_MATH_VER}::gz-math${GZ_MATH_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
PRIVATE
${GDAL_LIBRARY})
target_include_directories(${geospatial_target}
PRIVATE
${GDAL_INCLUDE_DIR})

target_include_directories(${geospatial_target}
PRIVATE
${GDAL_INCLUDE_DIR})

gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
LIB_DEPS
${geospatial_target}
gz-common${GZ_COMMON_VER}-testing
)
gz_build_tests(TYPE UNIT SOURCES ${gtest_sources}
LIB_DEPS
${geospatial_target}
gz-common${GZ_COMMON_VER}-testing
)
else()
message(WARNING "Skipping component [geospatial]: Missing component [graphics].\n ^~~~~ Set SKIP_geospatial=true in cmake to suppress this warning.")
endif()
Loading