Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 6a9d39c

Browse files
authored
Set gz tool name via GZ_CLI_EXECUTABLE_NAME (#3368)
Signed-off-by: Steve Peters <[email protected]>
1 parent 643fdc9 commit 6a9d39c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tools/CMakeLists.txt

+11-7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ if (HAVE_DART)
2424
link_directories(${DART_LIBRARY_DIRS})
2525
endif()
2626

27+
if ("${GZ_CLI_EXECUTABLE_NAME}" STREQUAL "")
28+
set(GZ_CLI_EXECUTABLE_NAME "gz")
29+
endif()
30+
2731
if(NOT WIN32)
2832
# gz_TEST and gz_log_TEST use fork(), that is not available on Windows
2933
set (test_sources
@@ -32,19 +36,19 @@ if(NOT WIN32)
3236
)
3337

3438
gz_build_tests(${test_sources} EXTRA_LIBS libgazebo_client gazebo_transport gazebo_util)
35-
add_dependencies(${TEST_TYPE}_gz_log_TEST gz)
39+
add_dependencies(${TEST_TYPE}_gz_log_TEST ${GZ_CLI_EXECUTABLE_NAME})
3640
endif()
3741

38-
add_executable(gz gz.cc gz_topic.cc gz_log.cc gz_marker.cc)
42+
add_executable(${GZ_CLI_EXECUTABLE_NAME} gz.cc gz_topic.cc gz_log.cc gz_marker.cc)
3943

4044
if (WIN32)
4145
# Force multiple definitions since there is a collision with sdformat GetAsEuler() function
4246
# https://github.com/osrf/sdformat/blob/master/include/sdf/Types.hh
4347
# it is defined inside an .hh file and bring to gz linking via sdformat and gazebo_gui/gazebo_common
44-
set_target_properties(gz PROPERTIES LINK_FLAGS "/FORCE:MULTIPLE")
48+
set_target_properties(${GZ_CLI_EXECUTABLE_NAME} PROPERTIES LINK_FLAGS "/FORCE:MULTIPLE")
4549
endif()
4650

47-
target_link_libraries(gz
51+
target_link_libraries(${GZ_CLI_EXECUTABLE_NAME}
4852
libgazebo_client
4953
gazebo_gui
5054
gazebo_physics
@@ -57,13 +61,13 @@ target_link_libraries(gz
5761
)
5862

5963
if (UNIX)
60-
target_link_libraries(gz pthread)
64+
target_link_libraries(${GZ_CLI_EXECUTABLE_NAME} pthread)
6165
endif()
6266

63-
gz_install_executable(gz)
67+
gz_install_executable(${GZ_CLI_EXECUTABLE_NAME})
6468

6569
if (NOT WIN32)
66-
roffman(gz 1)
70+
roffman(${GZ_CLI_EXECUTABLE_NAME} 1)
6771
endif()
6872

6973
install (PROGRAMS gzprop DESTINATION ${BIN_INSTALL_DIR})

0 commit comments

Comments
 (0)