From db448fee42033e87683696f38dc17a6d03e4e414 Mon Sep 17 00:00:00 2001 From: agrigora Date: Thu, 5 Feb 2015 16:11:08 +0100 Subject: [PATCH] CMake: Using FindDIM to set include path and linking library --- MONITOR/MONITOR/CMakeLists.txt | 9 ++++----- MONITOR/MONITORzmq/CMakeLists.txt | 9 ++++----- MONITOR/alionlinereco/CMakeLists.txt | 4 ---- MONITOR/alistoragemanager/CMakeLists.txt | 4 ---- MONITOR/alitestproc/CMakeLists.txt | 4 ---- MONITOR/deroot/CMakeLists.txt | 5 ----- MONITOR/monitorCheck/CMakeLists.txt | 4 ---- MONITOR/monitorGDC/CMakeLists.txt | 4 ---- SHUTTLE/CMakeLists.txt | 7 +++---- cmake/FindDIM.cmake | 4 ++-- 10 files changed, 13 insertions(+), 41 deletions(-) diff --git a/MONITOR/MONITOR/CMakeLists.txt b/MONITOR/MONITOR/CMakeLists.txt index f63fdec0f96..ab7342cbfca 100644 --- a/MONITOR/MONITOR/CMakeLists.txt +++ b/MONITOR/MONITOR/CMakeLists.txt @@ -35,12 +35,11 @@ set(SRCS AliTestChildProc.cxx ) -if(DIMDIR AND ODIR) +if(DIM_FOUND) set(SRCS ${SRCS} SORNotifier.cxx ) - include_directories(${DIMDIR}/dim) - link_directories(${DIMDIR}/${ODIR}) + include_directories(${DIM_INCLUDE_DIR}) add_definitions(-DALI_DIM) endif() @@ -55,8 +54,8 @@ generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}") # Generate the ROOT map # Dependecies set(LIBDEPS STEERBase Core Gpad Graf Gui Hist RIO Thread) -if(DIMDIR AND ODIR) - set(LIBDEPS ${LIBDEPS} dim) +if(DIM_FOUND) + set(LIBDEPS ${LIBDEPS} ${DIM_LIBRARIES}) endif() generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") diff --git a/MONITOR/MONITORzmq/CMakeLists.txt b/MONITOR/MONITORzmq/CMakeLists.txt index 7c3cd1b7577..12a066c1fff 100644 --- a/MONITOR/MONITORzmq/CMakeLists.txt +++ b/MONITOR/MONITORzmq/CMakeLists.txt @@ -47,12 +47,11 @@ set(SRCS AliStorageServerThread.cxx ) -if(DIMDIR AND ODIR) +if(DIM_FOUND) set(SRCS ${SRCS} ${AliRoot_SOURCE_DIR}/MONITOR/MONITOR/SORNotifier.cxx ) - include_directories(${DIMDIR}/dim) - link_directories(${DIMDIR}/${ODIR}) + include_directories(${DIM_INCLUDE_DIR}) add_definitions(-DALI_DIM) endif() @@ -72,8 +71,8 @@ generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}" "${M # Generate the ROOT map # Dependecies set(LIBDEPS STEERBase STEER ESD CDB MONITOR ${ZEROMQ_LIBRARIES}) -if(DIMDIR AND ODIR) - set(LIBDEPS ${LIBDEPS} dim) +if(DIM_FOUND) + set(LIBDEPS ${LIBDEPS} ${DIM_LIBRARIES}) endif() generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") diff --git a/MONITOR/alionlinereco/CMakeLists.txt b/MONITOR/alionlinereco/CMakeLists.txt index a43a0637d8f..b7b48b047b0 100644 --- a/MONITOR/alionlinereco/CMakeLists.txt +++ b/MONITOR/alionlinereco/CMakeLists.txt @@ -27,10 +27,6 @@ include_directories(${AliRoot_SOURCE_DIR}/MONITOR/MONITOR add_definitions(-DZMQ) -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # alistorage executable add_executable(alionlinereco onlinereco.cxx) target_link_libraries(alionlinereco MONITOR MONITORzmq STEERBase STEER) diff --git a/MONITOR/alistoragemanager/CMakeLists.txt b/MONITOR/alistoragemanager/CMakeLists.txt index 1ee91f6cb0f..efd46779bde 100644 --- a/MONITOR/alistoragemanager/CMakeLists.txt +++ b/MONITOR/alistoragemanager/CMakeLists.txt @@ -26,10 +26,6 @@ include_directories(${AliRoot_SOURCE_DIR}/MONITOR/MONITOR add_definitions(-DZMQ) -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # alistorage executable add_executable(alistorage alistorage.cxx) target_link_libraries(alistorage MONITOR MONITORzmq) diff --git a/MONITOR/alitestproc/CMakeLists.txt b/MONITOR/alitestproc/CMakeLists.txt index c1af75e2a63..62e8baafec8 100644 --- a/MONITOR/alitestproc/CMakeLists.txt +++ b/MONITOR/alitestproc/CMakeLists.txt @@ -31,10 +31,6 @@ set(SRCS # Headers from sources string(REPLACE ".cxx" ".h" HDRS "${SRCS}") -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # Add an executable to the project using the specified source files add_executable(${MODULE} ${SRCS}) target_link_libraries(${MODULE} MONITOR Rint) diff --git a/MONITOR/deroot/CMakeLists.txt b/MONITOR/deroot/CMakeLists.txt index 2918116be9d..dd68f39bccf 100644 --- a/MONITOR/deroot/CMakeLists.txt +++ b/MONITOR/deroot/CMakeLists.txt @@ -33,15 +33,10 @@ set(SRCS # Headers from sources string(REPLACE ".cxx" ".h" HDRS "${SRCS}") -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # Add an executable to the project using the specified source files add_executable(${MODULE} ${SRCS}) target_link_libraries(${MODULE} STEERBase RAWDatabase) - if(ZEROMQ_FOUND) target_link_libraries(${MODULE} MONITORzmq) add_definitions(-DZMQ) diff --git a/MONITOR/monitorCheck/CMakeLists.txt b/MONITOR/monitorCheck/CMakeLists.txt index 301f4b77d39..5ecaa7a0eeb 100644 --- a/MONITOR/monitorCheck/CMakeLists.txt +++ b/MONITOR/monitorCheck/CMakeLists.txt @@ -31,10 +31,6 @@ set(SRCS # Headers from sources string(REPLACE ".cxx" ".h" HDRS "${SRCS}") -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # Add an executable to the project using the specified source files add_executable(${MODULE} ${SRCS}) target_link_libraries(${MODULE} RAWDatarec Core) diff --git a/MONITOR/monitorGDC/CMakeLists.txt b/MONITOR/monitorGDC/CMakeLists.txt index 3ded823d73f..652bd05f335 100644 --- a/MONITOR/monitorGDC/CMakeLists.txt +++ b/MONITOR/monitorGDC/CMakeLists.txt @@ -41,10 +41,6 @@ set(SRCS # Headers from sources string(REPLACE ".cxx" ".h" HDRS "${SRCS}") -if(DIMDIR AND ODIR) - link_directories(${DIMDIR}/${ODIR}) -endif() - # Add an executable to the project using the specified source files add_executable(${MODULE} ${SRCS}) diff --git a/SHUTTLE/CMakeLists.txt b/SHUTTLE/CMakeLists.txt index 5973380f661..779f35c6ed4 100644 --- a/SHUTTLE/CMakeLists.txt +++ b/SHUTTLE/CMakeLists.txt @@ -25,8 +25,7 @@ include_directories(${AliRoot_SOURCE_DIR}/STEER/CDB ) # DIM include folder and libraries folder -include_directories(${DIMDIR}/dim) -link_directories(${DIMDIR}/${ODIR}) +include_directories(${DIM_INCLUDE_DIR}) # Sources in alphabetical order set(SRCS @@ -52,8 +51,8 @@ generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}") # Generate the ROOT map # Dependecies set(LIBDEPS STEERBase CDB Core Eve Gui Hist Minuit2 Minuit Net ProofPlayer RIO Spectrum Thread TMVA) -if(DIMDIR AND ODIR) - set(LIBDEPS ${LIBDEPS} dim) +if(DIM_FOUND) + set(LIBDEPS ${LIBDEPS} ${DIM_LIBRARIES}) endif() generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h") diff --git a/cmake/FindDIM.cmake b/cmake/FindDIM.cmake index 0b3b7f70c0b..e4ecc8c4040 100644 --- a/cmake/FindDIM.cmake +++ b/cmake/FindDIM.cmake @@ -10,7 +10,7 @@ if(DIMDIR AND ODIR) find_library(DIM_LIBRARIES NAMES dim PATHS ${DIMDIR}/${ODIR} NO_DEFAULT_PATH DOC "Path to DIM library") if(NOT DIM_LIBRARIES) - message(FATAL "DIM library not found inside ${DIMDIR}/${ODIR}") + message(FATAL_ERROR "DIM library not found inside ${DIMDIR}/${ODIR}") else() message(STATUS "Found DIM library: ${DIM_LIBRARIES}") endif() @@ -19,7 +19,7 @@ if(DIMDIR AND ODIR) find_path(DIM_INCLUDE_DIR NAMES dim.h PATHS ${DIMDIR}/dim NO_DEFAULT_PATH DOC "Path to DIM header folders.") if(NOT DIM_INCLUDE_DIR) - message(FATAL "DIM header not found inside ${DIM}/dim folder") + message(FATAL_ERROR "DIM header not found inside ${DIM}/dim folder") else() message(STATUS "Found DIM header folder: ${DIM_INCLUDE_DIR}") endif() -- 2.39.3