From d7943cfa7d1fddfe6ed426f0bafa41e1ce4a6c74 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 20 Aug 2010 13:27:17 +0200 Subject: [PATCH] Fixed: #955 CMake does not search luabind --- code/ryzom/CMakeLists.txt | 1 + code/ryzom/CMakeModules/FindLuabind.cmake | 55 +++++++++++++++++++++++ code/ryzom/client/src/CMakeLists.txt | 5 ++- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 code/ryzom/CMakeModules/FindLuabind.cmake diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 9cf6558d6..aa4430116 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -82,6 +82,7 @@ IF(WITH_LUA51) ELSE(WITH_LUA51) FIND_PACKAGE(Lua50 REQUIRED) ENDIF(WITH_LUA51) +FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) FIND_PACKAGE(Libwww) FIND_PACKAGE(ZLIB) diff --git a/code/ryzom/CMakeModules/FindLuabind.cmake b/code/ryzom/CMakeModules/FindLuabind.cmake new file mode 100644 index 000000000..c3722deb7 --- /dev/null +++ b/code/ryzom/CMakeModules/FindLuabind.cmake @@ -0,0 +1,55 @@ +# - Locate Luabind library +# This module defines +# LUABIND_LIBRARY, the library to link against +# LUABIND_FOUND, if false, do not try to link to LUABIND +# LUABIND_INCLUDE_DIR, where to find headers. + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + # in cache already + SET(LUABIND_FIND_QUIETLY TRUE) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + + + + +FIND_PATH(LUABIND_INCLUDE_DIR + luabind.hpp + PATHS + $ENV{LUABIND_DIR}/include + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + PATH_SUFFIXES luabind +) + + +FIND_LIBRARY(LUABIND_LIBRARY + NAMES luabind libluabind luabind_d libluabind_d libluabindd + PATHS + $ENV{LUABIND_DIR}/lib + /usr/local/lib + /usr/lib + /usr/local/X11R6/lib + /usr/X11R6/lib + /sw/lib + /opt/local/lib + /opt/csw/lib + /opt/lib + /usr/freeware/lib64 +) + + +IF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + SET(LUABIND_FOUND "YES") + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARY}") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ELSE(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) + IF(NOT LUABIND_FIND_QUIETLY) + MESSAGE(STATUS "Warning: Unable to find Luabind!") + ENDIF(NOT LUABIND_FIND_QUIETLY) +ENDIF(LUABIND_LIBRARY AND LUABIND_INCLUDE_DIR) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 5728d34c0..73bc18ee5 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -66,6 +66,7 @@ INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} + ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) @@ -79,6 +80,7 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${NELGEORGES_LIBRARY} ${NEL3D_LIBRARY} ${LUA_LIBRARIES} + ${LUABIND_LIBRARY} ${CURL_LIBRARIES} ${NELSOUND_LIBRARY} ${NELSNDDRV_LIBRARY} @@ -86,8 +88,7 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${NELPACS_LIBRARY} ${LIBWWW_LIBRARY} ${SEVENZIP_LIBRARY} - luabind # TODO: find luabind and expat cleanly using a find script - expat) + expat) # TODO: find expat cleanly using a find script IF(NOT APPLE AND NOT WIN32) TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES})