[PATCH 2/6] Reorder stuff in the hope it is more readable and understanable then.
Michael Jansen
kde at michael-jansen.biz
Mon Mar 14 19:16:46 CET 2011
---
cmake/FindRuby.cmake | 45 +++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 22 deletions(-)
diff --git a/cmake/FindRuby.cmake b/cmake/FindRuby.cmake
index 0e36e08..b2756fe 100644
--- a/cmake/FindRuby.cmake
+++ b/cmake/FindRuby.cmake
@@ -61,39 +61,42 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
# query the ruby version
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MAJOR']"
OUTPUT_VARIABLE RUBY_VERSION_MAJOR)
+ SET(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MINOR']"
OUTPUT_VARIABLE RUBY_VERSION_MINOR)
+ SET(RUBY_VERSION_MINOR ${RUBY_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['TEENY']"
OUTPUT_VARIABLE RUBY_VERSION_PATCH)
+ SET(RUBY_VERSION_PATCH ${RUBY_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
- # query the different directories
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']"
- OUTPUT_VARIABLE RUBY_ARCH_DIR)
-
+ # Informations about the system (eg x86_64-linux)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']"
OUTPUT_VARIABLE RUBY_ARCH)
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubyhdrdir']"
- OUTPUT_VARIABLE RUBY_HDR_DIR)
-
- EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
- OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_DIR)
+ # query the ruby library installation area
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']"
+ OUTPUT_VARIABLE RUBY_ARCH_DIR)
+ SET(RUBY_ARCH_DIR ${RUBY_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
OUTPUT_VARIABLE RUBY_RUBY_LIB_DIR)
+ SET(RUBY_RUBY_LIB_DIR ${RUBY_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
- # site_ruby
+ # query the ruby site installation area
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
OUTPUT_VARIABLE RUBY_SITEARCH_DIR)
+ SET(RUBY_SITEARCH_DIR ${RUBY_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
OUTPUT_VARIABLE RUBY_SITELIB_DIR)
+ SET(RUBY_SITELIB_DIR ${RUBY_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
- # vendor_ruby available ?
+ # query the ruby vendor installation area if available
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET)
+ SET(RUBY_HAS_VENDOR_RUBY ${RUBY_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
IF(RUBY_HAS_VENDOR_RUBY)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']"
@@ -102,20 +105,18 @@ IF(RUBY_EXECUTABLE AND NOT RUBY_MAJOR_VERSION)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
ENDIF(RUBY_HAS_VENDOR_RUBY)
+ # Correct here ... or into the if above?
+ SET(RUBY_VENDORARCH_DIR ${RUBY_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
+ SET(RUBY_VENDORLIB_DIR ${RUBY_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
- # save the results in the cache so we don't have to run ruby the next time again
- SET(RUBY_VERSION_MAJOR ${RUBY_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE)
- SET(RUBY_VERSION_MINOR ${RUBY_VERSION_MINOR} CACHE PATH "The Ruby minor version" FORCE)
- SET(RUBY_VERSION_PATCH ${RUBY_VERSION_PATCH} CACHE PATH "The Ruby patch version" FORCE)
- SET(RUBY_ARCH_DIR ${RUBY_ARCH_DIR} CACHE PATH "The Ruby arch dir" FORCE)
+ # ruby development stuff (headers and directory with libruby.so)
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubyhdrdir']"
+ OUTPUT_VARIABLE RUBY_HDR_DIR)
SET(RUBY_HDR_DIR ${RUBY_HDR_DIR} CACHE PATH "The Ruby header dir (1.9)" FORCE)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
+ OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_DIR)
SET(RUBY_POSSIBLE_LIB_DIR ${RUBY_POSSIBLE_LIB_DIR} CACHE PATH "The Ruby lib dir" FORCE)
- SET(RUBY_RUBY_LIB_DIR ${RUBY_RUBY_LIB_DIR} CACHE PATH "The Ruby ruby-lib dir" FORCE)
- SET(RUBY_SITEARCH_DIR ${RUBY_SITEARCH_DIR} CACHE PATH "The Ruby site arch dir" FORCE)
- SET(RUBY_SITELIB_DIR ${RUBY_SITELIB_DIR} CACHE PATH "The Ruby site lib dir" FORCE)
- SET(RUBY_HAS_VENDOR_RUBY ${RUBY_HAS_VENDOR_RUBY} CACHE BOOL "Vendor Ruby is available" FORCE)
- SET(RUBY_VENDORARCH_DIR ${RUBY_VENDORARCH_DIR} CACHE PATH "The Ruby vendor arch dir" FORCE)
- SET(RUBY_VENDORLIB_DIR ${RUBY_VENDORLIB_DIR} CACHE PATH "The Ruby vendor lib dir" FORCE)
MARK_AS_ADVANCED(
RUBY_ARCH_DIR
--
1.7.1
--nextPart3101659.7u16iE8AI0
Content-Disposition: attachment; filename="0003-More-commenting.patch"
Content-Transfer-Encoding: 7Bit
Content-Type: text/x-patch; charset="UTF-8"; name="0003-More-commenting.patch"
More information about the Kde-buildsystem
mailing list