X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=conf.d%2Fcmake%2Fconfig.cmake;h=5eab8bd6515c9eea2b8799d32160932aa7d19ddd;hb=HEAD;hp=9e9a15b0e191f2d469dc935c46c48e6aed669ef9;hpb=ea8e3ef5b673f0d2b7d096a6bd229e9edf5dec54;p=apps%2Fagl-service-can-low-level.git diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index 9e9a15b0..5eab8bd6 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -38,7 +38,62 @@ 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 +# -------------- + +# Default to off +set(WITH_FEATURE_J1939 OFF CACHE BOOL "") + +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("J1939 header not detected!") + # Over-ride cached value + set(WITH_FEATURE_J1939 OFF) +else() + message("J1939 header detected") + # Check cache to allow over-ride + set(WITH_FEATURE_J1939 ON CACHE BOOL "") + # Define name for ECU + set(J1939_NAME_ECU 0x1239 CACHE STRING "") +endif() +if(WITH_FEATURE_J1939) + message("Feature J1939 enabled") + add_definitions(-DUSE_FEATURE_J1939) + add_definitions(-DJ1939_NAME_ECU=${J1939_NAME_ECU}) +else() + message("Feature J1939 disabled") +endif() + +# Activate ISO TP +# Need module in kernel +# -------------- + +# Default to off +set(WITH_FEATURE_ISOTP OFF CACHE BOOL "") + +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("ISO TP header not detected!") + # Over-ride cached value + set(WITH_FEATURE_ISOTP OFF) +else() + message("ISO TP header detected") + # Check cache to allow over-ride + set(WITH_FEATURE_ISOTP ON CACHE BOOL "") +endif() +if(WITH_FEATURE_ISOTP) + message("Feature ISOTP enabled") + add_definitions(-DUSE_FEATURE_ISOTP) +else() + message("Feature ISO TP disabled") +endif() + + # Kernel selection if needed. You can choose between a # mandatory version to impose a minimal version. @@ -65,6 +120,7 @@ set (PKG_REQUIRED_LIST libsystemd>=222 afb-daemon afb-helpers + appcontroller ) # Prefix path where will be installed the files @@ -76,6 +132,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. @@ -90,7 +148,6 @@ set(COMPILE_OPTIONS -Wno-sign-compare -Wno-sign-conversion -Werror=maybe-uninitialized - -Werror=implicit-function-declaration -ffunction-sections -fdata-sections -fPIC @@ -149,7 +206,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 # --------------------------- @@ -182,6 +239,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 #------------------------------------------------------------