From 59571b566d2be5439d64244066874b9490844596 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Mon, 19 Mar 2018 21:04:33 +0100 Subject: [PATCH] If libspcm is not found skip compiling drivers dependent on it. --- machines/CMakeLists.txt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/machines/CMakeLists.txt b/machines/CMakeLists.txt index 5fc1151..73c8a65 100644 --- a/machines/CMakeLists.txt +++ b/machines/CMakeLists.txt @@ -56,14 +56,19 @@ add_executable(fc1neu_backend fc1neu_backend.cpp hardware.cpp) target_link_libraries( fc1neu_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 ) # spcm linux driver needs to be installed (see http://spectrum-instrumentation.com/de/downloads/drivers) -include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include) -add_executable(fc1_vierkanal_backend fc1_vierkanal_backend.cpp hardware.cpp) -target_link_libraries( fc1_vierkanal_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 ) +find_library(SPCM_LIB spcm) +if (NOT SPCM_LIB) + message(WARNING "spcm not found, install library (see http://spectrum-instrumentation.com/de/downloads/drivers)") +else() + include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include) + add_executable(fc1_vierkanal_backend fc1_vierkanal_backend.cpp hardware.cpp) + target_link_libraries( fc1_vierkanal_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 ) + + include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include) + add_executable(fc1_backend fc1_backend.cpp hardware.cpp) + target_link_libraries( fc1_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 ) +endif() -# spcm linux driver needs to be installed (see http://spectrum-instrumentation.com/de/downloads/drivers) -include_directories(${CMAKE_SOURCE_DIR}/drivers/Spectrum-M2i40xxSeries/include) -add_executable(fc1_backend fc1_backend.cpp hardware.cpp) -target_link_libraries( fc1_backend pthread ${XERCES_LIBRARIES} core spcm_linux Spectrum-M2i40xxSeries ${PB24} PTS DAC20 ) add_executable(fc2_backend fc2_backend.cpp hardware.cpp) target_link_libraries( fc2_backend pthread ${XERCES_LIBRARIES} core Spectrum_MI40xxSeries ${PB24} PTS DAC20 )