diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42f152f..9f64f01 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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. diff --git a/src/ign.bat b/src/ign.bat new file mode 100644 index 0000000..49d78a1 --- /dev/null +++ b/src/ign.bat @@ -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 %*