CMake #160
Comments
The luadist utility was designed to create standalone installations, that means it will try to install its own lua. However if you use the CMake build manually you can specify which lua to link against. The detection process may not always find the desired library so for that purpose you can use the cmake-gui frontend to configure the build manually. In case of lua libraries the variables LUA_LIBRARY and LUA_INCLUDE_DIR are needed. You can override these using the commandline of luadist and cmake with the following syntax:
For more details on CMake FindLibrary behavior |
In fact I need install some environment to write and test LuaDist packages. |
You can also use
This will call the CMake build of your project with settings that force the library detection mechanism in CMake to search for libraries in the destination locations first. If the above works your package should be good to go. Also note that the |
Thanks. this is what i need. But I get error when i try make my project. > luadist g:\lua\dist-5.1 make f:\Projects\lua-llthreads2 -verbose
cmake version 2.8.10.2
Building lua-llthreads2...
loading initial cache file cache.cmake
CMake Error: Error processing file:cache.cmake
CMake Error: your RC compiler: "rc" was not found. Please set CMAKE_RC_COMPILER to a valid compiler path or name.
DIST_NAME: lua-llthreads2
DIST_VERSION: 0.1.1
DIST_LICENSE: MIT/X11
DIST_AUTHOR: Alexey Melnichuk
DIST_MAINTAINER: Alexey Melnichuk
DIST_URL: https://github.com/moteus/lua-llthreads2
DIST_DESC: A simple Lua wrapper for pthreads & WIN32 threads.
DIST_DEPENDS:
-- Configuring incomplete, errors occurred!
Error preloading the CMake cache script 'g:\lua\dist-5.1\tmp\lua-llthreads2-0.1.1-CMake-build\cmake.cache' CMake create correct project. |
What version of MinGW are you using? I have just tried to set up the project with your CMakeLists.txt on my box without issues (removed examples and tests). I am using MinGW Builds 4.8.1. |
I'll chick it later. |
Yes, it is default for CMake but LuaDist overrides it to "MinGW Makefiles" (see LuaDist/lib/lua/dist/config.lua). My guess is that you have leftover cmake cache files in the project directory that includes settings from your manual build. You should clean these out first (CMakeCache.txt, CPack_, CTest_, cmake_install.cmake). Usually when building with CMake we build "out of source" so the source is not poisoned with these files. The luadist utility does this so problems like this are avoided. Note that LuaDist packages can be built with MSVC compiler also but we do not support it yet. |
If i run from non project dir all works. G:\lua>luadist g:\lua\dist-5.1 make f:\e\Projects\lua-llthreads2 -verbose
cmake version 2.8.10.2
Building lua-llthreads2...
loading initial cache file cache.cmake
-- The C compiler identification is GNU 4.6.2
-- Check for working C compiler: c:/MinGW/bin/gcc.exe
-- Check for working C compiler: c:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
DIST_NAME: lua-llthreads2
DIST_VERSION: 0.1.1
DIST_LICENSE: MIT/X11
DIST_AUTHOR: Alexey Melnichuk
DIST_MAINTAINER: Alexey Melnichuk
DIST_URL: https://github.com/moteus/lua-llthreads2
DIST_DESC: A simple Lua wrapper for pthreads & WIN32 threads.
DIST_DEPENDS:
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Lua: G:/lua/dist-5.1/lib/liblua.dll.a (found version "5.1.5")
-- Configuring done
-- Generating done
-- Build files have been written to: G:/lua/dist-5.1/tmp/lua-llthreads2-0.1.1-CMake-build
Scanning dependencies of target llthreads2
[ 50%] [100%] Building C object CMakeFiles/llthreads2.dir/src/l52util.c.obj
Building C object CMakeFiles/llthreads2.dir/src/llthread.c.obj
Linking C shared module llthreads2.dll
[100%] Built target llthreads2
-- Install configuration: "MinSizeRel"
-- Install component: "Runtime"
-- Installing: G:/lua/dist-5.1/lib/lua/llthreads2.dll
-- Install configuration: "MinSizeRel"
-- Install component: "Library"
-- Install configuration: "MinSizeRel"
-- Install component: "Header"
-- Install configuration: "MinSizeRel"
-- Install component: "Data"
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/COPYRIGHT.llthreads
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/README.md
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/LICENSE
-- Install configuration: "MinSizeRel"
-- Install component: "Documentation"
-- Install configuration: "MinSizeRel"
-- Install component: "Example"
-- Install configuration: "MinSizeRel"
-- Install component: "Test"
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test/
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_alive.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_join_detach.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_join_error.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_join_timeout.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_llthreads.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_load_llthreads2.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_logger.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_pass_cfunction.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_register_ffi.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_register_llthreads.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_table_copy.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//test_threads.lua
-- Installing: G:/lua/dist-5.1/share/lua-llthreads2/test//utils.lua
-- Install configuration: "MinSizeRel"
-- Install component: "Other"
-- Install configuration: "MinSizeRel"
-- Install component: "Unspecified"
Deployment successful.
luadist g:\lua\dist-5.1 remove lua-llthreads2
Removed modules: 1 But when i run from project dir i get error.
G:\lua>cd /d F:\Projects\lua-llthreads2\
F:\Projects\lua-llthreads2>luadist g:\lua\dist-5.1 make . -verbose
cmake version 2.8.10.2
Building ....
loading initial cache file cache.cmake
CMake Error: Error processing file:cache.cmake
-- Building for: Visual Studio 10
-- The C compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
DIST_NAME: lua-llthreads2
DIST_VERSION: 0.1.1
DIST_LICENSE: MIT/X11
DIST_AUTHOR: Alexey Melnichuk
DIST_MAINTAINER: Alexey Melnichuk
DIST_URL: https://github.com/moteus/lua-llthreads2
DIST_DESC: A simple Lua wrapper for pthreads & WIN32 threads.
DIST_DEPENDS:
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Found Lua: G:/lua/5.2/lib/lua52.lib (found version "5.1.5")
-- Configuring incomplete, errors occurred!
Error preloading the CMake cache script 'G:\lua\dist-5.1\tmp\lua-llthreads2-0.1.1-CMake-build\cmake.cache' |
I believe you have found a bug in the luadist utility, can you please post the contents of the cmake.cache file in the error message. |
In error message file name is |
LuaDist dir
|
This may be MinGW related issue. I have experienced failed builds and detections when using resources on multiple drives and network mounts. Generally I would advise you to keep all your resources and workdirs on a single drive when building. |
As mentioned above, I am also finding a problem with expected Example:
|
I want maintain my modules to LuaDist. Before I never used cmake or luadist.
I start with module llthreads2.
This is my CMakeLists.txt based on this file:
On my machine I have installed Lua 5.1/5.2 and when I run CMake I get:
-- Found Lua: G:/lua/5.2/lib/lua52.lib (found version "5.1.5")
And in project Include dirs point to
G:/lua/5.1/include
and lib isG:/lua/5.2/lib/lua52.lib
Whether it is possible to install LuaDist so that it used existing Lua?
The text was updated successfully, but these errors were encountered: