summaryrefslogtreecommitdiffstats
path: root/Modules/FindCVS.cmake
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2008-03-10 22:48:41 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2008-03-10 22:48:41 (GMT)
commita76069351845128ed695598544c3430255a104fb (patch)
tree312a1bbbdc3288e0115d41357af604e697ac72b1 /Modules/FindCVS.cmake
parent7f2bf831322dd7f78f93d3db4a597ac94b053dc3 (diff)
downloadCMake-a76069351845128ed695598544c3430255a104fb.zip
CMake-a76069351845128ed695598544c3430255a104fb.tar.gz
CMake-a76069351845128ed695598544c3430255a104fb.tar.bz2
ENH: for some reasons there was never a FindCVS module?
Diffstat (limited to 'Modules/FindCVS.cmake')
-rw-r--r--Modules/FindCVS.cmake56
1 files changed, 56 insertions, 0 deletions
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
new file mode 100644
index 0000000..8afa519
--- /dev/null
+++ b/Modules/FindCVS.cmake
@@ -0,0 +1,56 @@
+# The module defines the following variables:
+# CVS_EXECUTABLE - path to cvs command line client
+# CVS_FOUND - true if the command line client was found
+# Example usage:
+# find_package(CVS)
+# if(CVS_FOUND)
+# message("CVS found: ${CVS_EXECUTABLE}")
+# endif(CVS_FOUND)
+
+# CVSNT
+
+get_filename_component(
+ CVSNT_TypeLib_Win32
+ "[HKEY_CLASSES_ROOT\\TypeLib\\{2BDF7A65-0BFE-4B1A-9205-9AB900C7D0DA}\\1.0\\0\\win32]"
+ PATH)
+
+get_filename_component(
+ CVSNT_Services_EventMessagePath
+ "[HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Services\\Eventlog\\Application\\cvsnt;EventMessageFile]"
+ PATH)
+
+# WinCVS (in case CVSNT was installed in the same directory)
+
+get_filename_component(
+ WinCVS_Folder_Command
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Folder\\shell\\wincvs\\command]"
+ PATH)
+
+# TortoiseCVS (in case CVSNT was installed in the same directory)
+
+get_filename_component(
+ TortoiseCVS_Folder_Command
+ "[HKEY_CLASSES_ROOT\\CVS\\shell\\open\\command]"
+ PATH)
+
+get_filename_component(
+ TortoiseCVS_DefaultIcon
+ "[HKEY_CLASSES_ROOT\\CVS\\DefaultIcon]"
+ PATH)
+
+find_program(CVS_EXECUTABLE cvs
+ ${TortoiseCVS_DefaultIcon}
+ ${TortoiseCVS_Folder_Command}
+ ${WinCVS_Folder_Command}
+ ${CVSNT_Services_EventMessagePath}
+ ${CVSNT_TypeLib_Win32}
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\CVS\\Pserver;InstallPath2]"
+ DOC "CVS command line client"
+ )
+mark_as_advanced(CVS_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set CVS_FOUND to TRUE if
+# all listed variables are TRUE
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CVS DEFAULT_MSG CVS_EXECUTABLE)