Build flags for disabling place recognition & prediction engines 02/56702/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 12 Jan 2016 06:59:35 +0000 (15:59 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 12 Jan 2016 06:59:35 +0000 (15:59 +0900)
Change-Id: I6e346f4464f72a66c6314678c988d8df6db11367
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/place/CMakeLists.txt
src/place/place_context_provider.cpp
src/statistics/CMakeLists.txt
src/statistics/statistics_context_provider.cpp

index 47ec7df..9ee741d 100644 (file)
@@ -1,16 +1,22 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 SET(target "ctx-place")
 
+# Build flag for the place auto detection engine.
+# Set this to "yes" to enable the engine.
+SET(enable_recog_engine "no")
+
 # Common Profile
 FILE(GLOB srcs *.cpp)
 
 # Mobile Profile
 IF("${PROFILE}" STREQUAL "mobile")
        FILE(GLOB_RECURSE srcs ${srcs} geofence/*.cpp)
-       FILE(GLOB_RECURSE srcs ${srcs} recognition/*.cpp)
-       SET(deps "${deps} capi-location-manager")
        SET(deps "${deps} capi-geofence-manager")
-       SET(deps "${deps} capi-network-wifi")
+       IF("${enable_recog_engine}" STREQUAL "yes")
+               FILE(GLOB_RECURSE srcs ${srcs} recognition/*.cpp)
+               SET(deps "${deps} capi-location-manager")
+               SET(deps "${deps} capi-network-wifi")
+       ENDIF("${enable_recog_engine}" STREQUAL "yes")
 ENDIF("${PROFILE}" STREQUAL "mobile")
 
 MESSAGE("Place Provider Sources: ${srcs}")
@@ -30,5 +36,9 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEX
 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
 
+IF(NOT "${enable_recog_engine}" STREQUAL "yes")
+       SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "_DISABLE_RECOG_ENGINE_")
+ENDIF(NOT "${enable_recog_engine}" STREQUAL "yes")
+
 # Install
 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
index d5adcde..934f780 100644 (file)
 
 #ifdef _MOBILE_
 #include "geofence/place_geofence.h"
+#ifndef _DISABLE_RECOG_ENGINE_
 #include "recognition/place_recognition.h"
-#endif
+#endif /* _DISABLE_RECOG_ENGINE_ */
+#endif /* _MOBILE_ */
 
 template<typename provider>
 void register_provider(const char *subject, const char *privilege)
@@ -40,8 +42,11 @@ EXTAPI bool ctx::init_place_context_provider()
        register_provider<place_geofence_provider>(PLACE_SUBJ_GEOFENCE, PLACE_PRIV_GEOFENCE);
        place_geofence_provider::submit_trigger_item();
 
+#ifndef _DISABLE_RECOG_ENGINE_
        place_recognition_provider::create(NULL);
        register_provider<place_recognition_provider>(PLACE_SUBJ_RECOGNITION, PLACE_PRIV_RECOGNITION);
-#endif
+#endif /* _DISABLE_RECOG_ENGINE_ */
+
+#endif /* _MOBILE_ */
        return true;
 }
index d0ee7d6..1085dce 100644 (file)
@@ -1,6 +1,10 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 SET(target "ctx-statistics")
 
+# Build flag for the prediction engine.
+# Set this to "yes" to enable the engine.
+SET(enable_prediction_engine "no")
+
 # Common Options
 INCLUDE_DIRECTORIES(
        ${CMAKE_CURRENT_SOURCE_DIR}/shared
@@ -10,7 +14,9 @@ INCLUDE_DIRECTORIES(
 FILE(GLOB srcs ./*.cpp)
 FILE(GLOB srcs ${srcs} shared/*.cpp)
 FILE(GLOB srcs ${srcs} app/*.cpp)
-FILE(GLOB srcs ${srcs} prediction/*.cpp)
+IF("${enable_prediction_engine}" STREQUAL "yes")
+       FILE(GLOB srcs ${srcs} prediction/*.cpp)
+ENDIF("${enable_prediction_engine}" STREQUAL "yes")
 
 SET(deps "capi-system-runtime-info pkgmgr pkgmgr-info capi-appfw-package-manager")
 SET(deps "${deps} capi-appfw-application capi-appfw-app-manager")
@@ -58,5 +64,9 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "LOG_TAG=\"CONTEX
 SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
 
+IF(NOT "${enable_prediction_engine}" STREQUAL "yes")
+       SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "_DISABLE_PREDICTION_ENGINE_")
+ENDIF(NOT "${enable_prediction_engine}" STREQUAL "yes")
+
 # Install
 INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT RuntimeLibraries)
index 62fea4d..13e9c40 100644 (file)
 
 #include "app/app_stats_provider.h"
 
+#ifndef _DISABLE_PREDICTION_ENGINE_
+// include prediction engine header files here
+#endif
+
 #ifdef _MOBILE_
 #include "media/media_stats_provider.h"
 #include "social/social_stats_provider.h"
@@ -50,6 +54,10 @@ EXTAPI bool ctx::init_statistics_context_provider()
        register_provider<app_statistics_provider>(APP_SUBJ_FREQUENCY, APP_HISTORY_PRIV);
        app_statistics_provider::submit_trigger_item();
 
+#ifndef _DISABLE_PREDICTION_ENGINE_
+// initialize the prediction engine here
+#endif
+
 #ifdef _MOBILE_
        media_statistics_provider::create(NULL);
        register_provider<media_statistics_provider>(MEDIA_SUBJ_PEAK_TIME_FOR_MUSIC, MEDIA_HISTORY_PRIV);