From e59fff97286551769f87de8fb9e9f99a7a7119e2 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Thu, 6 Aug 2015 13:59:25 +0200 Subject: [PATCH] Add und use FindDDS.cmake --- CMakeLists.txt | 1 + cmake/modules/FindDDS.cmake | 38 ++++++++++++++++++++++ devices/aliceHLTwrapper/CMakeLists.txt | 22 ++----------- devices/flp2epn-distributed/CMakeLists.txt | 32 +++--------------- 4 files changed, 47 insertions(+), 46 deletions(-) create mode 100644 cmake/modules/FindDDS.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c8b388a8cf899..ef792779ba83c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ endif(NOT ALICEO2_MODULAR_BUILD) find_package(AliRoot) find_package(FairRoot) +find_package(DDS) # Load some basic macros which are needed later on include(FairMacros) diff --git a/cmake/modules/FindDDS.cmake b/cmake/modules/FindDDS.cmake new file mode 100644 index 0000000000000..82a1f1c5b0868 --- /dev/null +++ b/cmake/modules/FindDDS.cmake @@ -0,0 +1,38 @@ +# ************************************************************************** +# * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. * +# * * +# * Author: The ALICE Off-line Project. * +# * Contributors are mentioned in the code where appropriate. * +# * * +# * Permission to use, copy, modify and distribute this software and its * +# * documentation strictly for non-commercial purposes is hereby granted * +# * without fee, provided that the above copyright notice appears in all * +# * copies and that both the copyright notice and this permission notice * +# * appear in the supporting documentation. The authors make no claims * +# * about the suitability of this software for any purpose. It is * +# * provided "as is" without express or implied warranty. * +# ************************************************************************** + +if(DDS_PATH) + if(EXISTS ${DDS_PATH}/lib AND EXISTS ${DDS_PATH}/include) + set(DDS_FOUND TRUE) + message(STATUS "DDS found at ${DDS_PATH}") + else() + set(DDS_FOUND FALSE) + message(STATUS "DDS not found") + endif() +else(DDS_PATH) + if(EXISTS ${SIMPATH}/DDS/lib AND EXISTS ${SIMPATH}/DDS/include) + set(DDS_PATH ${SIMPATH}/DDS) + message(STATUS "DDS found at ${DDS_PATH}") + else() + set(DDS_FOUND FALSE) + message(STATUS "DDS not found") + endif() +endif(DDS_PATH) + +if(DDS_FOUND) + add_definitions(-DENABLE_DDS) + set(DDS_INCLUDE_DIR ${DDS_PATH}/include) + set(DDS_LIBRARY_DIR ${DDS_PATH}/lib) +endif(DDS_FOUND) diff --git a/devices/aliceHLTwrapper/CMakeLists.txt b/devices/aliceHLTwrapper/CMakeLists.txt index c67bcc14ad833..c36f964a132a1 100644 --- a/devices/aliceHLTwrapper/CMakeLists.txt +++ b/devices/aliceHLTwrapper/CMakeLists.txt @@ -8,19 +8,9 @@ set(SYSTEM_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR} ${FAIRROOT_INCLUDE_DIR} ${AlFa_DIR}/include + ${DDS_INCLUDE_DIR} ) -set(DDS_LOCATION $ENV{DDS_LOCATION}) - -if(DDS_LOCATION) - add_definitions(-DENABLE_DDS) - - set(SYSTEM_INCLUDE_DIRECTORIES - ${SYSTEM_INCLUDE_DIRECTORIES} - $ENV{DDS_LOCATION}/include - ) -endif() - include_directories(${INCLUDE_DIRECTORIES}) include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) # set(CXXOPT "-O0 -g -ggdb") @@ -32,15 +22,9 @@ set(LINK_DIRECTORIES ${FAIRROOT_LIBRARY_DIR} ${Boost_LIBRARY_DIRS} ${AlFa_DIR}/lib + ${DDS_LIBRARY_DIR} ) -if(DDS_LOCATION) - set(LINK_DIRECTORIES - ${LINK_DIRECTORIES} - $ENV{DDS_LOCATION}/lib - ) -endif() - link_directories(${LINK_DIRECTORIES}) set(SRCS @@ -52,7 +36,7 @@ set(SRCS EventSampler.cxx ) -if(DDS_LOCATION) +if(DDS_FOUND) set(DEPENDENCIES ${DEPENDENCIES} dds-key-value-lib diff --git a/devices/flp2epn-distributed/CMakeLists.txt b/devices/flp2epn-distributed/CMakeLists.txt index 6a5a9f169089e..314fcfe3b02db 100644 --- a/devices/flp2epn-distributed/CMakeLists.txt +++ b/devices/flp2epn-distributed/CMakeLists.txt @@ -7,25 +7,9 @@ set(SYSTEM_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR} ${FAIRROOT_INCLUDE_DIR} ${AlFa_DIR}/include + ${DDS_INCLUDE_DIR} ) -set(DDS_LOCATION $ENV{DDS_LOCATION}) - -if(DDS_LOCATION) - message(STATUS "DDS found at ${DDS_LOCATION}") -else() - message(STATUS "DDS not found") -endif() - -if(DDS_LOCATION) - add_definitions(-DENABLE_DDS) - - set(SYSTEM_INCLUDE_DIRECTORIES - ${SYSTEM_INCLUDE_DIRECTORIES} - $ENV{DDS_LOCATION}/include - ) -endif() - include_directories(${INCLUDE_DIRECTORIES}) include_directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) @@ -37,15 +21,9 @@ set(LINK_DIRECTORIES ${Boost_LIBRARY_DIRS} ${FAIRROOT_LIBRARY_DIR} ${AlFa_DIR}/lib + ${DDS_LIBRARY_DIR} ) -if(DDS_LOCATION) - set(LINK_DIRECTORIES - ${LINK_DIRECTORIES} - $ENV{DDS_LOCATION}/lib - ) -endif() - link_directories(${LINK_DIRECTORIES}) set(SRCS @@ -60,7 +38,7 @@ set(DEPENDENCIES boost_date_time boost_thread boost_timer boost_system boost_program_options FairMQ ) -if(DDS_LOCATION) +if(DDS_FOUND) set(DEPENDENCIES ${DEPENDENCIES} dds-key-value-lib @@ -78,7 +56,7 @@ Set(Exe_Names epnReceiver ) -if(DDS_LOCATION) +if(DDS_FOUND) set(Exe_Names ${Exe_Names} flpSyncSampler_dds @@ -93,7 +71,7 @@ set(Exe_Source run/runEPNReceiver.cxx ) -if(DDS_LOCATION) +if(DDS_FOUND) set(Exe_Source ${Exe_Source} runO2Prototype/runFLPSyncSampler.cxx