Files
mathis_s 2966a33233
Test And Build / Format (push) Failing after 3s
Test And Build / Lint (push) Failing after 14s
Initial compiling version of the bronkhorst driver
2026-07-24 15:24:08 +02:00

136 lines
2.4 KiB
CMake

cmake_minimum_required(VERSION 3.03)
project(keller_dv2ps VERSION 0.1)
add_compile_options(
-Wall
-Wformat=2
-Wno-format-nonliteral
-Wno-strict-aliasing
-Wuninitialized
-Wno-unused-function
)
option(
BUILD_FRONTEND
"If ON, build the default frontend executable"
OFF
)
set(CMAKE_PREFIX_PATH "$ENV{MIDASSYS}")
find_package(Midas REQUIRED)
set(
TCPIP_DRIVER_DIR
$ENV{MIDASSYS}/drivers/bus/tcpip.cxx
CACHE STRING
"path to tcpip driver that should be used"
)
set(
DRIVERS
$ENV{MIDASSYS}/drivers/class/multi.cxx
)
set(SYS_LIBS
pthread
util
rt
dl
)
set(MIDAS_LIBS
midas::mfe
midas::midas
midas::mscb
)
set(LIBS ${SYS_LIBS} ${MIDAS_LIBS})
################################################################################
## 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
# separate everything?
${TCPIP_DRIVER_DIR} ./bus/tcpip
)
set(
LIBS
${LIBS}
tcpip
)
else()
set(
DRIVERS
${DRIVERS}
${TCPIP_DRIVER_DIR}
)
endif()
################################################################################
## Device Library
################################################################################
add_library(
bronkhorst_flowmeter
device/bronkhorst_flowmeter.cxx
${DRIVERS}
)
set_property(
TARGET
bronkhorst_flowmeter
PROPERTY
CXX_STANDARD 11
)
target_include_directories(
bronkhorst_flowmeter
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/device>
$<INSTALL_INTERFACE:include>
PRIVATE
$ENV{MIDASSYS}/drivers
)
target_link_libraries(
bronkhorst_flowmeter
${LIBS}
)
################################################################################
## Test Frontend
################################################################################
if(${BUILD_FRONTEND})
add_executable(
bronkhorst_flowmeter_fe
frontend/bronkhorst_flowmeter_fe.cxx
)
set_property(
TARGET
bronkhorst_flowmeter_fe
PROPERTY
CXX_STANDARD 11
)
target_include_directories(
bronkhorst_flowmeter_fe
PRIVATE
$ENV{MIDASSYS}/drivers
)
target_link_libraries(
bronkhorst_flowmeter_fe
bronkhorst_flowmeter
)
endif()