use CMAKE_INSTALL_LIBDIR instead of "/usr/lib"
[profile/ivi/smartdevicelink.git] / test / CMakeLists.txt
1 find_package(Gstreamer-1.0 REQUIRED)
2 find_package(Glib-2.0 REQUIRED)
3
4 if (BUILD_TESTS_WITH_HMI)
5 find_package(LibXML2 REQUIRED)
6 endif(BUILD_TESTS_WITH_HMI)
7
8 # --- GoogleTest example
9 #add_subdirectory(./gtest-example)
10
11 # --- components tests
12 add_subdirectory(./components)
13 add_subdirectory(./thirdPartyLibs)
14 add_subdirectory(${CMAKE_SOURCE_DIR}/src/components/policy/test/policy ./policy)
15 add_subdirectory(./tools)
16
17
18 set (INCLUDE_DIR
19   ../src/thirdPartyLibs/gmock-1.7.0/include
20   ../src/thirdPartyLibs/jsoncpp/include/
21   ../src/thirdPartyLibs/gmock-1.7.0/gtest/include
22   ../src/thirdPartyLibs/MessageBroker/include
23   ../src/appMain
24   ../src/components/application_manager/include
25   ../src/components/hmi_message_handler/include
26   ../src/components/request_watchdog/include
27   ../src/components/media_manager/include
28   ../src/components/config_profile/include
29   ../src/components/policy/src/policy/include
30   ../src/components/policy/src/policy/usage_statistics/include
31   ../src/components/protocol_handler/include
32   ../src/components/transport_manager/include
33   ../src/components/connection_handler/include
34   ../src/components/formatters/include
35   ../src/components/smart_objects/include
36   ../src/components/formatters/include
37   ../src/components/utils/include/
38   ../src/components/resumption/include/
39   ../test/components/mobile_message_handler/include/
40   ../test/components/request_watchdog/include/
41   ../test/components/media_manager/include
42   ../test/components/protocol_handler/include/
43   ../test/components/utils/include
44   ../test/components/json_handler/include
45   ../test/components/smart_objects
46   ../test/components/transport_manager
47   ../test/components/
48   ../test/thirdPartyLibs/jsoncpp/include
49   ../test/components/application_manager
50   ../test/components/application_manager/rpc/include
51   ${CMAKE_BINARY_DIR}/src/components/
52   ${CMAKE_BINARY_DIR}
53 #  /usr/lib/i386-linux-gnu/glib-2.0/include
54 #  /usr/lib/x86_64-linux-gnu/glib-2.0/include/
55 #  ${GSTREAMER_gst_INCLUDE_DIR}
56 #  ${GLIB_glib_2_INCLUDE_DIR}
57 )
58
59 set(LIBRARIES
60     MediaManager
61     ApplicationManager
62     gtest
63     gtest_main
64     gmock
65     gmock_main
66     formatters
67     HMI_API
68     v4_protocol_v1_2_no_extra
69     SmartObjects
70     RequestWatchdog
71     #policy
72     ProtocolHandler
73     Utils
74     ConfigProfile
75     #test_JSONHandler_v4_protocol_v2_0_revP
76     #test_json_handler
77     #test_SmartObjectTest
78     #test_FormattersCommandsTest
79     #test_UtilsTest
80     #test_RequestWatchdogTest
81     #test_ProtocolHandlerTest
82     #test_JSONCPPTest
83     connectionHandler
84     MOBILE_API
85     jsoncpp
86     TransportManager
87     HMIMessageHandler
88     MessageBroker
89     MessageBrokerClient
90     MessageBrokerServer
91     encryption
92     # rt
93     # ${GSTREAMER_gstreamer_LIBRARY}
94     Resumption
95 )
96
97 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
98   list(APPEND LIBRARIES dl)
99 endif()
100
101
102 if (BUILD_USB_SUPPORT)
103 if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
104   list(APPEND LIBRARIES Libusb-1.0.16)
105 endif()
106 endif()
107
108 add_executable("test_suit" "./test_suit.cc")
109
110 if (BUILD_TESTS_WITH_HMI)
111 include_directories(${INCLUDE_DIR} ${LibXML2_INCLUDE_DIR})
112 target_link_libraries("test_suit" 
113   test_App_Manager 
114   ${LIBRARIES} 
115   ${LibXML2_LIBRARIES} -lxml2
116   avahi-client
117   )
118 else (BUILD_TESTS_WITH_HMI)
119 include_directories(${INCLUDE_DIR})
120 target_link_libraries("test_suit" ${LIBRARIES})
121 endif (BUILD_TESTS_WITH_HMI)
122
123 # vim: set ts=2 sw=2 et: