Commit 9b70a165 authored by Serrière Guillaume's avatar Serrière Guillaume

Attempt to fix Lua linking issue in fedora 21.

Signed-off-by: default avatarSerrière Guillaume <guillaume.serriere@inria.fr>
parent 51d8f5c7
...@@ -47,7 +47,22 @@ ELSEIF(UNIX) ...@@ -47,7 +47,22 @@ ELSEIF(UNIX)
SET(OV_EIGEN_FLAGS "-msse2") SET(OV_EIGEN_FLAGS "-msse2")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${OV_EIGEN_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${OV_EIGEN_FLAGS}")
# This ENV var is needed to locate our custom IT++ on Linux # This ENV var is needed to locate our custom IT++ on Linux
SET(ENV{PKG_CONFIG_PATH} "${OV_CUSTOM_DEPENDENCIES_PATH}/lib/pkgconfig") SET(ENV{PKG_CONFIG_PATH} "${OV_CUSTOM_DEPENDENCIES_PATH}/lib/pkgconfig")
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES i386|i586|i686)
set ( BIT_MODE "32")
else ()
set ( BIT_MODE "64")
endif ()
if(EXISTS "/etc/debian_version")
set (PLATFORM "Debian")
endif(EXISTS "/etc/debian_version")
if(EXISTS "/etc/fedora-release")
set (PLATFORM "Fedora")
endif(EXISTS "/etc/fedora-release")
ELSE(WIN32) ELSE(WIN32)
MESSAGE(WARNING "Warning: unknown platform") MESSAGE(WARNING "Warning: unknown platform")
ENDIF(WIN32) ENDIF(WIN32)
......
...@@ -4,30 +4,39 @@ ...@@ -4,30 +4,39 @@
# Adds include path # Adds include path
# --------------------------------- # ---------------------------------
IF(WIN32) IF(WIN32)
FIND_PATH(LUA_INCLUDE_DIR lua.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lua/include NO_DEFAULT_PATH) FIND_PATH(LUA_INCLUDE_DIRS lua.h PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/lua/include NO_DEFAULT_PATH)
IF(LUA_INCLUDE_DIRS)
SET(LUA_FOUND TRUE)
ENDIF(LUA_INCLUDE_DIRS)
ELSEIF(UNIX) ELSEIF(UNIX)
FIND_PACKAGE(Lua51 REQUIRED) INCLUDE("FindThirdPartyPkgConfig")
if(PLATFORM EQUAL "Fedora")
FIND_PACKAGE(Lua REQUIRED)
else ()
pkg_check_modules(LUA lua5.1)
endif()
ENDIF(WIN32) ENDIF(WIN32)
IF(LUA_INCLUDE_DIR) IF(LUA_FOUND)
MESSAGE(STATUS " Found Lua... in '${LUA_INCLUDE_DIR}'") MESSAGE(STATUS " Found Lua... in '${LUA_INCLUDE_DIRS}'")
IF(WIN32) IF(WIN32)
FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIR}/../lib NO_DEFAULT_PATH) FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIRS}/../lib NO_DEFAULT_PATH)
FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIR}/../lib) FIND_LIBRARY(LUA_LIBRARIES lua5.1 PATHS ${LUA_INCLUDE_DIRS}/../lib)
ENDIF(WIN32) ENDIF(WIN32)
IF(LUA_LIBRARIES) IF(LUA_LIBRARIES)
MESSAGE(STATUS " [ OK ] lib ${LUA_LIBRARIES}") MESSAGE(STATUS " [ OK ] lib ${LUA_LIBRARIES}")
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LUA_LIBRARIES}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LUA_LIBRARIES})
ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyLua) ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyLua)
ELSE(LUA_LIBRARIES) ELSE(LUA_LIBRARIES)
MESSAGE(STATUS " [FAILED] lib lua5.1") MESSAGE(STATUS " [FAILED] lib lua5.1")
ENDIF(LUA_LIBRARIES) ENDIF(LUA_LIBRARIES)
ELSE(LUA_INCLUDE_DIR) ELSE(LUA_FOUND)
MESSAGE(STATUS " FAILED to find Lua") MESSAGE(STATUS " FAILED to find Lua")
ENDIF(LUA_INCLUDE_DIR) ENDIF(LUA_FOUND)
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