properly handle zeromq lib in a custom location
authormkrzewic <mikolaj.krzewicki@cern.ch>
Tue, 20 Jan 2015 19:47:19 +0000 (20:47 +0100)
committerdberzano <dario.berzano@cern.ch>
Thu, 22 Jan 2015 09:38:29 +0000 (10:38 +0100)
if zeromq if installed outside of the standard locations
use -DZEROMQ=/location/zeromq

MONITOR/MONITORzmq/CMakeLists.txt
cmake/FindZeroMQ.cmake

index f866bb4..da2964b 100644 (file)
@@ -28,6 +28,7 @@ include_directories(${AliRoot_SOURCE_DIR}/MONITOR/MONITOR
                     ${AliRoot_SOURCE_DIR}/STEER/ESD
                     ${AliRoot_SOURCE_DIR}/STEER/STEER
                     ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                    ${ZEROMQ_INCLUDE_DIR}
                    )
 
 # Sources in alphabetical order
@@ -70,7 +71,7 @@ generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}
 
 # Add a library to the project using the specified source files
 add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
-target_link_libraries(${MODULE} STEERBase STEER ESD CDB MONITOR zmq)
+target_link_libraries(${MODULE} STEERBase STEER ESD CDB MONITOR ${ZEROMQ_LIBRARIES})
 if(DIMDIR AND ODIR)
     target_link_libraries(${MODULE} dim)
 endif()
@@ -88,4 +89,4 @@ install(TARGETS ${MODULE}
         ARCHIVE DESTINATION lib
         LIBRARY DESTINATION lib)
 
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
index 275b759..71fb124 100644 (file)
@@ -27,18 +27,18 @@ set(ZEROMQ_FOUND FALSE)
 if(ZEROMQ)
     # ZeroMQ is installed in a custom place
     find_library(ZEROMQ_LIBRARIES NAMES zmq
-                PATH ${ZEROMQ}/lib
+                PATHS ${ZEROMQ}/lib
                 NO_DEFAULT_PATH
                 DOC "Path to libzmq)"
             )
 
     find_library(ZEROMQ_LIBRARIES_STATIC NAMES libzmq.a
-                PATH ${ZEROMQ}/lib
+                PATHS ${ZEROMQ}/lib
                 NO_DEFAULT_PATH
                 DOC "Path to libzmq)"
             )
             
-    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.hh zmq_utils.h}
+    find_path(ZEROMQ_INCLUDE_DIR NAMES zmq.h zmq_utils.h zmq.hpp}
                 PATHS ${ZEROMQ}/include
                 NO_DEFAULT_PATH
                 DOC "Path to ZeroMQ include header files."
@@ -71,7 +71,7 @@ if(NOT ZEROMQ_LIBRARIES_STATIC AND NOT ZEROMQ_DISABLED)
 endif()
 
 if(NOT ZEROMQ_INCLUDE_DIR AND NOT ZEROMQ_DISABLED)
-    message(STATUS "ZeroMQ headers not found. Please install development package. Disabling ZeroMQ support")
+    message(STATUS "ZeroMQ headers not found. Please install development package + cppzmq interface. Disabling ZeroMQ support")
     set(ZEROMQ_DISABLED TRUE)
 endif()