diff options
author | Norbert Schulz <github@schulznorbert.de> | 2018-04-24 07:44:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 07:44:59 +0200 |
commit | 5c01b712fca37f1d8c39663517d7b55d53f9d245 (patch) | |
tree | 53b9b48c888e539d8f1dc72aa6424f026b0a0e64 /examples/cmake/FindSyST.cmake | |
parent | f84309511ff6557a3df608a4e061345c87b9e2dc (diff) | |
parent | 024e538bbb6916f1c3e6a8caf52be6fee7f7257c (diff) | |
download | mipisyst-5c01b712fca37f1d8c39663517d7b55d53f9d245.zip mipisyst-5c01b712fca37f1d8c39663517d7b55d53f9d245.tar.gz mipisyst-5c01b712fca37f1d8c39663517d7b55d53f9d245.tar.bz2 |
Merge pull request #2 from MIPI-Alliance/INITIAL_IMPORT_SYS_T_1.0v1.0
Adding MIPI System Software Trace Example Code
Diffstat (limited to 'examples/cmake/FindSyST.cmake')
-rw-r--r-- | examples/cmake/FindSyST.cmake | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/examples/cmake/FindSyST.cmake b/examples/cmake/FindSyST.cmake new file mode 100644 index 0000000..006238a --- /dev/null +++ b/examples/cmake/FindSyST.cmake @@ -0,0 +1,74 @@ +# - Try to find the SyS-T headers and libraries +# +# This module defines +# SYST_INCLUDE_DIRS, where to find header files +# SYST_LIBRARIES, the libraries to link against +# SYST_FOUND, true if SyS-T installation found + + +if (NOT SYST_SDK AND NOT $ENV{SYST_SDK} STREQUAL "") + set(SYST_SDK $ENV{SYST_SDK}) +endif() + +set (SYST_INCLUDE_SEARCH_DIRS + ../include + /usr/include + /usr/local/include +) + +set (SYST_LIBRARIES_SEARCH_DIRS + ../lib + /usr/lib + /usr/local/lib +) + +if (SYST_SDK) + file(TO_CMAKE_PATH ${SYST_SDK} SYST_SDK) + + + set (SYST_INCLUDE_SEARCH_DIRS + ${SYST_SDK}/include + ${SYST_INCLUDE_SEARCH_DIRS} + ) + + set (SYST_LIBRARIES_SEARCH_DIRS + ${SYST_SDK}/bin + ${SYST_SDK}/lib + ${SYST_INCLUDE_SEARCH_DIRS} + ) +endif () + +find_path (SYST_INCLUDE_DIRS + mipi_syst.h + HINTS + ${SYST_INCLUDE_SEARCH_DIRS} +) + +find_library(SYST_LIBRARIES_STATIC + mipi_syst_static + HINTS + ${SYST_LIBRARIES_SEARCH_DIRS} +) + +find_library(SYST_LIBRARIES_DYNAMIC + mipi_syst + HINTS + ${SYST_LIBRARIES_SEARCH_DIRS} +) + + +include(FindPackageHandleStandardArgs) + +set (SYST_notfound_msg + "Could not find MIPI SyS-T SDK. Try setting SYST environment variable." +) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS ( + SYST DEFAULT_MSG SYST_INCLUDE_DIRS SYST_LIBRARIES_STATIC SYST_LIBRARIES_DYNAMIC +) + +mark_as_advanced ( + SYST_INCLUDE_DIRS + SYST_LIBRARIES_STATIC + SYST_LIBRARIES_DYNAMIC +) |