1# - Try to find the SyS-T headers and libraries
2#
3# This module defines
4# SYST_INCLUDE_DIRS, where to find header files
5# SYST_LIBRARIES,   the libraries to link against
6# SYST_FOUND, true if SyS-T installation found
7
8
9if (NOT SYST_SDK AND NOT $ENV{SYST_SDK} STREQUAL "")
10    set(SYST_SDK $ENV{SYST_SDK})
11endif()
12
13set (SYST_INCLUDE_SEARCH_DIRS
14        ../include
15        /usr/include
16        /usr/local/include
17)
18
19set (SYST_LIBRARIES_SEARCH_DIRS
20        ../lib
21        /usr/lib
22        /usr/local/lib
23)
24
25if (SYST_SDK)
26    file(TO_CMAKE_PATH ${SYST_SDK} SYST_SDK)
27
28
29    set (SYST_INCLUDE_SEARCH_DIRS
30            ${SYST_SDK}/include
31            ${SYST_INCLUDE_SEARCH_DIRS}
32    )
33
34    set (SYST_LIBRARIES_SEARCH_DIRS
35        ${SYST_SDK}/bin
36        ${SYST_SDK}/lib
37        ${SYST_INCLUDE_SEARCH_DIRS}
38    )
39endif ()
40
41find_path (SYST_INCLUDE_DIRS
42               mipi_syst.h
43           HINTS
44               ${SYST_INCLUDE_SEARCH_DIRS}
45)
46
47find_library(SYST_LIBRARIES_STATIC
48                mipi_syst_static
49              HINTS
50                ${SYST_LIBRARIES_SEARCH_DIRS}
51)
52
53find_library(SYST_LIBRARIES_DYNAMIC
54                mipi_syst
55              HINTS
56                ${SYST_LIBRARIES_SEARCH_DIRS}
57)
58
59
60include(FindPackageHandleStandardArgs)
61
62set (SYST_notfound_msg
63         "Could not find MIPI SyS-T SDK. Try setting SYST environment variable."
64)
65
66FIND_PACKAGE_HANDLE_STANDARD_ARGS (
67      SYST DEFAULT_MSG SYST_INCLUDE_DIRS SYST_LIBRARIES_STATIC SYST_LIBRARIES_DYNAMIC
68)
69
70mark_as_advanced (
71        SYST_INCLUDE_DIRS
72        SYST_LIBRARIES_STATIC
73        SYST_LIBRARIES_DYNAMIC
74)
75