lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Mon, Mar 21, 2011 at 8:38 PM, Gaspard Bucher <> wrote:
Am I really the only one who has encountered this issue when creating Lua modules ?
I have looked at your build, I find the organization rather chaotic (macros calling macros in subdirs) etc. The only issue that cough my eye was that you seem to be using LIBRARY_OUTPUT_DIRECTORY[1] in the build_sub_module[2] macro to deploy the modules. This directory should be inside the CMAKE_CURRENT_BINARY_DIR as it stores the objects used to create the module. The CMake manual recommends using INSTALL commands to deploy modules to destination instead. I encountered similar issue when building luasocket in LuaDist[3] that has two 'core' objects, one for mime the other for socket. The same name caused the build to misbehave in similar way you are experiencing. The solution was to use per target LIBRARY_OUTPUT_DIRECTORY[4], note this is relative path in CMAKE_CURRENT_BINARY_DIR.

Sorry for rather boring CMake related stuff on the list.


PS: You seem to be abusing CMake to a degree that its not portable. Why use CMake then?
PSS: Check out our install_lua_module macro in dist.cmake for inspiration.