Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

New FindLua Module for CMake and dist.cmake. #49

Closed
drahosp opened this issue Aug 10, 2011 · 15 comments
Closed

New FindLua Module for CMake and dist.cmake. #49

drahosp opened this issue Aug 10, 2011 · 15 comments
Assignees

Comments

@drahosp
Copy link
Member

drahosp commented Aug 10, 2011

The FindLuaMoudle distributed with CMake is causing issues with multiple Lua installations. It tries to search for liblua51 first and only then falls back to finding liblua. This causes issues when Lua is installed in the host OS. As a side effect LuaDist then links against the wrong library without the relative path support. While in certain cases this behavior is desirable it is currently unsupported in the executable wrapper from dist.info.

A solution for this issue is to move Lua related macros to a custom FindLua module and keep dist.cmake only to set up install paths and test macros. The lua executable wrapper will be modified to try relative paths first and then fall back to static install paths in case unmodified lua was used.

Related issues: #48, #46, #44, #42

@ghost ghost assigned drahosp Aug 10, 2011
@drahosp
Copy link
Member Author

drahosp commented Sep 18, 2011

Also adding support for static lua modules, this does not harm the automated builds and will make it easier to make static builds of lua modules without build modifications.

@davidm
Copy link
Member

davidm commented Nov 22, 2011

Bootstrap still failing on Ubuntu:

-- Found Lua51: /usr/lib/i386-linux-gnu/liblua5.1.so;/usr/lib/i386-linux-gnu/libm.so
...
luadist: cannot open ./luadist.lua: No such file or directory
...

@drahosp
Copy link
Member Author

drahosp commented Nov 22, 2011

I am aware of this, the same issue as we encountered before on cygwin (lua51/lua5.1 taking precedence before lua shared library). This is the primary reason to replace the FindLua51.cmake the other is support for 5.2. For LuaBatteries and bootstrap release i will force the LUA_LIBRARY variable manually to the desired library.

@brentp
Copy link

brentp commented Dec 11, 2011

I am seeing this issue upon running ./bootstrap how can I get around it? something like:
LUA_LIBRARY=??? ./bootstrap
?
if so, what would ??? be?

@drahosp
Copy link
Member Author

drahosp commented Dec 12, 2011

Hello, first of sorry for the late reply. I have modified the bootstrap process as well as the luadist utility with a workaround. Please make sure to use the latest versions and try again. Sorry for the inconvenience and please report back.

@brentp
Copy link

brentp commented Dec 12, 2011

This works for me, thanks very much.
One thing, on this page: https://github.com/LuaDist/Repository/wiki/LuaDist%3A-Installation

It says

> git clone git://github.com/LuaDist/bootstrap.git
> git submodule update --init
> cd bootstrap

but cd bootstrap should be before submodule update, no?

Also it says

> cd _install/luadist-*/bin

but for me it's:

> cd _install/bin

though maybe that's because I'm working with the dev repo?

@drahosp
Copy link
Member Author

drahosp commented Dec 12, 2011

Thanks for noticing it. The page is slightly out of date, I will update it now.

@drahosp
Copy link
Member Author

drahosp commented May 11, 2012

Ok, finally updated LuaDist/_util with latest FindLua, dist.cmake and lua.cmake. I have slowly started updating existing repositories with the macros. Perhaps it would be best to concentrate on batteries first. Once this is done I will close this.

@davidm
Copy link
Member

davidm commented May 12, 2012

I've long wanted that :) Note, however, that one of the recent additions in cmake 2.8.8 was CMakePackageConfigHelpers. I wonder if we should be using that (and something similar for older cmake's). On brief look, it installs a file $(CMAKE_INSTALL_PREFIX)/lib/Foo/cmake/FooConfig.cmake, and then subsequent find_package(Foo) calls locate paths from that file.

@drahosp
Copy link
Member Author

drahosp commented May 12, 2012

I will look into that thanks. Untill batteries 1.0 is out I rather roll with the current macros (with possible minor modification). After that I would like to focus on static builds and documentation which will require further adjustments.

@drahosp
Copy link
Member Author

drahosp commented Aug 1, 2012

Finally, all batteries related modules are up to date. Some regressions remain to be fixed and travis hooks need to be updated. Other than that it went smoothly and I will slowly work my way to convert all the remaining modules. Closing this once all modules are converted.

@drahosp
Copy link
Member Author

drahosp commented Aug 15, 2012

Update: Moving through the repository slowly, managed to get rid of #2 in the process. As this takes some time I have added Unspecified component to luadist-git to avoid issues similar to #95.

@drahosp
Copy link
Member Author

drahosp commented Aug 21, 2012

Update: Only about 30 packages remain to be updated, mostly Lua modules so the work is relatively straightforward.

@mnicky
Copy link
Member

mnicky commented Aug 21, 2012

@drahosp your GitHub activity these days was unmatched :)

@drahosp
Copy link
Member Author

drahosp commented Aug 25, 2012

Finally done. I fixed few modules in the process, some still remain broken (mostly due missing dependencies), others are in desperate need of updates.

@drahosp drahosp closed this as completed Aug 25, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants