summaryrefslogtreecommitdiffstats
path: root/Modules/FindRuby.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-10 18:51:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-08-10 18:51:45 (GMT)
commit74805b28c1f55a16310efe43465eb76c4e75f46a (patch)
tree327505f9f2820ca55d099625f387c52d29ac0f71 /Modules/FindRuby.cmake
parent9cf9d2794c496213f84a78282d56c63763f732d6 (diff)
parent430336c5e1ae90903e3db228594b1c365c26f4a3 (diff)
downloadCMake-74805b28c1f55a16310efe43465eb76c4e75f46a.zip
CMake-74805b28c1f55a16310efe43465eb76c4e75f46a.tar.gz
CMake-74805b28c1f55a16310efe43465eb76c4e75f46a.tar.bz2
Merge topic 'ImprovedVersionCheckingInSomeModules'
430336c Merge branch 'findsubversion_fphsa_cleanup' b6c6156 Use FPHSA() in FindSWIG, including version checking. 656cd2f Improved version checking for FindCUDA using the new mode of FPHSA 126db7b Improved version checking for FindSubversion using the new mode of FPHSA() 77d909b Fix DETAILS string with version number in FHPSA() 19b68b9 Improved version checking for FindJava using the new FPHSA() mode 6bb0b6e Improved version checking for FindRuby using the new mode of FPHSA() 946493f FindSquish doesn't detect the version, remove that from the documentation cb9d1ea Add version checking support to FindFlex and FindPerlLibs
Diffstat (limited to 'Modules/FindRuby.cmake')
-rw-r--r--Modules/FindRuby.cmake26
1 files changed, 7 insertions, 19 deletions
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 2d1a125..2e78d85 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -1,7 +1,10 @@
# - Find Ruby
# This module finds if Ruby is installed and determines where the include files
-# and libraries are. Ruby 1.8 and 1.9 are supported. The minimum required version
-# specified in the find_package() command is honored.
+# and libraries are. Ruby 1.8 and 1.9 are supported.
+#
+# The minimum required version of Ruby can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
+#
# It also determines what the name of the library is. This
# code sets the following variables:
#
@@ -154,22 +157,6 @@ SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-# Now we know which version we found
-IF(Ruby_FIND_VERSION)
- IF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
- # force running ruby the next time again
- SET(RUBY_VERSION_MAJOR "" CACHE PATH "The Ruby major version" FORCE)
- IF(Ruby_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ELSE(Ruby_FIND_REQUIRED)
- IF(NOT Ruby_FIND_QUIETLY)
- MESSAGE(STATUS "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ENDIF(NOT Ruby_FIND_QUIETLY)
- RETURN()
- ENDIF(Ruby_FIND_REQUIRED)
- ENDIF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
-ENDIF(Ruby_FIND_VERSION)
-
FIND_PATH(RUBY_INCLUDE_DIR
NAMES ruby.h
HINTS
@@ -240,7 +227,8 @@ IF(_RUBY_DEBUG_OUTPUT)
MESSAGE(STATUS "--------------------")
ENDIF(_RUBY_DEBUG_OUTPUT)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby DEFAULT_MSG ${_RUBY_REQUIRED_VARS})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS}
+ VERSION_VAR RUBY_VERSION )
MARK_AS_ADVANCED(
RUBY_EXECUTABLE