aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2015-03-21 12:56:54 +0200
committerAndrew Lewis <nerf@judo.za.org>2015-03-21 13:06:51 +0200
commitbb92fec558eca09405d8895e8c15c4f91233ca5e (patch)
tree99b754f8a3c5c28dfa1382e8417877209b65d4d5 /CMakeLists.txt
parenta54fa94aa33a074072e9ff92edaa289e506a0653 (diff)
downloadrspamd-bb92fec558eca09405d8895e8c15c4f91233ca5e.tar.gz
rspamd-bb92fec558eca09405d8895e8c15c4f91233ca5e.zip
Rather use pkg-config to find luajit
Conflicts: CMakeLists.txt
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt129
1 files changed, 42 insertions, 87 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 467a80ac7..a026e7eb1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,86 +129,44 @@ MACRO(FindLua _major _minor)
UNSET(LUA_INCLUDE_DIR CACHE)
UNSET(LUA_LIBRARY CACHE)
- IF(ENABLE_LUAJIT MATCHES "ON")
- FIND_PATH(LUA_INCLUDE_DIR lua.h
- HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES "include/luajit-2.0"
- PATHS
- /usr/local
- /usr/pkg
- /usr
- ~/Library/Frameworks
- /Library/Frameworks
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
- )
- ELSE(ENABLE_LUAJIT MATCHES "ON")
- FIND_PATH(LUA_INCLUDE_DIR lua.h
- HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES "include/lua${_major}${_minor}"
- "include/lua${_major}${_minor}"
- "include/lua${_major}.${_minor}"
- "include/lua-${_major}.${_minor}"
- include/lua include
- PATHS
- /usr/local
- /usr/pkg
- /usr
- ~/Library/Frameworks
- /Library/Frameworks
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
- )
- ENDIF(ENABLE_LUAJIT MATCHES "ON")
+ FIND_PATH(LUA_INCLUDE_DIR lua.h
+ HINTS
+ $ENV{LUA_DIR}
+ PATH_SUFFIXES "include/lua${_major}${_minor}"
+ "include/lua${_major}.${_minor}"
+ "include/lua-${_major}.${_minor}"
+ include/lua include
+ PATHS
+ /usr/local
+ /usr/pkg
+ /usr
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
+ )
- # Check for luajit
- IF(ENABLE_LUAJIT MATCHES "ON")
- FIND_LIBRARY(LUA_LIBRARY NAMES
- "luajit${_major}${_minor}"
- "luajit${_major}.${_minor}"
- "luajit-${_major}.${_minor}"
- "luajit"
- HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw
- /opt/local
- /opt/csw
- /usr/pkg
- /opt
- )
- ELSE(ENABLE_LUAJIT MATCHES "ON")
- FIND_LIBRARY(LUA_LIBRARY
- NAMES lua
+ FIND_LIBRARY(LUA_LIBRARY
+ NAMES lua
"lua${_major}${_minor}"
"lua${_major}.${_minor}"
"lua-${_major}.${_minor}"
- HINTS
+ HINTS
$ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
- PATHS
- /usr/local
- /usr
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
- DOC "Lua library"
- )
- ENDIF(ENABLE_LUAJIT MATCHES "ON")
+ PATH_SUFFIXES lib64 lib
+ PATHS
+ /usr/local
+ /usr
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ DOC "Lua library"
+ )
IF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
SET(LUA_FOUND 1)
IF(NOT LUA_VERSION_MAJOR OR NOT LUA_VERSION_MINOR)
@@ -421,24 +379,21 @@ ENDIF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
# Now find libraries and headers
-# Find lua libraries
IF(ENABLE_LUAJIT MATCHES "ON")
- # For luajit we need to check merely lua 5.1 as lua 5.2 is incompatible
- FindLua(5 1)
-ELSE(ENABLE_LUAJIT MATCHES "ON")
+ ProcessPackage(LUAJIT luajit)
+ELSEIF(ENABLE_LUAJIT MATCHES "ON")
FindLua(5 2)
IF(NOT LUA_FOUND)
- FindLua(5 1)
+ FindLua(5 1)
+ ENDIF(NOT LUA_FOUND)
+ IF(NOT LUA_FOUND)
+ MESSAGE(FATAL_ERROR "Lua not found, lua support is required for working")
+ ELSE(NOT LUA_FOUND)
+ SET(WITH_LUA 1)
+ INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}")
ENDIF(NOT LUA_FOUND)
ENDIF(ENABLE_LUAJIT MATCHES "ON")
-IF(NOT LUA_FOUND)
- MESSAGE(FATAL_ERROR "Lua not found, lua support is required for working")
-ELSE(NOT LUA_FOUND)
- SET(WITH_LUA 1)
- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}")
-ENDIF(NOT LUA_FOUND)
-
#Check for openssl (required for dkim)
IF(OPENSSL_FOUND)
SET(HAVE_OPENSSL 1)