CMakeLists.txt
changeset 44 afe0184885a0
parent 40 33ea13cef185
child 47 4bf7ef2fea2e
--- a/CMakeLists.txt	Mon Jul 18 01:47:46 2011 +0300
+++ b/CMakeLists.txt	Wed Jul 20 14:34:51 2011 +0300
@@ -1,4 +1,4 @@
-## Copyright 2009 Myhailo Danylenko
+## Copyright 2009,2011 Myhailo Danylenko
 # This file is part of lua-lm
 #
 # lua-lm is free software: you can redistribute it and/or modify
@@ -16,6 +16,7 @@
 
 cmake_minimum_required(VERSION 2.6)
 project(lua-lm C)
+set(PROJECT_VERSION "0.9.1")
 
 ## User options
 option(DEBUG "Enable debugging output" OFF)
@@ -46,18 +47,23 @@
 
 ## Define targets
 add_library(loudmouth MODULE util.c lm_types.c lm_proxy.c lm_ssl.c lm_connection.c lm_message.c lm_message_node.c lm_message_handler.c lm.c)
-get_target_property(lua-lm_SOURCES loudmouth SOURCES)
+get_target_property(loudmouth_SOURCES loudmouth SOURCES)
 
 ## Set up compiler
+if(DEBUG)
+	set(DEBUG_COMPILE_FLAGS "-g")
+endif()
 configure_file(config.h.in config.h)
 include_directories(SYSTEM ${LUA_INCLUDE_DIR} ${GLIB_INCLUDE_DIRS} ${LM_INCLUDE_DIRS})
 target_link_libraries(loudmouth ${LUA_LIBRARIES} ${GLIB_LIBRARIES} ${LM_LIBRARIES})
 include_directories(${lua-lm_SOURCE_DIR} ${lua-lm_BINARY_DIR})
-set_target_properties(loudmouth PROPERTIES PREFIX "")
+set_target_properties(loudmouth PROPERTIES
+                      PREFIX ""
+                      COMPILE_FLAGS "-Wall ${DEBUG_COMPILE_FLAGS}")
 
 ## Extra targets
 if(PERL_FOUND)
-	add_custom_command(OUTPUT ${lua-lm_BINARY_DIR}/loudmouth.html COMMAND ${PERL_EXECUTABLE} ${lua-lm_SOURCE_DIR}/docgen.pl -f html -t "Lua-loudmouth API reference" -o ${lua-lm_BINARY_DIR}/loudmouth.html -- ${lua-lm_SOURCES} DEPENDS ${lua-lm_SOURCE_DIR}/docgen.pl ${lua-lm_SOURCES} WORKING_DIRECTORY ${lua-lm_SOURCE_DIR})
+	add_custom_command(OUTPUT ${lua-lm_BINARY_DIR}/loudmouth.html COMMAND ${PERL_EXECUTABLE} ${lua-lm_SOURCE_DIR}/docgen.pl -f html -t "Lua-loudmouth API reference" -o ${lua-lm_BINARY_DIR}/loudmouth.html -- ${loudmouth_SOURCES} DEPENDS ${lua-lm_SOURCE_DIR}/docgen.pl ${loudmouth_SOURCES} WORKING_DIRECTORY ${lua-lm_SOURCE_DIR})
 	add_custom_target(doc ALL DEPENDS ${lua-lm_BINARY_DIR}/loudmouth.html)
 endif()
 if(LUA_EXECUTABLE)
@@ -66,7 +72,7 @@
 
 ## Packaging information
 set(CPACK_PACKAGE_NAME liblua5.1-loudmouth)
-set(CPACK_PACKAGE_VERSION "0.9.0")
+set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
 set(CPACK_PACKAGE_VENDOR "IsBear")
 set(CPACK_PACKAGE_CONTACT "Myhailo Danylenko <isbear@ukrpost.net>")
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Loudmouth XMPP client library lua interface")
@@ -100,4 +106,4 @@
 endif()
 install(FILES README TODO COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME})
 
-## The End ## vim: se ts=4: ##
+## The End ## vim: se ts=4 sw=4: ##