]> AND Public Git Repository - simgrid.git/blobdiff - buildtools/Cmake/CompleteInFiles.cmake
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more explicit error message
[simgrid.git] / buildtools / Cmake / CompleteInFiles.cmake
index 88751cdd519c57455c153aa5a1de5725e52af419..639baa0fa67dbcdf3ec4d1899685da0fa8e77047 100644 (file)
@@ -181,14 +181,32 @@ 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)
 
+#--------------------------------------------------------------------------------------------------
+### Initialize of pcre
+find_library(PATH_PCRE_LIB pcre "/usr/lib/")
+
+if(PATH_PCRE_LIB)
+       string(REGEX REPLACE "/libpcre.*[.]so$" "" PATHLIBPCRE "${PATH_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)
+else(PATH_PCRE_LIB)
+               message(FATAL_ERROR "You must have libpcre installed (please install the libpcre3-dev package or equivalent)")
+endif(PATH_PCRE_LIB)
+
 #--------------------------------------------------------------------------------------------------
 ### Initialize of CONTEXT THREADS