diff --git a/CMakeLists.txt b/CMakeLists.txt index aa45649e32e51db7ae08dd65362af8379069bd13..4685100fb0cd8fa5f80304da003ec1a6f6193298 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.12) enable_testing() +# DEFINE BUILD_ON_BOOT from commandline when building on a typical puppet configured boot server +# This will cut out sections that depend on packages not usually installed on such bootservers. + FIND_PROGRAM(BISON_PROG bison) FIND_PROGRAM(FLEX_PROG flex) @@ -21,16 +24,54 @@ INCLUDE(Integration) FIND_PACKAGE(PkgConfig) FIND_PACKAGE(ClockGetTime) FIND_PACKAGE(EPICSBase REQUIRED) -FIND_PACKAGE(FrameCPP REQUIRED) -FIND_PACKAGE(Dolphin) + +if( NOT BUILD_ON_BOOT ) + FIND_PACKAGE(FrameCPP REQUIRED) + FIND_PACKAGE(RapidJSON) + FIND_PACKAGE(yaml-cpp) + find_package(pybind11) + FIND_PACKAGE(Python3) + FIND_PROGRAM(GOLANG go + HINTS /usr/bin) + find_program(CARGO cargo) + + if( NOT DEFINED Python3_SITEARCH) + MESSAGE(FATAL_ERROR "Python 3 library installation directory was not found.") + endif() +endif() FIND_PACKAGE(NDS2Client) FIND_PACKAGE(Boost COMPONENTS filesystem system) -FIND_PACKAGE(RapidJSON) FIND_PACKAGE(RPC) -find_package(pybind11) -FIND_PACKAGE(Python3) -FIND_PROGRAM(GOLANG go - HINTS /usr/bin) + +if( NOT BUILD_ON_BOOT ) + # check python3 SITEARCH is found + # the Python3_SITEARCH variable tells us where to install architecture dependent + # python packages. + # This is converted to a relative install path called Python3_ARCH_INSTALL_DIR, + # needed for pybind11 packages. + # + # Python3_SITELIB gives the install path for architecture independent packages + # if those are needed, then Python3_SITELIB should get the same treatment as Python3_SITEARCH. + # Python3_LIB_INSTALL_DIR should be created and used for those packages. + if( NOT DEFINED Python3_SITEARCH) + MESSAGE(FATAL_ERROR "Python 3 library installation directory was not found.") + endif() + + # generate relative python install directories + get_filename_component(Python3_PKG_ARCH_DIR ${Python3_SITEARCH} NAME) + get_filename_component(Python3_ARCH_BASE_DIR ${Python3_SITEARCH} DIRECTORY) + get_filename_component(Python3_PYTHON_ARCH_DIR ${Python3_ARCH_BASE_DIR} NAME) + SET(Python3_ARCH_INSTALL_DIR lib/${Python3_PYTHON_ARCH_DIR}/${Python3_PKG_ARCH_DIR}) + + MESSAGE(STATUS "Python3 version: ${Python3_VERSION}") + MESSAGE(STATUS "Python3 site arch: ${Python3_SITEARCH}") + MESSAGE(STATUS "Python3 arch install dir: ${Python3_ARCH_INSTALL_DIR}") + MESSAGE(STATUS "Python3 include dirs: ${Python3_INCLUDE_DIRS}") + MESSAGE(STATUS "Python3 libraries: ${Python3_LIBRARIES}") + MESSAGE(STATUS "Python3 library dirs: ${Python3_LIBRARY_DIRS}") + MESSAGE(STATUS "Python3 sitelib: ${Python3_SITELIB}") + MESSAGE(STATUS "Python3 development found: ${Python3_Development_FOUND}") +endif() if (PUB_SUB_LOCAL) message("Using a local source copy of cds-pubsub") @@ -89,4 +130,7 @@ CHECK_FUNCTION_EXISTS(fchdir HAVE_FCHDIR) add_compile_options(-g3) add_subdirectory(src) -add_subdirectory(test) \ No newline at end of file + +if( NOT DEFINED BUILD_ON_ROOT ) + add_subdirectory(test) +endif() \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7bd4078fcfa3667de4bc131366b04d1aa21b689a..de748fc4ee700371506a91b686596516220708c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,15 +3,21 @@ add_subdirectory(drv) add_subdirectory(args) add_subdirectory(epics) add_subdirectory(gds) -add_subdirectory(daqd) -add_subdirectory(dolphin_daemon) -#add_subdirectory(dv) -add_subdirectory(nds) + +if( NOT BUILD_ON_BOOT ) + add_subdirectory(daqd) + add_subdirectory(dolphin_daemon) + #add_subdirectory(dv) + add_subdirectory(nds) + add_subdirectory(run_number) + add_subdirectory(local_dc) + add_subdirectory(fe_stream_test) + add_subdirectory(pub_sub_stream) + add_subdirectory(rust) +endif() + add_subdirectory(simple_pv) -add_subdirectory(run_number) -add_subdirectory(local_dc) -add_subdirectory(fe_stream_test) -add_subdirectory(pub_sub_stream) + add_subdirectory(util) add_subdirectory(include) add_subdirectory(python) diff --git a/src/drv/CMakeLists.txt b/src/drv/CMakeLists.txt index 3cdf506e9093fb6ea6a73de33e7d522497d03804..a1cb97fdf493e42f8463ff77b7df008c0a8b9f56 100644 --- a/src/drv/CMakeLists.txt +++ b/src/drv/CMakeLists.txt @@ -2,7 +2,10 @@ add_subdirectory(mbuf/mbuf_probe) add_subdirectory(mbuf/userapace_test) add_subdirectory(gpstime/tests) add_subdirectory(gpstime/gps_module_utils) -add_subdirectory(python) + +if( NOT BUILD_ON_BOOT ) + add_subdirectory(python) +endif() add_library(shmem STATIC shmem.c) target_include_directories(shmem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../include)