Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correctely search for pcre and pthread on windows.
authorunknown <pierre@.(none)>
Tue, 21 Feb 2012 15:36:11 +0000 (16:36 +0100)
committerunknown <pierre@.(none)>
Tue, 21 Feb 2012 15:38:17 +0000 (16:38 +0100)
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindPCRE.cmake
buildtools/Cmake/Modules/FindPcreWin.cmake [new file with mode: 0644]
buildtools/Cmake/simgrid.nsi.in
doc/HelloWorld/CMakeLists.txt
doc/HelloWorld/FindPCRE.cmake [deleted file]
doc/HelloWorld/FindPcreWin.cmake [new file with mode: 0644]

index e34c8d0..745fab8 100644 (file)
@@ -68,7 +68,11 @@ include(TestBigEndian)
 TEST_BIG_ENDIAN(BIGENDIAN)
 
 include(FindGraphviz)
-include(FindPCRE)
+if(WIN32)
+include(FindPcreWin)
+else(WIN32)
+include(FindPCRE)  
+endif(WIN32)
 
 set(HAVE_GTNETS 0)
 if(enable_gtnets)      
index 03db5e0..cd41fa9 100644 (file)
@@ -6,17 +6,35 @@ add_library(gras SHARED ${gras_sources})
 set_target_properties(gras     PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libgras_version}    OUTPUT_NAME "gras")\r
 set_target_properties(simgrid  PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" VERSION ${libsimgrid_version} OUTPUT_NAME "simgrid")\r
 \r
-set(GRAS_DEP "ws2_32 -lpthread")\r
-set(SIMGRID_DEP "ws2_32 -lpthread")\r
+# libpthreadGC2.dll\r
+if(ARCH_32_BITS)\r
+    find_library(PATH_PTHREAD_LIB \r
+       NAMES pthreadGC2.dll\r
+        HINTS\r
+        $ENV{PATH}\r
+        PATH_SUFFIXES bin/ c/bin\r
+        )\r
+else(ARCH_32_BITS)\r
+    find_library(PATH_PTHREAD_LIB \r
+       NAMES pthreadGC2-w64.dll\r
+        HINTS\r
+        $ENV{PATH}\r
+        PATH_SUFFIXES bin/ c/bin\r
+        )\r
+endif(ARCH_32_BITS)\r
+\r
+set(GRAS_DEP "ws2_32 ${PATH_PTHREAD_LIB}")\r
+set(SIMGRID_DEP "ws2_32 ${PATH_PCRE_LIB} ${PATH_PTHREAD_LIB}")\r
 \r
 if(ARCH_32_BITS)\r
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486")\r
 else(ARCH_32_BITS)\r
-        message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")\r
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")\r
+#        message(FATAL_ERROR "Sorry, Simgrid fails with full 64bits for now! Please contact us.")
 endif(ARCH_32_BITS)\r
 \r
 target_link_libraries(gras     ${GRAS_DEP})\r
-target_link_libraries(simgrid  ${SIMGRID_DEP} ${PATH_PCRE_LIB})\r
+target_link_libraries(simgrid  ${SIMGRID_DEP})\r
 \r
 find_path(PEXPORTS_PATH NAMES pexports.exe PATHS NO_DEFAULT_PATHS)\r
 message(STATUS "pexports: ${PEXPORTS_PATH}")\r
index 5eb24f8..51cd613 100644 (file)
@@ -10,16 +10,7 @@ find_library(PATH_PCRE_LIB
     /opt/local
     /opt/csw
     /sw
-    /usr)
-    
-string(REGEX MATCH ".dll.a" operation "${PATH_PCRE_LIB}")
-
-if(NOT operation)
-    if(WIN32)
-           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-DPCRE_STATIC ")
-    endif(WIN32)
-endif(NOT operation)
-
+    /usr)  
 
 find_path(PATH_PCRE_H "pcre.h"
     HINTS
@@ -48,27 +39,6 @@ else(PATH_PCRE_LIB)
 message(STATUS "Looking for lib pcre - not found")
 endif(PATH_PCRE_LIB)
 
-if(WIN32)
-    find_path(PATH_PCRE_LICENCE "LICENCE"
-        HINTS
-        $ENV{SIMGRID_PCRE_LIBRARY_PATH}
-        $ENV{LD_LIBRARY_PATH}
-        $ENV{PCRE_LIBRARY_PATH}
-        PATH_SUFFIXES GnuWin32
-        PATHS
-        /opt
-        /opt/local
-        /opt/csw
-        /sw
-        /usr)
-    message(STATUS "Looking for pcre licence")
-    if(PATH_PCRE_LICENCE)
-    message(STATUS "Looking for pcre licence - found")
-    else(PATH_PCRE_LICENCE)
-    message(STATUS "Looking for pcre licence - not found")
-    endif(PATH_PCRE_LICENCE)
-endif(WIN32)
-
 if(PATH_PCRE_LIB AND PATH_PCRE_H)
        string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
        string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
diff --git a/buildtools/Cmake/Modules/FindPcreWin.cmake b/buildtools/Cmake/Modules/FindPcreWin.cmake
new file mode 100644 (file)
index 0000000..f2e1ad3
--- /dev/null
@@ -0,0 +1,42 @@
+# LIB libpcre.dll
+find_library(PATH_PCRE_LIB 
+       NAMES pcre
+    HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+    $ENV{PCRE_LIBRARY_PATH}
+    PATH_SUFFIXES bin/ GnuWin32/bin
+    )
+
+find_path(PATH_PCRE_H "pcre.h"
+    HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+    $ENV{PCRE_LIBRARY_PATH}
+    PATH_SUFFIXES include/ GnuWin32/include
+    )
+    
+message(STATUS "Looking for pcre.h")
+if(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - found")
+else(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - not found")
+endif(PATH_PCRE_H)
+
+message(STATUS "Looking for lib pcre")
+if(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - found")
+else(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - not found")
+endif(PATH_PCRE_LIB)
+
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
+       string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+          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)    
+else(PATH_PCRE_LIB)
+          message(FATAL_ERROR "Please install the pcre package before using SimGrid.")
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
+
+mark_as_advanced(PATH_PCRE_H)
+mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
index 2c9bba6..0e36ce0 100644 (file)
@@ -193,7 +193,7 @@ Section "Examples" ExamplesSection
        file @CMAKE_HOME_DIRECTORY@\examples\msg\masterslave\deployment_masterslave_forwarder.xml\r
        file @CMAKE_HOME_DIRECTORY@\examples\msg\msg_platform.xml\r
        file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\CMakeLists.txt\r
-       file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\FindPCRE.cmake\r
+       file @CMAKE_HOME_DIRECTORY@\doc\HelloWorld\FindPcreWin.cmake\r
        \r
        # create shortcuts in the start menu programs directory\r
        CreateDirectory "$SMPROGRAMS\SimGrid @SIMGRID_VERSION_MAJOR@.@SIMGRID_VERSION_MINOR@.@SIMGRID_VERSION_PATCH@\Examples\"\r
@@ -207,9 +207,9 @@ Section "Pcre library" PCRESection
        setOutPath $INSTDIR\GnuWin32\r
        file /r "@PCRE_LIBRARY_PATH@\lib"\r
        file /r "@PCRE_LIBRARY_PATH@\include"\r
-       file /nonfatal /r "@PCRE_LIBRARY_PATH@\bin"\r
-       file /nonfatal /r "@PCRE_LIBRARY_PATH@\man"\r
-       file /nonfatal /r "@PCRE_LIBRARY_PATH@\share"\r
+       file /r "@PCRE_LIBRARY_PATH@\bin"\r
+       file /r "@PCRE_LIBRARY_PATH@\man"\r
+       file /r "@PCRE_LIBRARY_PATH@\share"\r
 SectionEnd\r
 \r
 Section "Java Bindings" JavaSection    \r
index a74538d..ac917df 100644 (file)
@@ -17,7 +17,7 @@ set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
 ###############################
 # Test the build dependencies #
 ###############################
-include(FindPCRE.cmake)
+include(FindPcreWin.cmake)
 message(STATUS "Looking for lib Simgrid")
 if("$ENV{SIMGRID_ROOT}" STREQUAL "")
     message(STATUS "Looking for lib Simgrid - Not found")
diff --git a/doc/HelloWorld/FindPCRE.cmake b/doc/HelloWorld/FindPCRE.cmake
deleted file mode 100644 (file)
index 858e0e2..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-### SET THE LIBRARY EXTENSION AND GCC VERSION
-if(APPLE) #MAC
-       set(LIB_EXE "dylib")
-else(APPLE)
-    if(WIN32) #WINDOWS
-        set(LIB_EXE "a")
-        set(BIN_EXE ".exe")
-    else(WIN32) #UNIX
-           set(LIB_EXE "so")
-    endif(WIN32)
-endif(APPLE)
-
-find_library(PATH_PCRE_LIB 
-       NAMES pcre
-    HINTS
-    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
-    $ENV{LD_LIBRARY_PATH}
-    $ENV{PCRE_LIBRARY_PATH}
-    PATH_SUFFIXES lib/ GnuWin32/lib
-    PATHS
-    /opt
-    /opt/local
-    /opt/csw
-    /sw
-    /usr)
-    
-string(REGEX MATCH ".dll.a" operation "${PATH_PCRE_LIB}")
-
-if(NOT operation)
-    if(WIN32)
-           set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-DPCRE_STATIC ")
-    endif(WIN32)
-endif(NOT operation)
-
-find_path(PATH_PCRE_H "pcre.h"
-    HINTS
-    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
-    $ENV{LD_LIBRARY_PATH}
-    $ENV{PCRE_LIBRARY_PATH}
-    PATH_SUFFIXES include/ GnuWin32/include
-    PATHS
-    /opt
-    /opt/local
-    /opt/csw
-    /sw
-    /usr)
-
-message(STATUS "Looking for pcre.h")
-if(PATH_PCRE_H)
-message(STATUS "Looking for pcre.h - found")
-else(PATH_PCRE_H)
-message(STATUS "Looking for pcre.h - not found")
-endif(PATH_PCRE_H)
-
-message(STATUS "Looking for lib pcre")
-if(PATH_PCRE_LIB)
-message(STATUS "Looking for lib pcre - found")
-else(PATH_PCRE_LIB)
-message(STATUS "Looking for lib pcre - not found")
-endif(PATH_PCRE_LIB)
-
-if(WIN32)
-    find_path(PATH_PCRE_LICENCE "LICENCE"
-        HINTS
-        $ENV{SIMGRID_PCRE_LIBRARY_PATH}
-        $ENV{LD_LIBRARY_PATH}
-        $ENV{PCRE_LIBRARY_PATH}
-        PATH_SUFFIXES GnuWin32
-        PATHS
-        /opt
-        /opt/local
-        /opt/csw
-        /sw
-        /usr)
-    message(STATUS "Looking for pcre licence")
-    if(PATH_PCRE_LICENCE)
-    message(STATUS "Looking for pcre licence - found")
-    else(PATH_PCRE_LICENCE)
-    message(STATUS "Looking for pcre licence - not found")
-    endif(PATH_PCRE_LICENCE)
-endif(WIN32)
-
-if(PATH_PCRE_LIB AND PATH_PCRE_H)
-    string(REGEX REPLACE "/libpcre.*[.]${LIB_EXE}$" "" PATHLIBPCRE "${PATH_PCRE_LIB}")
-    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)
-       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)       
-else(PATH_PCRE_LIB)
-    message(FATAL_ERROR "Please install the libpcre3-dev package or equivalent before using SimGrid.")
-endif(PATH_PCRE_LIB AND PATH_PCRE_H)
-    
-mark_as_advanced(PATH_PCRE_H)
-mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file
diff --git a/doc/HelloWorld/FindPcreWin.cmake b/doc/HelloWorld/FindPcreWin.cmake
new file mode 100644 (file)
index 0000000..f2e1ad3
--- /dev/null
@@ -0,0 +1,42 @@
+# LIB libpcre.dll
+find_library(PATH_PCRE_LIB 
+       NAMES pcre
+    HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+    $ENV{PCRE_LIBRARY_PATH}
+    PATH_SUFFIXES bin/ GnuWin32/bin
+    )
+
+find_path(PATH_PCRE_H "pcre.h"
+    HINTS
+    $ENV{SIMGRID_PCRE_LIBRARY_PATH}
+    $ENV{PCRE_LIBRARY_PATH}
+    PATH_SUFFIXES include/ GnuWin32/include
+    )
+    
+message(STATUS "Looking for pcre.h")
+if(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - found")
+else(PATH_PCRE_H)
+message(STATUS "Looking for pcre.h - not found")
+endif(PATH_PCRE_H)
+
+message(STATUS "Looking for lib pcre")
+if(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - found")
+else(PATH_PCRE_LIB)
+message(STATUS "Looking for lib pcre - not found")
+endif(PATH_PCRE_LIB)
+
+if(PATH_PCRE_LIB AND PATH_PCRE_H)
+       string(REGEX REPLACE "/pcre.h" "" PATH_PCRE_H "${PATH_PCRE_H}")
+          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)    
+else(PATH_PCRE_LIB)
+          message(FATAL_ERROR "Please install the pcre package before using SimGrid.")
+endif(PATH_PCRE_LIB AND PATH_PCRE_H)
+
+mark_as_advanced(PATH_PCRE_H)
+mark_as_advanced(PATH_PCRE_LIB)
\ No newline at end of file