provide the device driver as a library
This commit is contained in:
+41
-5
@@ -30,10 +30,14 @@ set(
|
||||
-lutil
|
||||
-lrt # librt for real time guarantees (really just backwards compat)
|
||||
-ldl # libdl for dynamic loading
|
||||
$ENV{MIDAS_PREFIX}/lib/libmfe.a
|
||||
$ENV{MIDAS_PREFIX}/lib/libmidas.a
|
||||
$ENV{MIDASSYS}/lib/libmfe.a
|
||||
$ENV{MIDASSYS}/lib/libmidas.a
|
||||
)
|
||||
|
||||
################################################################################
|
||||
## make tcpip library configurable
|
||||
################################################################################
|
||||
|
||||
if(IS_DIRECTORY ${TCPIP_DRIVER_DIR})
|
||||
add_subdirectory(
|
||||
# TODO not sure, should it be a submodule? does it really make sense to
|
||||
@@ -54,9 +58,12 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(
|
||||
################################################################################
|
||||
## Device Library
|
||||
################################################################################
|
||||
|
||||
add_library(
|
||||
keller_dv2ps
|
||||
frontends/keller_dv2ps_scfe.cxx
|
||||
device/keller_dv2ps.cxx
|
||||
${DRIVERS}
|
||||
)
|
||||
@@ -70,8 +77,9 @@ set_property(
|
||||
|
||||
target_include_directories(
|
||||
keller_dv2ps
|
||||
PRIVATE
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
$ENV{MIDASSYS}/drivers
|
||||
$ENV{MIDASSYS}/include
|
||||
$ENV{MIDASSYS}/mscb/include
|
||||
@@ -81,3 +89,31 @@ target_link_libraries(
|
||||
keller_dv2ps
|
||||
${LIBS}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
## Test Frontend
|
||||
################################################################################
|
||||
|
||||
add_executable(
|
||||
keller_dv2ps_fe
|
||||
frontends/keller_dv2ps_scfe.cxx
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET
|
||||
keller_dv2ps_fe
|
||||
PROPERTY
|
||||
CXX_STANDARD 11
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
keller_dv2ps_fe
|
||||
PRIVATE
|
||||
$ENV{MIDASSYS}/drivers
|
||||
$ENV{MIDASSYS}/include
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
keller_dv2ps_fe
|
||||
keller_dv2ps
|
||||
)
|
||||
|
||||
@@ -5,9 +5,8 @@ PS Digital Manometer.
|
||||
|
||||
## Requirements
|
||||
|
||||
Requires a Midas installation with the environment variables `MIDASSYS` and
|
||||
`MIDAS_PREFIX` pointing to the source code and the built artifacts,
|
||||
respectively.
|
||||
Requires a Midas installation with the environment variable `MIDASSYS` pointing
|
||||
to the built Midas artifacts and headers.
|
||||
|
||||
## Build
|
||||
|
||||
@@ -21,5 +20,50 @@ cmake --build <directory-to-build-in> --clean-first -- -j8
|
||||
## Run
|
||||
|
||||
```bash
|
||||
/build/driver/keller_dv2ps -e flame
|
||||
/build/driver/keller_dv2ps_fe -e flame
|
||||
```
|
||||
|
||||
## Including in Custom Frontend
|
||||
|
||||
To include this driver in a custom frontend, you should ensure the environment
|
||||
variable `MIDASSYS` points to your system install and include a snippet in your
|
||||
`CMakeLists.txt` similar to the following:
|
||||
|
||||
```CMake
|
||||
# If the path to the keller_dv2ps repository is outside of the frontend
|
||||
# repository, you also need to provide a location for the keller_dv2ps
|
||||
# artifacts as a second argument to `add_subdirectory`
|
||||
# e.g. `./device/keller_dv2ps`
|
||||
add_subdirectory(
|
||||
<path-to-keller_dv2ps-repository>
|
||||
)
|
||||
|
||||
add_executable(
|
||||
<frontend-name>
|
||||
<frontend-code-path-1>
|
||||
<frontend-code-path-2>
|
||||
:
|
||||
)
|
||||
|
||||
set_property(
|
||||
TARGET
|
||||
<frontend-name>
|
||||
PROPERTY
|
||||
CXX_STANDARD 11
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
<frontend-name>
|
||||
PRIVATE
|
||||
$ENV{MIDASSYS}/drivers
|
||||
$ENV{MIDASSYS}/include
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
<frontend-name>
|
||||
keller_dv2ps
|
||||
<additional-library-1>
|
||||
<additional-library-2>
|
||||
:
|
||||
)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user