Commit 3383b7f0 authored by Jussi Lindgren's avatar Jussi Lindgren

Drivers: Minor changes to the gNautilus driver

- Tweaked with the Find script to only enable the driver compilation if all components are present
- Added include guards to all the source/header files
- Fixed an uninformative fail when opening Driver Properties without the gNautilus device
parent 6fd9e6b0
......@@ -11,54 +11,65 @@
#ENDIF(OV_ThirdPartyGMobilab)
IF(WIN32)
FIND_PATH(PATH_GNEEDaccessAPI GDSClientAPI.h PATHS
"C:/Program Files/gtec/gNEEDaccess Client API/C"
"C:/Program Files (x86)/gtec/gNEEDaccess Client API/C"
"C:/Program Files/gtec/gNEEDaccess Client API/C/win32"
"C:/Program Files (x86)/gtec/gNEEDaccess Client API/C/win32"
${OV_CUSTOM_DEPENDENCIES_PATH})
SET(PATHS_GNEEDaccessAPI "C:/Program Files/gtec/gNEEDaccess Client API/C" "C:/Program Files (x86)/gtec/gNEEDaccess Client API/C")
SET(PATHS_GNEEDaccessLIB "C:/Program Files/gtec/gNEEDaccess Client API/C/win32" "C:/Program Files (x86)/gtec/gNEEDaccess Client API/C/win32")
SET(PATHS_GNEEDaccessServer "C:/Program Files/gtec/gNEEDaccess/" "C:/Program Files (x86)/gtec/gNEEDaccess/")
FIND_PATH(PATH_GNEEDaccessAPI GDSClientAPI.h PATHS
${PATHS_GNEEDaccessAPI}
NO_DEFAULT_PATH)
IF(PATH_GNEEDaccessAPI)
MESSAGE(STATUS " Found gNEEDaccessAPI...")
INCLUDE_DIRECTORIES(${PATH_GNEEDaccessAPI})
FIND_PATH(PATH_ClientAPI GDSClientAPI.lib PATHS
"C:/Program Files (x86)/gtec/gNEEDaccess Client API/C/win32"
"C:/Program Files/gtec/gNEEDaccess Client API/C/win32"
)
IF(PATH_ClientAPI)
FIND_LIBRARY(LIB_GDSClientAPI GDSClientAPI PATHS ${PATH_ClientAPI})
MESSAGE(STATUS "${LIB_GDSClientAPI}")
# Find GDSClientAPI lib and dll
FIND_PATH(PATH_ClientLIB GDSClientAPI.dll PATHS
${PATHS_GNEEDaccessLIB}
NO_DEFAULT_PATH)
FIND_LIBRARY(LIB_GDSClientAPI GDSClientAPI PATHS ${PATHS_GNEEDaccessLIB} NO_DEFAULT_PATH)
IF(LIB_GDSClientAPI)
MESSAGE(STATUS " [ OK ] lib ${LIB_GDSClientAPI}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSClientAPI} )
ELSE(LIB_GDSClientAPI)
MESSAGE(STATUS " [FAILED] lib GDSClientAPI")
ENDIF(LIB_GDSClientAPI)
ENDIF(PATH_ClientAPI)
FIND_PATH(PATH_ServerLIB GDSServer.lib PATHS
"C:/Program Files (x86)/gtec/gNEEDaccess Client API/C/win32"
"C:/Program Files/gtec/gNEEDaccess Client API/C/win32"
)
IF(PATH_ServerLIB)
# Find GDSServer lib and dll
FIND_LIBRARY(LIB_GDSServer GDSServer PATHS ${PATH_ServerLIB})
# Find GDSServer dll
FIND_PATH(PATH_ServerDLL GDSServer.dll PATHS
${PATHS_GNEEDaccessServer}
NO_DEFAULT_PATH)
IF(PATH_ServerDLL)
MESSAGE(STATUS " [ OK ] dll ${PATH_ServerDLL}")
ELSE(PATH_ServerDLL)
MESSAGE(STATUS " [FAILED] dll GDSServer")
ENDIF(PATH_ServerDLL)
# Find GDSServer lib
FIND_LIBRARY(LIB_GDSServer GDSServer PATHS ${PATHS_GNEEDaccessLIB} NO_DEFAULT_PATH)
IF(LIB_GDSServer)
MESSAGE(STATUS " [ OK ] lib ${LIB_GDSServer}")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSServer} )
ELSE(LIB_GDSServer)
MESSAGE(STATUS " [FAILED] lib GDSServer")
ENDIF(LIB_GDSServer)
ENDIF(PATH_ServerLIB)
# Copy the DLL file at install
INSTALL(PROGRAMS "${PATH_ClientAPI}/GDSClientAPI.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ClientAPI}/gAPI.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ClientAPI}/Networking.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ServerLIB}/GDSServer.dll" DESTINATION "bin")
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGNEEDaccessAPI)
SET(OV_ThirdPartyGNEEDaccess "YES")
# MESSAGE(STATUS "1, ${PATH_ClientLIB} 2, ${LIB_GDSClientAPI} 3, ${PATH_ServerDLL} 4, ${LIB_GDSServer}")
# Only add the compile/install directive if all necessary components were found
IF(PATH_ClientLIB AND LIB_GDSClientAPI AND PATH_ServerDLL AND LIB_GDSServer)
# Copy the DLL file at install
INSTALL(PROGRAMS "${PATH_ClientLIB}/GDSClientAPI.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ClientLIB}/gAPI.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ClientLIB}/Networking.dll" DESTINATION "bin")
INSTALL(PROGRAMS "${PATH_ServerDLL}/GDSServer.dll" DESTINATION "bin")
INCLUDE_DIRECTORIES(${PATH_GNEEDaccessAPI})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSClientAPI} )
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_GDSServer} )
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyGNEEDaccessAPI)
SET(OV_ThirdPartyGNEEDaccess "YES")
ENDIF(PATH_ClientLIB AND LIB_GDSClientAPI AND PATH_ServerDLL AND LIB_GDSServer)
ELSE(PATH_GNEEDaccessAPI)
MESSAGE(STATUS " FAILED to find gNEEDaccessAPI (optional)")
ENDIF(PATH_GNEEDaccessAPI)
......
#if defined(TARGET_HAS_ThirdPartyGNEEDaccessAPI)
#include "ovasCConfigurationgNautilusInterface.h"
using namespace OpenViBE;
......@@ -652,6 +655,7 @@ boolean CConfigurationgNautilusInterface::preConfigure(void)
l_bFunctionReturn = openDevice();
if (!l_bFunctionReturn)
{
m_rDriverContext.getLogManager() << LogLevel_Error << "Unable to open a suitable device\n";
return false;
}
}
......@@ -1032,4 +1036,7 @@ boolean CConfigurationgNautilusInterface::closeDevice(void)
delete [] m_sDeviceNames;
return true;
}
\ No newline at end of file
}
#endif // TARGET_HAS_ThirdPartyGNEEDaccessAPI
#ifndef __OpenViBE_AcquisitionServer_CConfigurationgNautilusInterface_H__
#define __OpenViBE_AcquisitionServer_CConfigurationgNautilusInterface_H__
#if defined(TARGET_HAS_ThirdPartyGNEEDaccessAPI)
#include "../ovasCConfigurationBuilder.h"
#include "ovasIDriver.h"
......@@ -115,4 +117,6 @@ namespace OpenViBEAcquisitionServer
};
};
#endif // TARGET_HAS_ThirdPartyGNEEDaccessAPI
#endif // __OpenViBE_AcquisitionServer_CConfigurationgNautilusInterface_H__
#if defined(TARGET_HAS_ThirdPartyGNEEDaccessAPI)
#include "ovasCDrivergNautilusInterface.h"
#include "ovasCConfigurationgNautilusInterface.h"
......@@ -510,4 +513,8 @@ void OnDataReadyEventHandler(GDS_HANDLE connection_handle, void *usr_data)
{
// insert error handling if necessary
}
}
\ No newline at end of file
}
#endif // TARGET_HAS_ThirdPartyGNEEDaccessAPI
#ifndef __OpenViBE_AcquisitionServer_CDrivergNautilusInterface_H__
#define __OpenViBE_AcquisitionServer_CDrivergNautilusInterface_H__
#if defined(TARGET_HAS_ThirdPartyGNEEDaccessAPI)
#include "ovasIDriver.h"
#include "../ovasCHeader.h"
#include <openvibe/ov_all.h>
......@@ -108,4 +110,6 @@ namespace OpenViBEAcquisitionServer
};
};
#endif // TARGET_HAS_ThirdPartyGNEEDaccessAPI
#endif // __OpenViBE_AcquisitionServer_CDrivergNautilusInterface_H__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment