Permalink
Browse files

Updates for cmake 2.6

  • Loading branch information...
1 parent 3a0860b commit 5398a11c3d600750769eebbe5d10dc4ba3417798 flithm committed Aug 24, 2008
View
@@ -1,7 +1,7 @@
############################################################################
##############################################################################
##
-## Copyright (c) 2007, Tim Burrell
+## Copyright (c) 2007-2008, Tim Burrell
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
@@ -23,6 +23,8 @@
project(Gizmod)
+cmake_minimum_required(VERSION 2.6)
+
#################################
# Defines
##############
@@ -0,0 +1,55 @@
+# - obsolete pkg-config module for CMake
+#
+# Defines the following macros:
+#
+# PKGCONFIG(package includedir libdir linkflags cflags)
+#
+# Calling PKGCONFIG will fill the desired information into the 4 given arguments,
+# e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS)
+# if pkg-config was NOT found or the specified software package doesn't exist, the
+# variable will be empty when the function returns, otherwise they will contain the respective information
+#
+
+
+
+FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/local/bin )
+
+MACRO(PKGCONFIG _package _include_DIR _link_DIR _link_FLAGS _cflags)
+# reset the variables at the beginning
+ SET(${_include_DIR})
+ SET(${_link_DIR})
+ SET(${_link_FLAGS})
+ SET(${_cflags})
+
+ # if pkg-config has been found
+ IF(PKGCONFIG_EXECUTABLE)
+
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --exists RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+
+ # and if the package of interest also exists for pkg-config, then get the information
+ IF(NOT _return_VALUE)
+
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=includedir
+ OUTPUT_VARIABLE ${_include_DIR} )
+ string(REGEX REPLACE "[\r\n]" " " ${_include_DIR} "${${_include_DIR}}")
+
+
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --variable=libdir
+ OUTPUT_VARIABLE ${_link_DIR} )
+ string(REGEX REPLACE "[\r\n]" " " ${_link_DIR} "${${_link_DIR}}")
+
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --libs
+ OUTPUT_VARIABLE ${_link_FLAGS} )
+ string(REGEX REPLACE "[\r\n]" " " ${_link_FLAGS} "${${_link_FLAGS}}")
+
+ EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS ${_package} --cflags
+ OUTPUT_VARIABLE ${_cflags} )
+ string(REGEX REPLACE "[\r\n]" " " ${_cflags} "${${_cflags}}")
+
+ ENDIF(NOT _return_VALUE)
+
+ ENDIF(PKGCONFIG_EXECUTABLE)
+
+ENDMACRO(PKGCONFIG _include_DIR _link_DIR _link_FLAGS _cflags)
+
+MARK_AS_ADVANCED(PKGCONFIG_EXECUTABLE)
View
@@ -1,7 +1,7 @@
############################################################################
##############################################################################
##
-## Copyright (c) 2007, Tim Burrell
+## Copyright (c) 2007-2008, Tim Burrell
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
@@ -23,6 +23,10 @@
project(GizmoDaemon)
+if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
#################################
# Dependencies
##############
View
@@ -1,7 +1,7 @@
############################################################################
##############################################################################
##
-## Copyright (c) 2007, Tim Burrell
+## Copyright (c) 2007-2008, Tim Burrell
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
@@ -23,6 +23,10 @@
project(libGizmod)
+if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
#################################
# Dependencies
##############
View
@@ -1,7 +1,7 @@
############################################################################
##############################################################################
##
-## Copyright (c) 2007, Tim Burrell
+## Copyright (c) 2007-2008, Tim Burrell
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
@@ -23,6 +23,10 @@
project(libH)
+if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
#################################
# Dependencies
##############
@@ -115,11 +115,14 @@ def onDeviceEvent(self, Event, Gizmo = None):
Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_M)
return True
elif Event.Button == "Left":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_LEFT)
+ return True
elif Event.Button == "OK":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_ENTER)
+ return True
elif Event.Button == "Right":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_RIGHT)
+ return True
elif Event.Button == "Down":
return False
elif Event.Button == "VolUp":
@@ -83,11 +83,13 @@ def onDeviceEvent(self, Event, Gizmo = None):
Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_P)
return True
elif Event.Button == "Rewind":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_PAGEUP)
+ return True
elif Event.Button == "Play":
return False
elif Event.Button == "Forward":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_PAGEDOWN)
+ return True
elif Event.Button == "Replay":
Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_BACKSPACE)
return True
@@ -125,9 +127,11 @@ def onDeviceEvent(self, Event, Gizmo = None):
self.AltTabber.doAltTab()
return True
elif Event.Button == "ChanUp":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_KPPLUS)
+ return True
elif Event.Button == "ChanDown":
- return False
+ Gizmod.Keyboards[0].createEvent(GizmoEventType.EV_KEY, GizmoKey.KEY_KPMINUS)
+ return True
elif Event.Button == "RecTV":
return False
elif Event.Button == "Mute":
View
@@ -1,7 +1,7 @@
############################################################################
##############################################################################
##
-## Copyright (c) 2007, Tim Burrell
+## Copyright (c) 2007-2008, Tim Burrell
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
@@ -23,6 +23,10 @@
project(actor_gizmod)
+if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
#################################
# Dependencies
##############

0 comments on commit 5398a11

Please sign in to comment.