+if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+ message(FATAL_ERROR "Require at least gcc-4.9")
+endif(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9)
+
+ADD_DEFINITIONS(-DINTRINSIC_BINDING_DIR="${INTRINSIC_BINDING_DIR}")
+# Always add INFER_EXTENSION (more details in afb-hreq.c)
+ADD_DEFINITIONS(-DINFER_EXTENSION)
+
+############################################################################
+# TODO: improve below setting by using config file
+option(WITH_SIG_MONITOR_DUMPSTACK "Activate dump stack on error" ON)
+option(WITH_SIG_MONITOR_SIGNALS "Activate handling of signals" ON)
+option(WITH_SIG_MONITOR_FOR_CALL "Activate monitoring of calls" ON)
+option(WITH_SIG_MONITOR_TIMERS "Activate monitoring of call expiration" ON)
+option(WITH_AFB_HOOK "Include hooking" ON)
+option(WITH_AFB_TRACE "Include monitoring trace" ON)
+option(WITH_SUPERVISOR "Activates installation of supervisor" OFF)
+option(WITH_DBUS_TRANSPARENCY "Allows API transparency over DBUS" OFF)
+option(WITH_LEGACY_BINDING_V1 "Includes the legacy Binding API version 1" OFF)
+option(WITH_LEGACY_BINDING_V2 "Includes the legacy Binding API version 2" ON)
+option(WITH_LEGACY_BINDING_VDYN "Includes the legacy Binding API version dynamic" OFF)
+option(WITH_DYNAMIC_BINDING "Allow to load dynamic bindings (shared libraries)" ON)
+
+if(INCLUDE_SUPERVISOR)
+ set(WITH_SUPERVISOR ON)
+endif()
+if(INCLUDE_DBUS_TRANSPARENCY)
+ set(WITH_DBUS_TRANSPARENCY ON)
+endif()
+if(INCLUDE_LEGACY_BINDING_V1)
+ set(WITH_LEGACY_BINDING_V1 ON)
+endif()
+if(INCLUDE_LEGACY_BINDING_VDYN)
+ set(WITH_LEGACY_BINDING_VDYN ON)
+endif()
+
+add_definitions(
+ -DAGL_DEVEL=$<BOOL:${AGL_DEVEL}>
+ -DWITH_SIG_MONITOR_DUMPSTACK=$<BOOL:${WITH_SIG_MONITOR_DUMPSTACK}>
+ -DWITH_SIG_MONITOR_SIGNALS=$<BOOL:${WITH_SIG_MONITOR_SIGNALS}>
+ -DWITH_SIG_MONITOR_FOR_CALL=$<BOOL:${WITH_SIG_MONITOR_FOR_CALL}>
+ -DWITH_SIG_MONITOR_TIMERS=$<BOOL:${WITH_SIG_MONITOR_TIMERS}>
+ -DWITH_AFB_HOOK=$<BOOL:${WITH_AFB_HOOK}>
+ -DWITH_AFB_TRACE=$<BOOL:${WITH_AFB_TRACE}>
+ -DWITH_LEGACY_BINDING_V1=$<BOOL:${INCLUDE_LEGACY_BINDING_V1}>
+ -DWITH_LEGACY_BINDING_V2=$<BOOL:${WITH_LEGACY_BINDING_V2}>
+ -DWITH_LEGACY_BINDING_VDYN=$<BOOL:${INCLUDE_LEGACY_BINDING_VDYN}>
+ -DWITH_DBUS_TRANSPARENCY=$<BOOL:${INCLUDE_DBUS_TRANSPARENCY}>
+ -DWITH_SUPERVISION=$<BOOL:${INCLUDE_SUPERVISOR}>
+ -DWITH_DYNAMIC_BINDING=$<BOOL:${WITH_DYNAMIC_BINDING}>
+)
+############################################################################
+
+SET(AFB_LIB_SOURCES
+ afb-api.c