User Tools

Site Tools


for_developers:wrapper_lib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
for_developers:wrapper_lib [2017/04/18 12:32] kalbererfor_developers:wrapper_lib [2017/04/18 12:43] (current) kalberer
Line 3: Line 3:
  
   - Create new CMake project for a shared library.    - Create new CMake project for a shared library. 
 +  - Include and link against EEROS: <code>find_package(EEROS REQUIRED)
 +include_directories(${EEROS_INCLUDE_DIR})
 +link_directories(${EEROS_LIB_DIR})</code>
   - Include and link against necessary hardware library. If the required hardware library generates a CMake Package, use ''find_package()'' to search for the library: <code>find_package(flink REQUIRED)   - Include and link against necessary hardware library. If the required hardware library generates a CMake Package, use ''find_package()'' to search for the library: <code>find_package(flink REQUIRED)
 include_directories(${FLINK_INCLUDE_DIR}) include_directories(${FLINK_INCLUDE_DIR})
-link_directories(${FLINK_LIB_DIR})</code>+link_directories(${FLINK_LIB_DIR})</code> If you have no CMake Package you have to search for an installed header file or add it as additional include and library directory. <code>find_path(COMEDI_INCLUDE_DIR NAMES comedi.h comedilib.h) 
 +if(COMEDI_INCLUDE_DIR) 
 +        include_directories(${COMEDI_INCLUDE_DIR}) 
 +endif() 
 + 
 +find_library(COMEDI_LIBRARY comedi) 
 +if(COMEDI_LIBRARY) 
 + message(STATUS "-> libcomedi available"
 + set(COMEDI_LIBRARY_DIR ${COMEDI_LIBRARY_DIR} comedi) 
 +endif()</code>
   - Create classes for every type you intend to support (AnalogOut, DigitalIn, PWM, ...):   - Create classes for every type you intend to support (AnalogOut, DigitalIn, PWM, ...):
     - These classes have to derive from the EEROS HAL classes In- or Output respectively ScalableIn- or ScalableOutput. You can find these classes in the EEROS repository in folder ''/includes/eeros/hal''. This allows you to access the member functions of the derived classes when they are loaded dynamically over the configuration file.     - These classes have to derive from the EEROS HAL classes In- or Output respectively ScalableIn- or ScalableOutput. You can find these classes in the EEROS repository in folder ''/includes/eeros/hal''. This allows you to access the member functions of the derived classes when they are loaded dynamically over the configuration file.
for_developers/wrapper_lib.txt · Last modified: 2017/04/18 12:43 by kalberer