Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Add cmake infrastructure.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Jun 28, 2009
1 parent eee3ea1 commit 72456c2
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
.#*
\#*#
build
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
project(kaya)
cmake_minimum_required(VERSION 2.6)

find_package(KDE4 REQUIRED)
include(KDE4Defaults)
add_subdirectory(lib)


configure_file(main.rb main.rb)

install(DIRECTORY lib DESTINATION ${DATA_INSTALL_DIR}/kaya
PATTERN "*rc" EXCLUDE
PATTERN "*.desktop" EXCLUDE)
install(FILES ${PROJECT_BINARY_DIR}/main.rb
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
RENAME kaya)
6 changes: 3 additions & 3 deletions kaya
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
RUBY=/usr/bin/ruby
#!/usr/bin/env ruby
require 'lib/kaya.rb'

$RUBY lib/kaya.rb $@
start_kaya if __FILE__ == $0
5 changes: 5 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_subdirectory(ext)

install(FILES kaya.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kaya)
install(FILES kaya.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kayaui.rc DESTINATION ${DATA_INSTALL_DIR}/kaya)
20 changes: 20 additions & 0 deletions lib/ext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
find_package(Qt4 REQUIRED)
find_package(Ruby REQUIRED)

add_definitions(${QT_DEFINITIONS})
include_directories(${QT_INCLUDES})


set(src extensions.cpp expblur.cpp)
qt4_wrap_cpp(src extensions.h)
add_library(extensions SHARED ${src})
set_target_properties(extensions PROPERTIES PREFIX "")


message("lib: ${QT_QTGUI_LIBRARY}")
target_link_libraries(extensions ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})

# install(TARGETS ksimple DESTINATION bin)



10 changes: 10 additions & 0 deletions lib/kaya.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=Kaya
GenericName=Generic Board Game
Exec=kaya %i %m -caption "%c"
Icon=kaya
Type=Application
DocPath=kaya/kaya.html
Comment=A generic board game application.
Terminal=false
9 changes: 5 additions & 4 deletions lib/kaya.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__))
require 'qtutils'
require 'mainwindow'
require 'plugins/loader'
require 'games/all'

if $0 == __FILE__
DEFAULT_GAME = :chess
def start_kaya
default_game = :chess

app = KDE::Application.init(
:version => '0.1',
Expand All @@ -25,13 +26,13 @@
name = args.arg(0)
g = Game.get(name.to_sym)
unless g
warn "No such game #{name}. Defaulting to #{DEFAULT_GAME}"
warn "No such game #{name}. Defaulting to #{default_game}"
nil
else
g
end
end
game ||= Game.get(DEFAULT_GAME)
game ||= Game.get(default_game)

plugin_loader = PluginLoader.new
main = MainWindow.new(plugin_loader, game)
Expand Down
4 changes: 4 additions & 0 deletions main.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require '${DATA_INSTALL_DIR}/kaya/lib/kaya.rb'

start_kaya if __FILE__ == $0

0 comments on commit 72456c2

Please sign in to comment.