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

CLI model info dump #893

Merged
merged 9 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 21 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ set(gui_sources
PARENT_SCOPE
)

ign_add_component(ign SOURCES ign.cc GET_TARGET_NAME ign_lib_target)
ign_add_component(ign
SOURCES
ign.cc
cmd/ModelCommandAPI.cc
GET_TARGET_NAME ign_lib_target)
target_link_libraries(${ign_lib_target}
PRIVATE
${PROJECT_LIBRARY_TARGET_NAME}
Expand Down Expand Up @@ -59,6 +63,7 @@ set (sources
Util.cc
View.cc
World.cc
cmd/ModelCommandAPI.cc
${PROTO_PRIVATE_SRC}
${network_sources}
)
Expand All @@ -74,6 +79,7 @@ set (gtest_sources
ign_TEST.cc
Link_TEST.cc
Model_TEST.cc
ModelCommandAPI_TEST.cc
SdfEntityCreator_TEST.cc
SdfGenerator_TEST.cc
Server_TEST.cc
Expand Down Expand Up @@ -134,7 +140,14 @@ ign_build_tests(TYPE UNIT
ignition-gazebo${PROJECT_VERSION_MAJOR}
)

if(TARGET UNIT_ign_TEST)
# Command line tests need extra settings
foreach(CMD_TEST
UNIT_ign_TEST
UNIT_ModelCommandAPI_TEST)

if(NOT TARGET ${CMD_TEST})
continue()
endif()

# Running `ign gazebo` on macOS has problems when run with /usr/bin/ruby
# due to System Integrity Protection (SIP). Try to find ruby from
Expand All @@ -143,26 +156,27 @@ if(TARGET UNIT_ign_TEST)
find_program(BREW_RUBY ruby HINTS /usr/local/opt/ruby/bin)
endif()

add_dependencies(UNIT_ign_TEST
add_dependencies(${CMD_TEST}
${ign_lib_target}
TestModelSystem
TestSensorSystem
TestWorldSystem
)

target_compile_definitions(UNIT_ign_TEST PRIVATE
target_compile_definitions(${CMD_TEST} PRIVATE
"BREW_RUBY=\"${BREW_RUBY} \"")

target_compile_definitions(UNIT_ign_TEST PRIVATE
target_compile_definitions(${CMD_TEST} PRIVATE
"IGN_PATH=\"${IGNITION-TOOLS_BINARY_DIRS}\"")

set(_env_vars)
list(APPEND _env_vars "IGN_CONFIG_PATH=${CMAKE_BINARY_DIR}/test/conf")
list(APPEND _env_vars "IGN_GAZEBO_SYSTEM_PLUGIN_PATH=$<TARGET_FILE_DIR:TestModelSystem>")

set_tests_properties(UNIT_ign_TEST PROPERTIES
set_tests_properties(${CMD_TEST} PROPERTIES
ENVIRONMENT "${_env_vars}")
endif()

endforeach()

if(NOT WIN32)
add_subdirectory(cmd)
Expand Down
Loading