]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix luajit/lua headers confusion 231/head
authorAndrew Lewis <nerf@judo.za.org>
Thu, 19 Mar 2015 12:34:17 +0000 (14:34 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 19 Mar 2015 12:34:17 +0000 (14:34 +0200)
CMakeLists.txt

index 8163671f21435ff96432f31ab4117386d927604a..ee144237673cbaaacac2926208a48eb160cdab33 100644 (file)
@@ -123,25 +123,44 @@ MACRO(FindLua _major _minor)
        MESSAGE(STATUS "Check for lua ${_major}.${_minor}")
        
        UNSET(LUA_INCLUDE_DIR CACHE)
-       FIND_PATH(LUA_INCLUDE_DIR lua.h
-         HINTS
-         $ENV{LUA_DIR}
-         PATH_SUFFIXES "include/luajit-2.0"
-                                       "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
-       )
+
+        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")
        
        # Check for luajit
        IF(ENABLE_LUAJIT MATCHES "ON")