]> source.dussan.org Git - rspamd.git/commitdiff
Another try to fixup the mess.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 May 2015 13:53:48 +0000 (14:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 11 May 2015 13:53:48 +0000 (14:53 +0100)
CMakeLists.txt

index 80df09ba8ceb828cc422e2c8aea469837e5ff433..cb49c8d2b549aed629e056f28179eceb604fb629 100644 (file)
@@ -205,10 +205,11 @@ MACRO(ProcessPackage var _name0)
                ENDIF(ENABLE_STATIC MATCHES "ON")
                FOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS})
                    INCLUDE_DIRECTORIES("${_arg}")
-                   SET(${var}_INCLUDE_DIR "${_arg}")
+                   SET(${var}_INCLUDE "${_arg}")
                ENDFOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS})
                FOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS})
                    LINK_DIRECTORIES("${_arg}")
+                   SET(${var}_LIBRARY "${_arg}")
                ENDFOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS})
                # Handle other CFLAGS and LDFLAGS
                FOREACH(_arg ${${_XPREFIX}_CFLAGS_OTHER})
@@ -240,6 +241,8 @@ MACRO(ProcessPackage var _name0)
                        GET_FILENAME_COMPONENT(_lib_path "${_lib}" PATH)
                        INCLUDE_DIRECTORIES("${_incl}")
                        LINK_DIRECTORIES("${_lib_path}")
+                       SET(${var}_INCLUDE "${_incl}")
+                       SET(${var}_LIBRARY "${_lib_path}")
                        MESSAGE(STATUS "Found ${_name0} ${ARGN} in '${_lib_path}' (library) and '${_incl}' (include).")
                ENDIF(${var}_FOUND)
        ELSE(NOT RSPAMD_SEARCH_PATH)
@@ -259,6 +262,8 @@ MACRO(ProcessPackage var _name0)
                                INCLUDE_DIRECTORIES("${_incl}")
                                LINK_DIRECTORIES("${_lib_path}")
                                MESSAGE(STATUS "Found ${_name0} ${ARGN} in '${_lib_path}' (library) and '${_incl}' (include).")
+                               SET(${var}_INCLUDE "${_incl}")
+                               SET(${var}_LIBRARY "${_lib_path}")
                        ENDIF(_incl)
                ENDIF(_lib)
                
@@ -273,10 +278,11 @@ MACRO(ProcessPackage var _name0)
                        ENDIF(ENABLE_STATIC MATCHES "ON")
                        FOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS})
                            INCLUDE_DIRECTORIES("${_arg}")
-                           SET(${var}_INCLUDE_DIR "${_arg}")
+                           SET(${var}_INCLUDE "${_arg}")
                        ENDFOREACH(_arg ${${_XPREFIX}_INCLUDE_DIRS})
                        FOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS})
                            LINK_DIRECTORIES("${_arg}")
+                           SET(${var}_LIBRARY "${_arg}")
                        ENDFOREACH(_arg ${${_XPREFIX}_LIBRARY_DIRS})
                        # Handle other CFLAGS and LDFLAGS
                        FOREACH(_arg ${${_XPREFIX}_CFLAGS_OTHER})
@@ -378,7 +384,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     # Workaround with architecture specific includes
     IF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/") 
        INCLUDE_DIRECTORIES("/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
-       SET(CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
+       LIST(APPEND CMAKE_REQUIRED_INCLUDES "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
     ENDIF(IS_DIRECTORY "/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu/")
     
        LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt)
@@ -482,8 +488,8 @@ ProcessPackage(SQLITE sqlite3>=3.6.0)
 IF(GMIME2_VERSION VERSION_GREATER "2.4.0")
     SET(GMIME24 1)
 ENDIF(GMIME2_VERSION VERSION_GREATER "2.4.0")
-LIST(APPEND CMAKE_REQUIRED_INCLUDES "${PCRE_INCLUDE_DIR}")
-
+LIST(APPEND CMAKE_REQUIRED_INCLUDES "${PCRE_INCLUDE}")
+SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};-L${PCRE_LIBRARY};-lpcre")
 # Libhiredis pc file is so special
 FIND_PATH(LIBHIREDIS_INCLUDE hiredis.h 
                HINTS "${RSPAMD_SEARCH_PATH}"
@@ -695,17 +701,6 @@ CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
 CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
 CHECK_INCLUDE_FILES(cpuid.h HAVE_CPUID_H)
 
-# Some dependencies
-IF(HAVE_SYS_WAIT_H)
-       LIST(APPEND CMAKE_REQUIRED_INCLUDES sys/wait.h)
-ENDIF(HAVE_SYS_WAIT_H)
-IF(HAVE_TIME_H)
-       LIST(APPEND CMAKE_REQUIRED_INCLUDES time.h)
-ENDIF(HAVE_TIME_H)
-IF(HAVE_SYS_TIME_H)
-       LIST(APPEND CMAKE_REQUIRED_INCLUDES sys/time.h)
-ENDIF(HAVE_SYS_TIME_H)
-
 # Check platform API
 CHECK_FUNCTION_EXISTS(setproctitle HAVE_SETPROCTITLE)
 CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE)
@@ -824,14 +819,12 @@ int main (void)
 }
 ")
 
-SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES} -lpcre")
-CHECK_C_SOURCE_COMPILES("${_PCRE_FAST_TEST}" _PCRE_JIT_FAST)
-IF(_PCRE_JIT_FAST)
-       SET(HAVE_PCRE_JIT_FAST 1)
+CHECK_C_SOURCE_COMPILES("${_PCRE_FAST_TEST}" HAVE_PCRE_JIT_FAST)
+IF(HAVE_PCRE_JIT_FAST)
        MESSAGE(STATUS "pcre_jit_exec is supported")
-ELSE(_PCRE_JIT_FAST)
+ELSE(HAVE_PCRE_JIT_FAST)
        MESSAGE(STATUS "pcre_jit_exec is -NOT- supported")
-ENDIF(_PCRE_JIT_FAST)
+ENDIF(HAVE_PCRE_JIT_FAST)
 
 FILE(WRITE ${CMAKE_BINARY_DIR}/pthread_setpshared.c "
 #include <pthread.h>