Skip to content
Snippets Groups Projects
Commit a614129c authored by jcarpent's avatar jcarpent
Browse files

[CMake] Lua is now optional.

One has to set explicitely BUILD_WITH_LUA_SUPPORT ON to build the Lua parsers.
parent 5affb24b
Branches
Tags
No related merge requests found
......@@ -61,6 +61,7 @@ OPTION (BUILD_UTILS "Build the utils" OFF)
OPTION (INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
OPTION (BUILD_TESTS_WITH_HPP "Build geom tests and benchmarks with hpp to do comparisons" OFF)
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
OPTION (BUILD_WITH_LUA_SUPPORT "Build the lua parser" OFF)
OPTION (BUILD_WITH_COMMIT_VERSION "Build libraries by setting specific commit version" OFF)
IF (INITIALIZE_WITH_NAN)
......@@ -78,7 +79,6 @@ ENDMACRO(TAG_LIBRARY_VERSION)
ADD_REQUIRED_DEPENDENCY("eigen3 >= 3.0.5")
ADD_OPTIONAL_DEPENDENCY("metapod >= 1.0.7")
ADD_OPTIONAL_DEPENDENCY("urdfdom >= 0.2.0")
ADD_OPTIONAL_DEPENDENCY("lua5.2")
ADD_OPTIONAL_DEPENDENCY("hpp-fcl >= 0.4.2")
# Spetcial care of Eigen3 greater than 3.2.10
......@@ -103,18 +103,23 @@ ENDIF(URDFDOM_FOUND)
# Special care of lua which can be of versions 5.1 or 5.2
# Priority is set to lua5.2
IF(LUA5_2_FOUND)
SET(LUA5_FOUND TRUE)
SET(LUA5_PACKAGE "lua5.2")
ADD_DEFINITIONS(-DLUA_VERSION_GREATER_5_2)
PKG_CONFIG_APPEND_CFLAGS("-DLUA_VERSION_GREATER_5_2")
ELSEIF(LUA5_2_FOUND)
ADD_OPTIONAL_DEPENDENCY("lua5.1")
IF(LUA5_1_FOUND)
IF(BUILD_WITH_LUA_SUPPORT)
ADD_OPTIONAL_DEPENDENCY("lua5.2")
IF(LUA5_2_FOUND)
SET(LUA5_FOUND TRUE)
SET(LUA5_PACKAGE "lua5.1")
ENDIF(LUA5_1_FOUND)
ENDIF(LUA5_2_FOUND)
SET(LUA5_PACKAGE "lua5.2")
ADD_DEFINITIONS(-DLUA_VERSION_GREATER_5_2)
PKG_CONFIG_APPEND_CFLAGS("-DLUA_VERSION_GREATER_5_2")
ELSE(LUA5_2_FOUND)
ADD_OPTIONAL_DEPENDENCY("lua5.1")
IF(LUA5_1_FOUND)
SET(LUA5_FOUND TRUE)
SET(LUA5_PACKAGE "lua5.1")
ELSE(LUA5_1_FOUND)
MESSAGE(FATAL_ERROR "Cannot find a suitable version of Lua 5.1 or 5.2")
ENDIF(LUA5_1_FOUND)
ENDIF(LUA5_2_FOUND)
ENDIF(BUILD_WITH_LUA_SUPPORT)
SET(BOOST_REQUIERED_COMPONENTS filesystem system)
SET(BOOST_BUILD_COMPONENTS unit_test_framework)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment