diff options
Diffstat (limited to 'api/franca/CMakeLists.txt')
-rw-r--r-- | api/franca/CMakeLists.txt | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/api/franca/CMakeLists.txt b/api/franca/CMakeLists.txt index 421fa8e..6efc9ef 100644 --- a/api/franca/CMakeLists.txt +++ b/api/franca/CMakeLists.txt @@ -4,9 +4,9 @@ # # Component Name: whole franca generation # -# Author: Marco Residori +# Author: Philippe Colliot # -# Copyright (C) 2015, XS Embedded GmbH +# Copyright (C) 2015, PCA Peugeot Citroen # # Note: # The current file is an adaptation of the example file @@ -24,10 +24,16 @@ cmake_minimum_required (VERSION 2.8.1) project(whole-franca) -option(COMMONAPI_TOOL_GENERATOR - "Absolute path to CommonAPI code generator" "") -option(COMMONAPI_DBUS_TOOL_GENERATOR - "Absolute path to CommonAPI-DBus code generator" "") +option(COMMONAPI_TOOL_DIR + "Absolute path to CommonAPI tool" "") +option(COMMONAPI_DBUS_TOOL_DIR + "Absolute path to CommonAPI-DBus tool" "") + +execute_process(COMMAND uname -i OUTPUT_VARIABLE OS_VERSION) +if("${OS_VERSION}" MATCHES "i686") + set(OS_VERSION "x86") +endif() +message(STATUS "OS_VERSION = ${OS_VERSION}") set(COMMONAPI_FIDL_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(COMMONAPI_FIDL_DIR_NAVIGATION "${COMMONAPI_FIDL_DIR}/navigation") @@ -50,17 +56,17 @@ ${COMMONAPI_FIDL_DIR_HMI}/*.fidl ${COMMONAPI_FIDL_DIR_HMI}/speechservice/*.fidl ) -if (COMMONAPI_TOOL_GENERATOR) +if (COMMONAPI_TOOL_DIR) execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} - COMMAND ${COMMONAPI_DBUS_TOOL_GENERATOR} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) + COMMAND ${COMMONAPI_TOOL_DIR}/org.genivi.commonapi.core.cli.product/target/products/org.genivi.commonapi.core.cli.product/linux/gtk/${OS_VERSION}/commonapi-generator-linux-${OS_VERSION} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) else () - message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_GENERATOR=<path>") + message (FATAL_ERROR "Set the variable -DCOMMONAPI_TOOL_DIR=<path>") endif () -if (COMMONAPI_DBUS_TOOL_GENERATOR) +if (COMMONAPI_DBUS_TOOL_DIR) execute_process(WORKING_DIRECTORY ${COMMONAPI_FIDL_DIR} - COMMAND ${COMMONAPI_TOOL_GENERATOR} -sk -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) + COMMAND ${COMMONAPI_DBUS_TOOL_DIR}/org.genivi.commonapi.dbus.cli.product/target/products/org.genivi.commonapi.dbus.cli.product/linux/gtk/${OS_VERSION}/commonapi-dbus-generator-linux-${OS_VERSION} -d ${COMMONAPI_GEN_DIR} ${FIDL_FILES}) else () - message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_GENERATOR=<path>") + message (FATAL_ERROR "Set the variable -DCOMMONAPI_DBUS_TOOL_DIR=<path>") endif () |