diff options
Diffstat (limited to 'src/appMain/CMakeLists.txt')
-rw-r--r-- | src/appMain/CMakeLists.txt | 111 |
1 files changed, 53 insertions, 58 deletions
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index 84b2c847bd..a0f053fbd2 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Ford Motor Company +# Copyright (c) 2016, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,12 +28,43 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -IF (HMIADAPTER STREQUAL "messagebroker") -set (BROKER_LIBRARIES - MessageBrokerClient - MessageBrokerServer +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) + +find_package(SDLOpenSSL REQUIRED) + +include_directories( + ${COMPONENTS_DIR}/protocol_handler/include + ${COMPONENTS_DIR}/application_manager/include + ${COMPONENTS_DIR}/formatters/include + ${COMPONENTS_DIR}/transport_manager/include + ${COMPONENTS_DIR}/security_manager/include + ${COMPONENTS_DIR}/security_manager/include + ${COMPONENTS_DIR}/config_profile/include + ${COMPONENTS_DIR}/utils/include + ${COMPONENTS_DIR}/connection_handler/include + ${COMPONENTS_DIR}/hmi_message_handler/include + ${COMPONENTS_DIR}/request_watchdog/include + ${COMPONENTS_DIR}/smart_objects/include + ${COMPONENTS_DIR}/media_manager/include + ${COMPONENTS_DIR}/telemetry_monitor/include + ${COMPONENTS_DIR}/policy/include + ${COMPONENTS_DIR}/resumption/include + ${COMPONENTS_DIR}/dbus/include + ${CMAKE_BINARY_DIR}/src/components + ${JSONCPP_INCLUDE_DIRECTORY} + ${LOG4CXX_INCLUDE_DIRECTORY} + ${OPENSSL_INCLUDE_DIRECTORY} + ${MESSAGE_BROKER_INCLUDE_DIRECTORY} ) -ENDIF () + +collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}") + +if (HMIADAPTER STREQUAL "messagebroker") + set (BROKER_LIBRARIES + message_broker_client + message_broker_server + ) +endif() cmake_policy(PUSH) # make link_directories() treat paths relative to the source dir @@ -43,18 +74,18 @@ link_directories(${LIBUSB_LIBS_DIRECTORY}) cmake_policy(POP) if (EXTENDED_MEDIA_MODE) -set(default_media_inc -${GSTREAMER_gst_INCLUDE_DIR} -${GSTREAMER_gstconfig_INCLUDE_DIR} -) + set(default_media_inc + ${GSTREAMER_gst_INCLUDE_DIR} + ${GSTREAMER_gstconfig_INCLUDE_DIR} + ) else(EXTENDED_MEDIA_MODE) -set(default_media_inc -) + set(default_media_inc) endif() if (TELEMETRY_MONITOR) - set(TELEMETRY_MONITOR_LIB - TelemetryMonitor) + set(TELEMETRY_MONITOR_LIB + TelemetryMonitor + ) endif() set(LIBRARIES @@ -73,7 +104,7 @@ set(LIBRARIES TransportManager ${SecurityManagerLibrary} HMIMessageHandler - MessageBroker + message_broker ${BROKER_LIBRARIES} Utils jsoncpp @@ -87,12 +118,15 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() if (BUILD_BT_SUPPORT) - list(APPEND LIBRARIES bluetooth) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND LIBRARIES bluetooth) + endif() endif() + if (BUILD_USB_SUPPORT) -if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND LIBRARIES Libusb-1.0.16) -endif() + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + list(APPEND LIBRARIES Libusb-1.0.16) + endif() endif() if(ENABLE_LOG) @@ -102,44 +136,6 @@ if(ENABLE_LOG) list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY}) endif() -include_directories ( - ./ - ${COMPONENTS_DIR}/protocol_handler/include/ - ${JSONCPP_INCLUDE_DIRECTORY} - ${COMPONENTS_DIR}/application_manager/include - ${COMPONENTS_DIR}/formatters/include - ${COMPONENTS_DIR}/transport_manager/include - ${COMPONENTS_DIR}/security_manager/include - ${SecurityManagerIncludeDir} - ${COMPONENTS_DIR}/security_manager/include - ${COMPONENTS_DIR}/config_profile/include - ${COMPONENTS_DIR}/utils/include/ - ${COMPONENTS_DIR}/connection_handler/include/ - ${COMPONENTS_DIR}/hmi_message_handler/include - ${COMPONENTS_DIR}/request_watchdog/include - ${COMPONENTS_DIR}/smart_objects/include/ - ${COMPONENTS_DIR}/media_manager/include/ - ${COMPONENTS_DIR}/telemetry_monitor/include - ${COMPONENTS_DIR}/policy/include/ - ${COMPONENTS_DIR}/resumption/include/ - ${MESSAGE_BROKER_INCLUDE_DIRECTORY} - ${ENCRYPTION_INCLUDE_DIRECTORY} - ${COMPONENTS_DIR} - ${CMAKE_BINARY_DIR}/src/components/ - ${COMPONENTS_DIR}/dbus/include/ - ${CMAKE_SOURCE_DIR} - ${default_media_inc} - ${LOG4CXX_INCLUDE_DIRECTORY} - ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8 - ${CMAKE_SOURCE_DIR}/src/3rd_party/dbus-1.7.8/dbus/ -) - -set (SOURCES - main.cc - life_cycle.cc - signal_handlers.cc -) - if( NOT CMAKE_BUILD_TYPE ) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build. Options are: None, Debug, Release, RelWithDebInfo, MinSizeRel." FORCE) endif() @@ -147,7 +143,6 @@ endif() add_executable(${PROJECT} ${SOURCES}) target_link_libraries(${PROJECT} ${LIBRARIES}) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/audio.8bit.wav DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) |