aboutsummaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-04-11 13:09:56 +0200
committerJose Bollo <jose.bollo@iot.bzh>2019-04-12 10:55:54 +0200
commit6b2b09db8ee3cf88b09b59696d50b4fa2de79a72 (patch)
tree081c5ce2ad13790500dd14078d355796380539cf /bindings
parent9cf1fcea338281f76eaac000930479b18dacef01 (diff)
Reordering of sample and tutorial bindings
The main idea here is to install the sample and tutorial bindings in specific directory. This will at the end help to package parts of the binder. It also includes a simplification of CMakeLists files. Also fix an error in packaging rpm. Bug-AGL: SPEC-2165 Change-Id: I494cc753796848cde849de1c3596893c78fa228f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/CMakeLists.txt2
-rw-r--r--bindings/intrinsics/CMakeLists.txt2
-rw-r--r--bindings/samples/CMakeLists.txt88
-rw-r--r--bindings/tutorials/CMakeLists.txt (renamed from bindings/tutorial/CMakeLists.txt)5
-rw-r--r--bindings/tutorials/export.map (renamed from bindings/tutorial/export.map)0
-rw-r--r--bindings/tutorials/tuto-1.c (renamed from bindings/tutorial/tuto-1.c)0
-rw-r--r--bindings/tutorials/tuto-2.c (renamed from bindings/tutorial/tuto-2.c)0
-rw-r--r--bindings/tutorials/tuto-3.cpp (renamed from bindings/tutorial/tuto-3.cpp)0
-rw-r--r--bindings/tutorials/tuto-4.c (renamed from bindings/tutorial/tuto-4.c)0
-rw-r--r--bindings/tutorials/tuto-5.cpp (renamed from bindings/tutorial/tuto-5.cpp)0
-rw-r--r--bindings/tutorials/tuto-app1.c (renamed from bindings/tutorial/tuto-app1.c)0
11 files changed, 18 insertions, 79 deletions
diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt
index 35f22897..c4fbdea0 100644
--- a/bindings/CMakeLists.txt
+++ b/bindings/CMakeLists.txt
@@ -18,5 +18,5 @@
ADD_SUBDIRECTORY(intrinsics)
ADD_SUBDIRECTORY(samples)
-ADD_SUBDIRECTORY(tutorial)
+ADD_SUBDIRECTORY(tutorials)
diff --git a/bindings/intrinsics/CMakeLists.txt b/bindings/intrinsics/CMakeLists.txt
index 70da19e9..ee981217 100644
--- a/bindings/intrinsics/CMakeLists.txt
+++ b/bindings/intrinsics/CMakeLists.txt
@@ -27,7 +27,7 @@ SET_TARGET_PROPERTIES(afb-dbus-binding PROPERTIES
PREFIX ""
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
)
-TARGET_LINK_LIBRARIES(afb-dbus-binding ${link_libraries})
+TARGET_LINK_LIBRARIES(afb-dbus-binding ${json-c_LDFLAGS} ${libsystemd_LDFLAGS})
INSTALL(TARGETS afb-dbus-binding
LIBRARY DESTINATION ${binding_install_dir})
diff --git a/bindings/samples/CMakeLists.txt b/bindings/samples/CMakeLists.txt
index 34b364f5..51442684 100644
--- a/bindings/samples/CMakeLists.txt
+++ b/bindings/samples/CMakeLists.txt
@@ -16,78 +16,18 @@
# limitations under the License.
###########################################################################
-
-INCLUDE_DIRECTORIES(${include_dirs})
-
-##################################################
-# AuthLogin
-##################################################
-ADD_LIBRARY(authLogin MODULE AuthLogin.c)
-SET_TARGET_PROPERTIES(authLogin PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(authLogin ${link_libraries})
-INSTALL(TARGETS authLogin
- LIBRARY DESTINATION ${binding_install_dir})
-
-##################################################
-# DemoContext
-##################################################
-ADD_LIBRARY(demoContext MODULE DemoContext.c)
-SET_TARGET_PROPERTIES(demoContext PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(demoContext ${link_libraries})
-INSTALL(TARGETS demoContext
- LIBRARY DESTINATION ${binding_install_dir})
-
-##################################################
-# DemoPost
-##################################################
-ADD_LIBRARY(demoPost MODULE DemoPost.c)
-SET_TARGET_PROPERTIES(demoPost PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(demoPost ${link_libraries})
-INSTALL(TARGETS demoPost
- LIBRARY DESTINATION ${binding_install_dir})
-
-##################################################
-# tic-tac-toe
-##################################################
-ADD_LIBRARY(tic-tac-toe MODULE tic-tac-toe.c)
-SET_TARGET_PROPERTIES(tic-tac-toe PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(tic-tac-toe ${link_libraries})
-INSTALL(TARGETS tic-tac-toe
- LIBRARY DESTINATION ${binding_install_dir})
-
-##################################################
-# hello2
-##################################################
-ADD_LIBRARY(hello2 MODULE hello2.c)
-SET_TARGET_PROPERTIES(hello2 PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(hello2 ${link_libraries})
-INSTALL(TARGETS hello2
- LIBRARY DESTINATION ${binding_install_dir})
-
-##################################################
-# hello3
-##################################################
-ADD_LIBRARY(hello3 MODULE hello3.c)
-SET_TARGET_PROPERTIES(hello3 PROPERTIES
- PREFIX ""
- LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
-)
-TARGET_LINK_LIBRARIES(hello3 ${link_libraries})
-INSTALL(TARGETS hello3
- LIBRARY DESTINATION ${binding_install_dir})
+macro(sample name source)
+ add_library(${name} MODULE ${source})
+ set_target_properties(${name} PROPERTIES PREFIX "" LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map")
+# target_link_libraries(${name} ${link_libraries})
+ target_link_libraries(${name} ${json-c_LDFLAGS} ${CMAKE_THREAD_LIBS_INIT})
+ install(TARGETS ${name} LIBRARY DESTINATION ${install_datadir}/bindings/samples)
+endmacro(sample)
+
+sample(authLogin AuthLogin.c)
+sample(demoContext DemoContext.c)
+sample(demoPost DemoPost.c)
+sample(tic-tac-toe tic-tac-toe.c)
+sample(hello2 hello2.c)
+sample(hello3 hello3.c)
diff --git a/bindings/tutorial/CMakeLists.txt b/bindings/tutorials/CMakeLists.txt
index f05fa541..e071d7a9 100644
--- a/bindings/tutorial/CMakeLists.txt
+++ b/bindings/tutorials/CMakeLists.txt
@@ -17,15 +17,14 @@
###########################################################################
-#INCLUDE_DIRECTORIES(${include_dirs})
-
MACRO(tuto num ext)
ADD_LIBRARY(tuto-${num} MODULE tuto-${num}.${ext})
SET_TARGET_PROPERTIES(tuto-${num} PROPERTIES
PREFIX ""
LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
)
- TARGET_LINK_LIBRARIES(tuto-${num} ${link_libraries})
+ TARGET_LINK_LIBRARIES(tuto-${num} ${json-c_LDFLAGS})
+ install(TARGETS tuto-${num} LIBRARY DESTINATION ${install_datadir}/bindings/tutorials)
ENDMACRO(tuto)
diff --git a/bindings/tutorial/export.map b/bindings/tutorials/export.map
index ee2f4133..ee2f4133 100644
--- a/bindings/tutorial/export.map
+++ b/bindings/tutorials/export.map
diff --git a/bindings/tutorial/tuto-1.c b/bindings/tutorials/tuto-1.c
index 1f58be6c..1f58be6c 100644
--- a/bindings/tutorial/tuto-1.c
+++ b/bindings/tutorials/tuto-1.c
diff --git a/bindings/tutorial/tuto-2.c b/bindings/tutorials/tuto-2.c
index 10797081..10797081 100644
--- a/bindings/tutorial/tuto-2.c
+++ b/bindings/tutorials/tuto-2.c
diff --git a/bindings/tutorial/tuto-3.cpp b/bindings/tutorials/tuto-3.cpp
index 8ad69ef3..8ad69ef3 100644
--- a/bindings/tutorial/tuto-3.cpp
+++ b/bindings/tutorials/tuto-3.cpp
diff --git a/bindings/tutorial/tuto-4.c b/bindings/tutorials/tuto-4.c
index cb909fd0..cb909fd0 100644
--- a/bindings/tutorial/tuto-4.c
+++ b/bindings/tutorials/tuto-4.c
diff --git a/bindings/tutorial/tuto-5.cpp b/bindings/tutorials/tuto-5.cpp
index 458ae7b5..458ae7b5 100644
--- a/bindings/tutorial/tuto-5.cpp
+++ b/bindings/tutorials/tuto-5.cpp
diff --git a/bindings/tutorial/tuto-app1.c b/bindings/tutorials/tuto-app1.c
index 93747cdd..93747cdd 100644
--- a/bindings/tutorial/tuto-app1.c
+++ b/bindings/tutorials/tuto-app1.c