Adapt CMake files to use new capabilities with widget
authorRomain Forlot <romain.forlot@iot.bzh>
Sat, 29 Apr 2017 16:13:28 +0000 (18:13 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Sat, 29 Apr 2017 16:13:28 +0000 (18:13 +0200)
Change-Id: I88a1ef090b7ce40c833c5780f5a481876ff7ea09
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
CAN-binder/etc/config.cmake
CAN-binder/libs/CMakeLists.txt
CAN-binder/low-can-binding/CMakeLists.txt
CAN-binder/packaging/wgt/config.xml.in [new file with mode: 0644]
CAN-binder/packaging/wgt/icon.png.in [new file with mode: 0644]
CAN-binder/packaging/wgt/package.in [new file with mode: 0644]

index 7bbcc62..ac06926 100644 (file)
@@ -29,6 +29,11 @@ set(PROJECT_ICON "icon.png")
 # ----------------------------------
 setc(CMAKE_BUILD_TYPE "DEBUG")
 
+# Compiler selection if needed. Overload the detected compiler.
+# -----------------------------------------------
+#set(CMAKE_C_COMPILER "gcc")
+#set(CMAKE_CXX_COMPILER "g++")
+
 # PKG_CONFIG required packages
 # -----------------------------
 set (PKG_REQUIRED_LIST 
@@ -47,8 +52,9 @@ set(CMAKE_C_FLAGS "")
 set(CMAKE_CXX_FLAGS "-std=c++11")
 
 # Print a helper message when every thing is finished
-setc(CLOSING_MESSAGE "Test with: afb-daemon --rootdir=\$\$(pwd)/low-can-binding/package --ldpaths=\$\$(pwd)/low-can-binding/package/lib --port=1234 --roothttp=\$\$(pwd)/low-can-binding/package/htdocs --tracereq=common --token=\"\" --verbose")
 # ----------------------------------------------------
+setc(CLOSING_MESSAGE "Test with: afb-daemon --rootdir=\$\$(pwd)/low-can-binding/package --ldpaths=\$\$(pwd)/low-can-binding/package/lib --port=1234 --roothttp=\$\$(pwd)/low-can-binding/package/htdocs --tracereq=common --token=\"\" --verbose")
+
 
 # (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable]
 # ---------------------------------------------------------------------
@@ -58,11 +64,11 @@ setc(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib)
 
 # Optional dependencies order
 # ---------------------------
-set(EXTRA_DEPENDENCIES_ORDER can-config-generator low-can-binding)
+#set(EXTRA_DEPENDENCIES_ORDER)
 
 # Optional Extra global include path
 # -----------------------------------
-#set(EXTRA_INCLUDE_DIRS can-config-generator/3rdparty/json libs/openxc-message-format/gen/cpp libs/nanopb libs/uds-c/src libs/isotp-c/src libs/bitfield-c/src)
+set(EXTRA_INCLUDE_DIRS libs/openxc-message-format/gen/cpp libs/nanopb libs/uds-c/src libs/isotp-c/src libs/bitfield-c/src libs/ini-config)
 
 # Optional extra libraries
 # -------------------------
@@ -70,7 +76,8 @@ set(EXTRA_DEPENDENCIES_ORDER can-config-generator low-can-binding)
 
 # Optional force binding installation
 # ------------------------------------
-# set(BINDINGS_INSTALL_PREFIX DestinationPath )
+set(BINDINGS_INSTALL_PREFIX /opt )
+# set(WIDGET_PREFIX DestinationPath)
 
 # Optional force binding Linking flag
 # ------------------------------------
index cd29ea8..38ccd2d 100644 (file)
@@ -26,4 +26,4 @@ foreach(filename ${filelist})
                PROJECT_TARGET_ADD(${shortname})
                add_library(${shortname} STATIC ${sources_files})
        endif(IS_DIRECTORY ${filename})
-endforeach()
\ No newline at end of file
+endforeach()
index a68ea2a..ddac1db 100644 (file)
@@ -29,8 +29,9 @@ PROJECT_TARGET_ADD(low-can-binding)
        # Binder exposes a unique public entry point
        SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
        PREFIX ""
+       LABELS "BINDING"
        LINK_FLAGS ${BINDINGS_LINK_FLAG}
-               OUTPUT_NAME ${TARGET_NAME}
+       OUTPUT_NAME ${TARGET_NAME}
        )
 
        # Library dependencies (include updates automatically)
@@ -41,11 +42,10 @@ PROJECT_TARGET_ADD(low-can-binding)
                uds-c
                isotp-c
                bitfield-c
-               ${link_libraries}
-       )
+               ${link_libraries})
+
+       populate_widget()
 
        # installation directory
        INSTALL(TARGETS ${TARGET_NAME}
                LIBRARY DESTINATION ${BINDINGS_INSTALL_DIR})
-
-       build_widget("BINDING")
\ No newline at end of file
diff --git a/CAN-binder/packaging/wgt/config.xml.in b/CAN-binder/packaging/wgt/config.xml.in
new file mode 100644 (file)
index 0000000..5965904
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns="http://www.w3.org/ns/widgets" id="@PROJECT_NAME@" version="@PROJECT_VERSION@">
+  <name>@PROJECT_NAME@</name>
+  <icon src="icon.png"/>
+  <content src="htdocs/index.html" type="application/vnd.agl.html.hybrid"/>
+  <description>This is a demo application used with low-can binding.</description>
+  <author>Romain Forlot &lt;romain.forlot@iot.bzh&gt;</author>
+  <license>APL 2.0</license>
+</widget>
+
+
diff --git a/CAN-binder/packaging/wgt/icon.png.in b/CAN-binder/packaging/wgt/icon.png.in
new file mode 100644 (file)
index 0000000..9bd6a6e
Binary files /dev/null and b/CAN-binder/packaging/wgt/icon.png.in differ
diff --git a/CAN-binder/packaging/wgt/package.in b/CAN-binder/packaging/wgt/package.in
new file mode 100644 (file)
index 0000000..5e12032
--- /dev/null
@@ -0,0 +1,4 @@
+can_buses.json
+low-can-demo/dist.prod
+low-can-demo/cpu-stat-binding.so
+low-can-binding/low-can-binding.so
\ No newline at end of file