aboutsummaryrefslogtreecommitdiff
path: root/examples/cmake/FindSyST.cmake
diff options
context:
space:
mode:
authorNorbert Schulz <github@schulznorbert.de>2018-04-24 07:44:59 +0200
committerGitHub <noreply@github.com>2018-04-24 07:44:59 +0200
commit5c01b712fca37f1d8c39663517d7b55d53f9d245 (patch)
tree53b9b48c888e539d8f1dc72aa6424f026b0a0e64 /examples/cmake/FindSyST.cmake
parentf84309511ff6557a3df608a4e061345c87b9e2dc (diff)
parent024e538bbb6916f1c3e6a8caf52be6fee7f7257c (diff)
downloadmipisyst-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.cmake74
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
+)