Skip to content

Commit

Permalink
Be louder when graphics is missing for geospatial (#573)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll authored Jan 29, 2024
1 parent bc24ece commit 3b81541
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ configure_file("${PROJECT_SOURCE_DIR}/cppcheck.suppress.in"
${PROJECT_BINARY_DIR}/cppcheck.suppress)

gz_configure_build(QUIT_IF_BUILD_ERRORS
COMPONENTS av events geospatial graphics io profiler testing)
COMPONENTS av events graphics geospatial io profiler testing)

#============================================================================
# Create package information
Expand Down
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)
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()

0 comments on commit 3b81541

Please sign in to comment.