config: Fix build failure missing header file
[apps/agl-service-can-low-level.git] / conf.d / cmake / config.cmake
index 0f67843..3453d66 100644 (file)
@@ -38,13 +38,13 @@ set(PROJECT_CMAKE_CONF_DIR "conf.d")
 
 # Compilation Mode (DEBUG, RELEASE)
 # ----------------------------------
-set(BUILD_TYPE "RELEASE" CACHE STRING "Default Build variant chosen. (Overwritten by cli if given)")
+set(BUILD_TYPE "DEBUG" CACHE STRING "Default Build variant chosen. (Overwritten by cli if given)")
 
 # Activate J1939
 # Need module in kernel
 # --------------
 
-execute_process(COMMAND ls /usr/include/linux/can/j1939.h RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND ls $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/can/j1939.h RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
 
 if(result)
        message("Feature J1939 disabled")
@@ -62,7 +62,7 @@ endif()
 # Need module in kernel
 # --------------
 
-execute_process(COMMAND ls /usr/include/linux/can/isotp.h RESULT_VARIABLE result2 OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND ls $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/can/isotp.h RESULT_VARIABLE result2 OUTPUT_QUIET ERROR_QUIET)
 
 if(result2)
     message("Feature ISO TP disabled")
@@ -100,6 +100,7 @@ set (PKG_REQUIRED_LIST
        libsystemd>=222
        afb-daemon
        afb-helpers
+       appcontroller
 )
 
 # Prefix path where will be installed the files
@@ -111,6 +112,8 @@ set(INSTALL_PREFIX $ENV{HOME}/opt)
 # -----------------------------
 list (APPEND link_libraries -pthread)
 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
 # Compilation options definition
 # Use CMake generator expressions to specify only for a specific language
 # Values are prefilled with default options that is currently used.
@@ -183,7 +186,7 @@ set(WIDGET_TYPE application/vnd.agl.service)
 # This is the file that will be executed, loaded,
 # at launch time by the application framework.
 #
-set(WIDGET_ENTRY_POINT lib/afb-low-can.so)
+set(WIDGET_ENTRY_POINT lib/afb-low-can-binding.so)
 
 # Optional dependencies order
 # ---------------------------
@@ -216,6 +219,13 @@ set(AFB_REMPORT "1234" CACHE STRING "Default binder listening port")
 set(CLOSING_MESSAGE "Typical binding launch: afb-daemon --port=${AFB_REMPORT} --workdir=${CMAKE_BINARY_DIR}/package --ldpaths=lib --roothttp=htdocs  --token=\"${AFB_TOKEN}\" --tracereq=common --verbose")
 set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
 
+
+# Add Controller config
+add_definitions(-DCONTROL_PLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib/plugins:${CMAKE_BINARY_DIR}/package/lib/plugins:${CMAKE_BINARY_DIR}/package/var:${CMAKE_BINARY_DIR}/package-test")
+add_definitions(-DCONTROL_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/etc:${CMAKE_BINARY_DIR}/package/etc:${CMAKE_BINARY_DIR}/package-test/")
+
+
+
 # Optional schema validator about now only XML, LUA and JSON
 # are supported
 #------------------------------------------------------------