Skip to content

Detect gz program instead of using CMake module to check for gz-tools #1557

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

Merged
merged 5 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,13 @@ gz_find_package(ignition-math7 REQUIRED COMPONENTS eigen3)
set(IGN_MATH_VER ${ignition-math7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-tools
gz_find_package(ignition-tools2
REQUIRED
PKGCONFIG "ignition-tools2")
# Find if gz command is available
find_program(GZ_TOOLS_PROGRAM gz)
if (GZ_TOOLS_PROGRAM)
message (STATUS "Searching for gz program - found. CLI tests can be built.")
else()
message (STATUS "Searching for gz program - not found. CLI tests are skipped.")
endif()

#--------------------------------------
# Find ignition-utils
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ set(tests_needing_display
ModelCommandAPI_TEST.cc
)

# Disable tests that need CLI if gz-tools is not found
if (MSVC OR NOT GZ_TOOLS_PROGRAM)
list(REMOVE_ITEM gtest_sources gz_TEST.cc ModelCommandAPI_TEST.cc)
endif()

# Add systems that need a valid display here.
# \todo(anyone) Find a way to run these tests with a virtual display such Xvfb
# or Xdummy instead of skipping them
Expand Down
5 changes: 5 additions & 0 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ set(tests_needing_display
wide_angle_camera.cc
)

# Disable tests that need CLI if gz-tools is not found
if (MSVC OR NOT GZ_TOOLS_PROGRAM)
list(REMOVE_ITEM tests log_system.cc)
endif()

# Add systems that need a valid display here.
# \todo(anyone) Find a way to run these tests with a virtual display such Xvfb
# or Xdummy instead of skipping them
Expand Down