From 3714d9419c3f90a753bb7e96c9260b674f486916 Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Fri, 2 Nov 2001 16:44:00 -0500 Subject: [PATCH] Move usual Unix commands to FindUnixCommands, use FingCygwin in other modules --- ...mentationVTK.cmake => Documentation.cmake} | 3 +- Modules/FindCygwin.cmake | 26 +----- Modules/FindPerl.cmake | 25 ++++-- Modules/FindUnixCommands.cmake | 82 +++++++++++++++++++ Modules/FindWget.cmake | 19 ++++- 5 files changed, 120 insertions(+), 35 deletions(-) rename Modules/{DocumentationVTK.cmake => Documentation.cmake} (91%) create mode 100644 Modules/FindUnixCommands.cmake diff --git a/Modules/DocumentationVTK.cmake b/Modules/Documentation.cmake similarity index 91% rename from Modules/DocumentationVTK.cmake rename to Modules/Documentation.cmake index 3e7b8fa26..c86e70427 100644 --- a/Modules/DocumentationVTK.cmake +++ b/Modules/Documentation.cmake @@ -13,7 +13,7 @@ IF (BUILD_DOCUMENTATION) # # Check for the tools # - INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake) + INCLUDE(${CMAKE_ROOT}/Modules/FindUnixCommands.cmake) INCLUDE(${CMAKE_ROOT}/Modules/FindDoxygen.cmake) INCLUDE(${CMAKE_ROOT}/Modules/FindHhc.cmake) INCLUDE(${CMAKE_ROOT}/Modules/FindPerl.cmake) @@ -29,6 +29,5 @@ IF (BUILD_DOCUMENTATION) # The documentation process is controled by a batch file. # We will probably need bash to create the custom target # - FIND_PROGRAM(BASH bash) ENDIF (BUILD_DOCUMENTATION) diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake index c93c7f216..7c4f8b19f 100644 --- a/Modules/FindCygwin.cmake +++ b/Modules/FindCygwin.cmake @@ -1,5 +1,5 @@ # -# this module looks for Cygwin and some usual commands +# this module looks for Cygwin # FIND_PATH(CYGWIN_INSTALL_PATH @@ -7,27 +7,3 @@ FIND_PATH(CYGWIN_INSTALL_PATH "C:/Cygwin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]" ) - -FIND_PROGRAM(GZIP - gzip - ${CYGWIN_INSTALL_PATH}/bin -) - -FIND_PROGRAM(MV - mv - ${CYGWIN_INSTALL_PATH}/bin -) - -FIND_PROGRAM(RM - rm - ${CYGWIN_INSTALL_PATH}/bin -) - -FIND_PROGRAM(TAR - NAMES - tar - gtar - PATH - ${CYGWIN_INSTALL_PATH}/bin -) - diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index 916fcf943..79a88a1bd 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -2,8 +2,23 @@ # this module looks for Perl # -FIND_PROGRAM(PERL - perl - "C:/Perl/bin" - [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\628]/bin -) +INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake) + +IF (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(PERL + perl + "C:/Perl/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\628]/bin + ${CYGWIN_INSTALL_PATH}/bin + ) + +ELSE (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(PERL + perl + "C:/Perl/bin" + [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActivePerl\\628]/bin + ) + +ENDIF (CYGWIN_INSTALL_PATH) diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake new file mode 100644 index 000000000..4269983d5 --- /dev/null +++ b/Modules/FindUnixCommands.cmake @@ -0,0 +1,82 @@ +# +# this module looks for some usual Unix commands +# + +INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake) + +IF (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(BASH + bash + ${CYGWIN_INSTALL_PATH}/bin + ) + + FIND_PROGRAM(GZIP + gzip + ${CYGWIN_INSTALL_PATH}/bin + ) + + FIND_PROGRAM(MV + mv + ${CYGWIN_INSTALL_PATH}/bin + ) + + FIND_PROGRAM(RM + rm + ${CYGWIN_INSTALL_PATH}/bin + ) + + FIND_PROGRAM(TAR + NAMES + tar + gtar + PATH + ${CYGWIN_INSTALL_PATH}/bin + ) + +ELSE (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(BASH + bash + /bin + /usr/bin + /usr/local/bin + /sbin + ) + + FIND_PROGRAM(GZIP + gzip + /bin + /usr/bin + /usr/local/bin + /sbin + ) + + FIND_PROGRAM(MV + mv + /bin + /usr/bin + /usr/local/bin + /sbin + ) + + FIND_PROGRAM(RM + rm + /bin + /usr/bin + /usr/local/bin + /sbin + ) + + FIND_PROGRAM(TAR + NAMES + tar + gtar + PATH + /bin + /usr/bin + /usr/local/bin + /sbin + ) + +ENDIF (CYGWIN_INSTALL_PATH) diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake index bd14eebd4..5a2110c41 100644 --- a/Modules/FindWget.cmake +++ b/Modules/FindWget.cmake @@ -2,6 +2,19 @@ # this module looks for wget # -FIND_PROGRAM(WGET - wget -) +INCLUDE(${CMAKE_ROOT}/Modules/FindCygwin.cmake) + +IF (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(WGET + wget + ${CYGWIN_INSTALL_PATH}/bin + ) + +ELSE (CYGWIN_INSTALL_PATH) + + FIND_PROGRAM(WGET + wget + ) + +ENDIF (CYGWIN_INSTALL_PATH)