Skip to content

Commit

Permalink
Permit to invoke ign command in Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Silvio <silvio@traversaro.it>
  • Loading branch information
traversaro committed Nov 29, 2021
1 parent fefc79e commit 5820949
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ configure_file(ign.in ${ign_script_configured})
file(GENERATE OUTPUT ${ign_script_generated} INPUT ${ign_script_configured})
install (PROGRAMS ${ign_script_generated} DESTINATION ${BIN_INSTALL_DIR})

if(WIN32)
# On Windows also install the executable as ign
# to permit to invoke ign via Git Bash
# see https://github.com/ignitionrobotics/ign-tools/issues/70
install (PROGRAMS ${ign_script_generated} DESTINATION ${BIN_INSTALL_DIR} RENAME ign)

# On Windows also install the ign.bat wrapper script to permit to
# invoke ign via Command Prompt or Powershell
install (PROGRAMS ign.bat DESTINATION ${BIN_INSTALL_DIR})
endif()

#===============================================================================
# BEGIN TEST ign command
# Generate the ruby script for internal testing.
Expand Down
6 changes: 6 additions & 0 deletions src/ign.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
REM %~dp0 is the directory in which this bat script is, see
REM https://stackoverflow.com/questions/112055/what-does-d0-mean-in-a-windows-batch-file
REM %* redirects the arguments to the output, see
REM https://serverfault.com/questions/22443/do-windows-batch-files-have-a-construction/22541#22541
ruby %~dp0\ign %*

0 comments on commit 5820949

Please sign in to comment.