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

Commit

Permalink
build: update dist.cmake and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidm committed Mar 27, 2011
1 parent f98922d commit f1497cb
Show file tree
Hide file tree
Showing 2 changed files with 431 additions and 108 deletions.
31 changes: 16 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# Copyright (C) 2007-2009 LuaDist.
# Copyright (C) 2007-2011 LuaDist.
# Created by Peter Drahoš
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the COPYRIGHT file distributed with LuaDist.
# Please note that the package source code is licensed under its own license.

PROJECT(luaexpat C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(dist.cmake)
project ( luaexpat C )
cmake_minimum_required ( VERSION 2.6 )
include ( dist.cmake )

# Find Expat
FIND_PACKAGE (EXPAT REQUIRED)
INCLUDE_DIRECTORIES (${EXPAT_INCLUDE_DIR})
find_package ( EXPAT REQUIRED )
include_directories ( ${EXPAT_INCLUDE_DIR} )

# Build LuaExpat module
ADD_LUA_MODULE(lxp src/lxplib.c src/lxp.def)
TARGET_LINK_LIBRARIES(lxp ${EXPAT_LIBRARIES})
install_lua_module ( lxp src/lxplib.c src/lxp.def )
target_link_libraries ( lxp ${EXPAT_LIBRARIES} )

# Install LuaExpat
INSTALL (TARGETS lxp LIBRARY DESTINATION ${INSTALL_CMOD})
INSTALL (FILES src/lxp/lom.lua DESTINATION ${INSTALL_LMOD}/lxp)
INSTALL(FILES README DESTINATION ${INSTALL_DATA})
INSTALL(DIRECTORY doc/ DESTINATION ${INSTALL_DOC})
INSTALL(DIRECTORY tests/ DESTINATION ${INSTALL_TEST})

ADD_LUA_TEST(tests/test.lua)
ADD_LUA_TEST(tests/test-lom.lua) # FIX: need to add src/?.lua to package.path
install_lua_module ( lxp.lom src/lxp/lom.lua )
install_data ( README )
install_doc ( doc/ )
install_test ( tests/ )

add_lua_test ( tests/test.lua )
add_lua_test ( tests/test-lom.lua
${CMAKE_CURRENT_SOURCE_DIR}/src # workaround to add modules to package.path (improve?)
)
Loading

0 comments on commit f1497cb

Please sign in to comment.