Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a verification on pcre.h
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 28 Oct 2010 15:01:50 +0000 (15:01 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 28 Oct 2010 15:01:50 +0000 (15:01 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8478 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/PrintArgs.cmake

index ad724e0..17c6769 100644 (file)
@@ -207,18 +207,24 @@ endif(HAVE_CGRAPH_LIB AND HAVE_CGRAPH_H)
 
 #--------------------------------------------------------------------------------------------------
 ### Initialize of pcre
-find_library(PATH_PCRE_LIB pcre "/usr/lib/")
+find_library(PATH_PCRE_LIB pcre)
+find_file(PATH_PCRE_H "pcre.h")
 set(HAVE_PCRE_LIB 0)
-if(PATH_PCRE_LIB)
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
        string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
-               string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
-               if(NOT operation)
+       string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+       string(REGEX MATCH "-L${PATHLIBPCRE} " operation "${CMAKE_C_FLAGS}")
+          if(NOT operation)
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${PATHLIBPCRE} ")
-               endif(NOT operation)
+          endif(NOT operation)
+          string(REGEX MATCH "-I${PATH_PCRE_H} " operation "${CMAKE_C_FLAGS}")
+          if(NOT operation)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${PATH_PCRE_H} ")
+          endif(NOT operation)    
        set(HAVE_PCRE_LIB 1)
 else(PATH_PCRE_LIB)
                message("You should install libpcre (please install the libpcre3-dev package or equivalent)")
-endif(PATH_PCRE_LIB)
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
 
 #--------------------------------------------------------------------------------------------------
 ### Initialize of CONTEXT THREADS
index 908f652..0ce6775 100644 (file)
@@ -141,6 +141,7 @@ if(enable_print_message)
        message("")
     message("LIBPCRE : ${PATH_PCRE_LIB}")
     message("PATH_LIBPCRE : ${PATHLIBPCRE}")
+    message("PATH_PCRE_H  : ${PATH_PCRE_H}")
        endif(HAVE_PCRE_LIB)
     message("")
     message("LIB_EXE : ${LIB_EXE}")