From 945c04af76a4bc4456116cd5736d0d34e848a0bd Mon Sep 17 00:00:00 2001
From: Jussi Lindgren <openvibe-dev@inria.fr>
Date: Fri, 1 Apr 2016 15:35:07 +0200
Subject: [PATCH] Build: gusbamp Linux API can now be found by the cmake find
 script

---
 cmake-modules/FindThirdPartyGUSBampCAPI.cmake | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/cmake-modules/FindThirdPartyGUSBampCAPI.cmake b/cmake-modules/FindThirdPartyGUSBampCAPI.cmake
index e130a9347..6c2ef35b8 100644
--- a/cmake-modules/FindThirdPartyGUSBampCAPI.cmake
+++ b/cmake-modules/FindThirdPartyGUSBampCAPI.cmake
@@ -38,3 +38,21 @@ IF(WIN32)
 		MESSAGE(STATUS "  FAILED to find gUSBampCAPI")
 	ENDIF(PATH_GUSBampCAPI)
 ENDIF(WIN32)
+
+
+IF(UNIX)
+	# To try other versions of the gtec's library, change the number below
+	SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so.1.14")
+	FIND_LIBRARY(gUSBAmpLinux_LIBRARY NAMES "gusbampapi" PATHS "/usr/lib" "/usr/local/lib")
+	IF(gUSBAmpLinux_LIBRARY)
+		MESSAGE(STATUS "  Found GUSBAmpAPILinux...")
+		MESSAGE(STATUS "    [  OK  ] Third party lib ${gUSBAmpLinux_LIBRARY}")
+		ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGUSBampCAPI_Linux)
+		TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${gUSBAmpLinux_LIBRARY} )
+	ELSE(gUSBAmpLinux_LIBRARY)
+		MESSAGE(STATUS "  FAILED to find GUSBAmpAPI Linux... ")
+		MESSAGE(STATUS "   : If it should be found, see that 'libgusbampapi.so.1.14' link exists on the fs, with no further nemeric suffixes in the filename.")
+		MESSAGE(STATUS "   : e.g. do 'cd /usr/lib/ ; ln -s libgusbampapi.so.1.14'. See gtec-bcilab/README for details.")
+	ENDIF(gUSBAmpLinux_LIBRARY)
+		SET(OV_ThirdPartyGUSBAmp "YES")
+ENDIF(UNIX)
-- 
GitLab