From 7c6c093d7f339df66cf2b3237b3bd596a01ad92d Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 19 Mar 2015 14:34:17 +0200 Subject: [PATCH] Fix luajit/lua headers confusion --- CMakeLists.txt | 57 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8163671f2..ee1442376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") -- 2.39.5