Revision: 7716 http://playerstage.svn.sourceforge.net/playerstage/?rev=7716&view=rev Author: robotos Date: 2009-05-26 08:01:44 +0000 (Tue, 26 May 2009)
Log Message: ----------- change my previous copy/paste from Python bindings to proper ruby checks Modified Paths: -------------- code/player/trunk/client_libs/libplayerc/bindings/ruby/CMakeLists.txt Modified: code/player/trunk/client_libs/libplayerc/bindings/ruby/CMakeLists.txt =================================================================== --- code/player/trunk/client_libs/libplayerc/bindings/ruby/CMakeLists.txt 2009-05-24 09:18:02 UTC (rev 7715) +++ code/player/trunk/client_libs/libplayerc/bindings/ruby/CMakeLists.txt 2009-05-26 08:01:44 UTC (rev 7716) @@ -1,15 +1,21 @@ -INCLUDE (FindPythonInterp) -IF (PYTHONINTERP_FOUND) +FIND_PACKAGE (Ruby) + + +if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + SET(RUBY_FOUND TRUE) +endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH) + + + IF(RUBY_FOUND) OPTION (BUILD_RUBY_BINDINGS "Build the Ruby bindings for the C client library" ON) IF (BUILD_RUBY_BINDINGS) FIND_PACKAGE (SWIG) IF (SWIG_FOUND) - MESSAGE (STATUS "Python bindings for C client library will be built") + MESSAGE (STATUS "Ruby bindings for C client library will be built") INCLUDE (${SWIG_USE_FILE}) - FIND_PACKAGE (Ruby) INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH}) INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}) INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR}) @@ -48,22 +54,13 @@ TARGET_LINK_LIBRARIES (${SWIG_MODULE_playercr_REAL_NAME} playerjpeg) ENDIF (HAVE_JPEG) - #TODO: find ruby in windows, check install dir is correct - IF (PYTHON_OS_WIN) - GET_FILENAME_COMPONENT (playercruInstallDir ${RUBY_EXECUTABLE} PATH) - ELSE (PYTHON_OS_WIN) - # Get the Python version - EXECUTE_PROCESS (COMMAND ${PYTHON_EXECUTABLE} -V - ERROR_VARIABLE pythonVersionString - ERROR_STRIP_TRAILING_WHITESPACE) - STRING (REGEX REPLACE "^Python ([0-9]+\\.[0-9]+).*" "\\1" pythonVersion ${pythonVersionString}) - SET (playercruInstallDir lib/python${pythonVersion}/site-packages) - ENDIF (PYTHON_OS_WIN) - SET (RUBY_BINDINGS_INSTALL_DIR ${playercruInstallDir} CACHE PATH "Ruby bindings installation directory under $prefix") + + #TODO: find ruby in windows, check install dir is correct + SET (RUBY_BINDINGS_INSTALL_DIR ${RUBY_SITELIB_DIR} CACHE PATH "Ruby bindings installation directory under $RUBY_SITELIB_DIR") MARK_AS_ADVANCED (RUBY_BINDINGS_INSTALL_DIR) INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/playercr.so - DESTINATION ${RUBY_SITELIB_DIR} + DESTINATION ${RUBY_BINDINGS_INSTALL_DIR} RENAME playerc.so) ELSE (SWIG_FOUND) MESSAGE (STATUS "Ruby bindings for C client library will not be built - could not find Swig") @@ -71,7 +68,7 @@ ELSE (BUILD_RUBY_BINDINGS) MESSAGE (STATUS "Ruby bindings for C client library will not be built - disabled by user") ENDIF (BUILD_RUBY_BINDINGS) -ELSE (PYTHONINTERP_FOUND) - MESSAGE (STATUS "Ruby bindings for C client library will not be built - could not find Python") -ENDIF (PYTHONINTERP_FOUND) +ELSE (RUBY_FOUND) + MESSAGE (STATUS "Ruby bindings for C client library will not be built - could not find Ruby") +ENDIF (RUBY_FOUND) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit