1# Copyright (C) 2015-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2# This Source Code Form is subject to the terms of the Mozilla Public 3# License, v. 2.0. If a copy of the MPL was not distributed with this 4# file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6cmake_minimum_required (VERSION 2.8.7...3.23.2) 7project (vSomeIPHelloWorld) 8 9find_package(Threads REQUIRED) 10 11set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") 12 13include_directories(${VSOMEIP_INCLUDE_DIRS}) 14 15add_library(vsomeip_hello_world_service INTERFACE) 16target_sources(vsomeip_hello_world_service INTERFACE 17 "${CMAKE_CURRENT_SOURCE_DIR}/hello_world_service.hpp" 18) 19target_include_directories(vsomeip_hello_world_service INTERFACE 20 "${CMAKE_CURRENT_SOURCE_DIR}" 21) 22 23add_library(vsomeip_hello_world_client INTERFACE) 24target_sources(vsomeip_hello_world_client INTERFACE 25 "${CMAKE_CURRENT_SOURCE_DIR}/hello_world_client.hpp" 26) 27target_include_directories(vsomeip_hello_world_client INTERFACE 28 "${CMAKE_CURRENT_SOURCE_DIR}" 29 ) 30 31if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android") 32 # This will get us acces to 33 # VSOMEIP_INCLUDE_DIRS - include directories for vSomeIP 34 # VSOMEIP_LIBRARIES - libraries to link against 35 find_package(${VSOMEIP_NAME}) 36 if (NOT ${VSOMEIP_NAME}_FOUND) 37 message("${VSOMEIP_NAME} was not found. Please specify vsomeip_DIR") 38 endif() 39 40 add_executable (hello_world_service hello_world_service_main.cpp) 41 target_link_libraries(hello_world_service vsomeip_hello_world_service ${VSOMEIP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) 42 43 add_executable (hello_world_client hello_world_client_main.cpp) 44 target_link_libraries(hello_world_client vsomeip_hello_world_client ${VSOMEIP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) 45endif() 46