]> 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 065e67f32181315829b2a77f83d742ecc0680338..639baa0fa67dbcdf3ec4d1899685da0fa8e77047 100644 (file)
@@ -181,22 +181,30 @@ 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(PCRE_LIB pcre "/usr/lib/" )
+find_library(PATH_PCRE_LIB pcre "/usr/lib/")
 
 if(PATH_PCRE_LIB)
-       string(REGEX REPLACE "libpcre.*[.]so$" "" PATHLIBPCRE "${PCRE_LIB}")
-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
+       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)
 
 #--------------------------------------------------------------------------------------------------