Skip to content

Commit

Permalink
Merge pull request #3 from kkaempf/master
Browse files Browse the repository at this point in the history
Fix local build
  • Loading branch information
tgoettlicher committed Jun 11, 2012
2 parents e253025 + e780268 commit 35c1160
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*~
build
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 2.6)

if(COMMAND cmake_policy)
cmake_policy(SET CMP0017 NEW)
endif(COMMAND cmake_policy)

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ${CMAKE_MODULE_PATH})
Expand All @@ -9,6 +13,9 @@ INCLUDE(${CMAKE_SOURCE_DIR}/VERSION.cmake)
SET( PACKAGE "libyui-bindings" )
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )

SET( LIBYUI_INCLUDE_DIR "/usr/include/yui" )
SET( LIBYUI_LIBRARY "yui" )

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Language Bindings for libyui")
SET(CPACK_PACKAGE_VENDOR "Novell Inc.")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
Expand Down
16 changes: 16 additions & 0 deletions swig/ruby/examples/_loadpath.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
DIR = File.dirname(__FILE__)

$: << DIR

if ENV["LIBYUI_GEM"] # set LIBYUI_GEM to test gem-based libyui-bindings
require 'rubygems'
else
# Autotools binary
$:.unshift File.expand_path(File.join(DIR,"../.libs"))

# cmake binary
$:.unshift File.expand_path(File.join(DIR,"../../../build/swig/ruby"))

# cmake local for openwsman.rb
$:.unshift File.expand_path(File.join(DIR,".."))
end
5 changes: 4 additions & 1 deletion swig/ruby/examples/combo_box1.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$:.unshift "../../../build/swig/ruby"
#
# Combo box example
#
require File.join(File.dirname(__FILE__),'_loadpath')

require 'yui'

Expand Down
2 changes: 1 addition & 1 deletion swig/ruby/examples/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Trivial libyui example
#

$:.unshift "../../../build/swig/ruby"
require File.join(File.dirname(__FILE__),'_loadpath')

require 'test/unit'

Expand Down
2 changes: 1 addition & 1 deletion swig/ruby/examples/loading.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Test loading of the bindings
#

$:.unshift "../../../build/swig/ruby"
require File.join(File.dirname(__FILE__),'_loadpath')

# test loading of extension
require 'test/unit'
Expand Down
2 changes: 1 addition & 1 deletion swig/ruby/examples/selection_box1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Trivial libyui example
#

$:.unshift "../../../build/swig/ruby"
require File.join(File.dirname(__FILE__),'_loadpath')

require 'test/unit'

Expand Down
5 changes: 4 additions & 1 deletion swig/ruby/examples/selection_box2.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
$:.unshift "../../../build/swig/ruby"
#
# Selection box example
#
require File.join(File.dirname(__FILE__),'_loadpath')

require 'yui'

Expand Down
1 change: 1 addition & 0 deletions swig/ruby/examples/selection_box3.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__),'_loadpath')
require 'yui'

# reopen the class to add a convenience method
Expand Down

0 comments on commit 35c1160

Please sign in to comment.