diff --git a/CMakeLists.txt b/CMakeLists.txt index a851031..527818a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,32 +77,41 @@ target_compile_definitions( ) ################################################################################ -## Test Frontend +## Default Frontend builder ################################################################################ -if(${BUILD_FRONTEND}) +set(_DEFAULT_BULK_MONITOR_FRONTEND_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "") +function(default_bulk_monitor_frontend F_TARGET) add_executable( - bulk_monitor_fe - frontend/bulk_monitor_scfe.cxx + ${F_TARGET} + ${_DEFAULT_BULK_MONITOR_FRONTEND_DIR}/frontend/bulk_monitor_scfe.cxx ) set_property( TARGET - bulk_monitor_fe + ${F_TARGET} PROPERTY CXX_STANDARD 11 ) target_include_directories( - bulk_monitor_fe + ${F_TARGET} PRIVATE $ENV{MIDASSYS}/drivers ) + find_package(Midas REQUIRED) + target_link_libraries( - bulk_monitor_fe - bulk_monitor + ${F_TARGET} + PRIVATE + bulk_monitor ) -endif() + install( + TARGETS + ${F_TARGET} + RUNTIME DESTINATION bin + ) +endfunction()