FASTJET libs for linking
authoragrigora <alina.grigoras@cern.ch>
Tue, 4 Nov 2014 15:16:26 +0000 (16:16 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:52 +0000 (13:51 +0100)
cmake/CMakeALICE.cmake
cmake/FindFASTJET.cmake

index 561905c..5d5a398 100644 (file)
@@ -54,7 +54,8 @@ macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
 #    message(STATUS "LIBDEPS = ${LIBDEPS}")
 #    message(STATUS "LINKDEF = ${LINKDEF}")
 #    message(STATUS "ROOT_LIBMAP=${ROOT_LIBMAP}")
-    
+
+    set(LOCAL_DEPS)
     foreach(file ${LIBDEPS})
         get_filename_component(ext ${file} EXT)
         if(ext)
@@ -63,7 +64,7 @@ macro(generate_rootmap LIBNAME LIBDEPS LINKDEF)
             set(LOCAL_DEPS ${LOCAL_DEPS} lib${file}.so)
         endif()
     endforeach()
-    
+
 #    message(STATUS "Generating ROOT map for ${LIBNAME}")
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap
                        COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_LIBMAP}
index d3122d7..70e4c15 100644 (file)
 # - FASTJET_VERSION_MINOR
 # - FASTJET_VERSION_PATCH
 # - FASTJET_INCLUDE_DIR - fastjet headers location
+# - FASTJET_LIBS_DIR - fastjet libraries location
 # - FASTJET_DEFINITIONS - fastjet definition flags
 # - FASTJET_CXXFLAGS - fastjet compilation flags
-# - FASTJET_LIBS - fastjet libraries + linking flags
+# - FASTJET_LIBS - fastjet libraries - array
 
 set(FASTJET_FOUND FALSE)
 
@@ -61,13 +62,20 @@ if(FASTJET)
     endif(error)
 
     # Extracting libraries and linking options
-    execute_process(COMMAND ${FASTJET_CONFIG} --libs OUTPUT_VARIABLE FASTJET_LIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
+    execute_process(COMMAND ${FASTJET_CONFIG} --libs OUTPUT_VARIABLE FASTJET_CONFIGLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
     if(error)
         message(FATAL_ERROR "Error retrieving FastJet libs : ${error}")
     endif(error)
+    string(REGEX MATCHALL "[-][l]([^ ])+" FASTJET_CONFIGLIBS "${FASTJET_CONFIGLIBS}")
+
+    foreach(flib ${FASTJET_CONFIGLIBS})
+        string(REPLACE "-l" "" flib "${flib}")
+        set(FASTJET_LIBS ${FASTJET_LIBS} ${flib})
+    endforeach()
 
     set(FASTJET_FOUND TRUE)
     set(FASTJET_INCLUDE_DIR ${FASTJET}/include)
+    set(FASTJET_LIBS_DIR ${FASTJET}/lib)
     set(FASTJET_DEFINITIONS "-DHAVE_FASTJET")
     message(STATUS "FastJet ${FASTJET_VERSION_MAJOR}.${FASTJET_VERSION_MINOR}.${FASTJET_VERSION_PATCH} installation found: ${FASTJET}")
 else()