[Pkg-running-devel] [openambit] 77/131: Prepared for make install possibility

Christian Perrier bubulle at moszumanska.debian.org
Thu Jul 17 20:19:13 UTC 2014


This is an automated email from the git hooks/post-receive script.

bubulle pushed a commit to branch master
in repository openambit.

commit 446e0b094f1ee0140ffb97b74177556ca7ece497
Author: Emil Ljungdahl <emil at kratern.se>
Date:   Sun Jan 26 22:14:49 2014 +0100

    Prepared for make install possibility
---
 src/libambit/CMakeLists.txt                |  5 ++++-
 src/openambit/CMakeLists.txt               | 18 ++++++++++++++++++
 src/openambit/cmake/FindUDev.cmake         |  9 +++++++--
 src/openambit/deployment/openambit.desktop |  9 +++++++++
 4 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/libambit/CMakeLists.txt b/src/libambit/CMakeLists.txt
index bc2d1a7..cdf1d24 100644
--- a/src/libambit/CMakeLists.txt
+++ b/src/libambit/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
 project (LIBAMBIT)
 
 # Where to lookup modules
-set (CMAKE_MODULE_PATH "${LIBAMBIT_SOURCE_DIR}/cmake")
+set(CMAKE_MODULE_PATH "${LIBAMBIT_SOURCE_DIR}/cmake")
 
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
 
@@ -42,3 +42,6 @@ set_target_properties(ambit PROPERTIES VERSION 0.0.1 SOVERSION 1)
 include_directories(
   hidapi
 )
+
+install(TARGETS ambit DESTINATION lib)
+install(FILES libambit.h DESTINATION include)
diff --git a/src/openambit/CMakeLists.txt b/src/openambit/CMakeLists.txt
index 31875a4..7e0b48f 100644
--- a/src/openambit/CMakeLists.txt
+++ b/src/openambit/CMakeLists.txt
@@ -68,6 +68,13 @@ set ( openambit_MOCS
   single_application.h
 )
 
+set ( APP_ICON ${PROJECT_SOURCE_DIR}/icons/icon_disconnected.png )
+
+set ( CMAKE_INSTALL_UDEVRULESDIR /lib/udev/rules.d
+      CACHE PATH "Where to install udev rules"
+)
+mark_as_advanced ( CMAKE_INSTALL_UDEVRULESDIR )
+
 add_subdirectory("${PROJECT_SOURCE_DIR}/movescount")
 
 QT4_WRAP_UI(UIS ${openambit_UIS})
@@ -79,3 +86,14 @@ add_definitions( -DAPP_VERSION="${OPENAMBIT_VERSION}" )
 add_executable ( openambit ${openambit_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} )
 
 target_link_libraries ( openambit  ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${LIBAMBIT_LIBS} ${UDEV_LIBS} ${ZLIB_LIBRARY} ${QJSON_LIBRARIES} )
+
+install ( TARGETS openambit DESTINATION bin )
+install ( FILES ${OPENAMBIT_SOURCE_DIR}/deployment/99-suunto-ambit.rules
+          DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR}
+          COMPONENT system
+)
+install ( FILES ${OPENAMBIT_SOURCE_DIR}/deployment/openambit.desktop
+          DESTINATION share/applications )
+install ( FILES ${APP_ICON}
+          DESTINATION share/icons/hicolor/64x64/apps
+          RENAME openambit.png )
diff --git a/src/openambit/cmake/FindUDev.cmake b/src/openambit/cmake/FindUDev.cmake
index 08e4f39..6febceb 100644
--- a/src/openambit/cmake/FindUDev.cmake
+++ b/src/openambit/cmake/FindUDev.cmake
@@ -12,8 +12,13 @@
 
 find_path(UDEV_INCLUDE_DIR libudev.h)
 find_library(UDEV_LIBS udev)
+find_path(UDEV_RULES_PATH udev/rules.d
+          PATHS
+          /lib
+          /usr/lib
+)
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIR UDEV_LIBS)
+find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIR UDEV_LIBS UDEV_RULES_PATH)
 
-mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS)
+mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS UDEV_RULES_PATH)
diff --git a/src/openambit/deployment/openambit.desktop b/src/openambit/deployment/openambit.desktop
new file mode 100644
index 0000000..c5b92b0
--- /dev/null
+++ b/src/openambit/deployment/openambit.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=HEAD
+Type=Application
+Name=Openambit
+Comment=Open source synchronization for Suunto Ambit series
+TryExec=openambit
+Exec=openambit
+Icon=openambit
+Categories=Utility

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git



More information about the Pkg-running-devel mailing list