Commit 2a946aa2 authored by Artur Grunau's avatar Artur Grunau
Browse files

FindLua: only set LUA_FOUND if CAMPVIS_BUILD_LIB_LUA is ON

The FindLua CMake script would previously set LUA_FOUND if the directory
containing the source code of Lua existed without checking if it was
actually part of the build. This could lead to compilation errors if
CAMPVIS_BUILD_LIB_LUA was disabled.

Add an additional check to FindLua to only set LUA_FOUND if
CAMPVIS_BUILD_LIB_LUA is ON and the directory containing the source code
of Lua exists.

References #1
parent 7d4857ae
......@@ -5,16 +5,19 @@
# LUA_LIBRARY
IF(WIN32)
SET(LUA_DIR "${CampvisHome}/ext/lua" CACHE PATH "If Lua is not found, set this path")
# For now Lua needs to be built as part of CAMPVis on Windows
IF(CAMPVIS_BUILD_LIB_LUA)
SET(LUA_DIR "${CampvisHome}/ext/lua" CACHE PATH "If Lua is not found, set this path")
SET(LUA_INCLUDE_DIR "${LUA_DIR}/src" "${CMAKE_BINARY_DIR}/ext/lua")
SET(LUA_INCLUDE_DIR "${LUA_DIR}/src" "${CMAKE_BINARY_DIR}/ext/lua")
IF(LUA_INCLUDE_DIR)
SET(LUA_LIBRARY liblua)
SET(LUA_FOUND TRUE)
ELSE()
SET(LUA_FOUND FALSE)
ENDIF()
IF(LUA_INCLUDE_DIR)
SET(LUA_LIBRARY liblua)
SET(LUA_FOUND TRUE)
ELSE()
SET(LUA_FOUND FALSE)
ENDIF()
ENDIF(CAMPVIS_BUILD_LIB_LUA)
ELSE(WIN32)
# TODO: not tested
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment