cmake will use LD_LUA and LD_TOLUA environment variables to search

This commit is contained in:
Enno Rehling 2015-06-08 22:23:07 +02:00
parent 4e33e59d64
commit 8ecf51b057
3 changed files with 21 additions and 9 deletions

View File

@ -8,6 +8,11 @@ project (eressea-server C)
enable_testing()
find_package (LibXml2)
find_package (SQLite3)
find_package (Curses)
find_package (Lua REQUIRED)
find_package (ToLua REQUIRED)
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckSymbolExists)
@ -57,13 +62,6 @@ CONFIGURE_FILE (
INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}/include)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_AUTOCONF")
find_package (LibXml2)
find_package (SQLite3)
find_package (Curses)
find_package (Lua REQUIRED)
find_package (ToLua REQUIRED)
add_subdirectory (cutest)
add_subdirectory (crypto)
add_subdirectory (cJSON)

2
cmake

@ -1 +1 @@
Subproject commit cd779ba36efb4045a040af170588a8dfe496d7b9
Subproject commit 2e4a409c0b2b6b1150ea424289552a199b374c7a

View File

@ -10,6 +10,7 @@ done
[ -z $BUILD ] && BUILD=Debug
MACHINE=`uname -m`
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
@ -33,7 +34,20 @@ if [ -d $HOME/usr ]; then
PREFIX_PATH=$HOME/usr:$HOME/usr/local:$PREFIX_PATH
fi
cmake .. \
if [ -z $PC_LUA ] && [ -e /opt/include/lua.h ]; then
PC_LUA=/opt/include
fi
if [ -z $PC_TOLUA ] && [ -e /opt/include/tolua.h ]; then
PC_TOLUA=/opt/include
fi
if [ ! -z $PC_TOLUA ]; then
PC_ARGS="$PC_ARGS -DPC_TOLUA_INCLUDEDIR=$PC_TOLUA/include -DPC_TOLUA_LIBDIR=$PC_TOLUA/lib"
fi
if [ ! -z $PC_LUA ]; then
PC_ARGS="$PC_ARGS -DPC_LUA_INCLUDEDIR=$PC_LUA/include -DPC_LUA_LIBDIR=$PC_LUA/lib"
fi
cmake .. $PC_ARGS \
-DCMAKE_MODULE_PATH=$PWD/../cmake/Modules \
-DCMAKE_BUILD_TYPE=$BUILD \
-DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \