Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add Lib path correctly.
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index cfd2bab..77b1af5 100644 (file)
@@ -181,11 +181,14 @@ mark_as_advanced(HAVE_CGRAPH_H)
 if(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
        string(REGEX REPLACE "/libcgraph.*" "" lib_cgraph ${HAVE_CGRAPH_LIB})
        string(REPLACE "/cgraph.h" "" file_cgraph_h ${HAVE_CGRAPH_H})
-               
        string(REGEX MATCH "-I${file_cgraph_h} " operation "${CMAKE_C_FLAGS}")
        if(NOT operation)
                SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${file_cgraph_h} ")
        endif(NOT operation)
+       string(REGEX MATCH "-L${lib_cgraph} " operation "${CMAKE_C_FLAGS}")
+       if(NOT operation)
+               SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${lib_cgraph} ")
+       endif(NOT operation)
        
 endif(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
 
@@ -194,10 +197,11 @@ endif(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
 find_library(PCRE_LIB pcre "/usr/lib/" )
 
 if(PATH_PCRE_LIB)
-       message("LIBPCRE : ${PCRE_LIB}")
-       string(REGEX REPLACE "libpcre.*[.]so$" "" PATHLIBPCRE "${PCRE_LIB}")
-       message("PATH_LIBPCRE : ${PATHLIBPCRE}")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
+       string(REGEX REPLACE "/libpcre.*[.]so$" "" PATHLIBPCRE "${PCRE_LIB}")
+               string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
+               if(NOT operation)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
+               endif(NOT operation)
        set(HAVE_PCRE_LIB 1)
 endif(PATH_PCRE_LIB)