File libpicviz-0.6.1-cmake.patch of Package picviz

diff -ruN libpicviz-0.6.1/CMakeLists.txt libpicviz-0.6.1/CMakeLists.txt
--- libpicviz-0.6.1/CMakeLists.txt	2011-06-05 10:46:39.128000546 +0200
+++ libpicviz-0.6.1/CMakeLists.txt	2011-06-05 11:05:45.360000546 +0200
@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 2.6)
-project(LIBPICVIZ)
+project(libpicviz)
 
 INCLUDE(CheckIncludeFile)
 INCLUDE(CheckFunctionExists)
@@ -48,7 +48,7 @@
 	DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ )
 
 
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LIBPICVIZ_SOURCE_DIR}/cmake)
+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
 FIND_PACKAGE(FLEX REQUIRED)
 FIND_PACKAGE(BISON REQUIRED)
 #FIND_PACKAGE(PCRE REQUIRED)
@@ -59,7 +59,7 @@
 
 # Versions of GCC may have warnings I haven't
 # it does not mean I don't care of warnings :)
-set(CMAKE_C_FLAGS "-Wall -Wextra -O0 -ggdb")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -O0 -ggdb")
 #set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -O0 -ggdb")
 
 add_subdirectory(gnulib)
diff -ruN libpicviz-0.6.1/gnulib/glthread/CMakeLists.txt libpicviz-0.6.1/gnulib/glthread/CMakeLists.txt
--- libpicviz-0.6.1/gnulib/glthread/CMakeLists.txt	2009-09-11 22:27:48.000000000 +0200
+++ libpicviz-0.6.1/gnulib/glthread/CMakeLists.txt	2011-06-05 11:05:45.360000546 +0200
@@ -1,4 +1,4 @@
-include_directories(${LIBPICVIZ_SOURCE_DIR}/gnulib/ ${LIBPICVIZ_SOURCE_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/gnulib/ ${PROJECT_SOURCE_DIR})
 
 add_library(glthread STATIC cond.c  lock.c  thread.c  threadlib.c  tls.c)
 
diff -ruN libpicviz-0.6.1/src/CMakeLists.txt libpicviz-0.6.1/src/CMakeLists.txt
--- libpicviz-0.6.1/src/CMakeLists.txt	2011-06-05 10:46:39.132000546 +0200
+++ libpicviz-0.6.1/src/CMakeLists.txt	2011-06-05 11:05:45.360000546 +0200
@@ -1,14 +1,14 @@
 add_subdirectory(plugins)
 #add_subdirectory(bindings)
 
-include_directories(${LIBPICVIZ_SOURCE_DIR}/src/include ${PCRE_INCLUDE_DIR} ${LIBPICVIZ_SOURCE_DIR}/gnulib/glthread ${LIBEV_INCLUDE_DIRS} ${LIBPICVIZ_BINARY_DIR}/src)
+include_directories(${PROJECT_SOURCE_DIR}/src/include ${PCRE_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/gnulib/glthread ${LIBEV_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/src)
 
 
 link_directories(
   ${LIBEV_INCLUDE_DIRS}
 )
 #set(CMAKE_SHARED_LINKER_FLAGS "-lm -lfl -ly")
-#link_directories(${LIBPICVIZ_BINARY_DIR}/ ${LIBPICVIZ_BINARY_DIR}/gnulib/glthread ${LIBPICVIZ_BINARY_DIR}/libev)
+#link_directories(${PROJECT_BINARY_DIR}/ ${PROJECT_BINARY_DIR}/gnulib/glthread ${PROJECT_BINARY_DIR}/libev)
 
 IF(PCRE_FOUND)
     INCLUDE_DIRECTORIES(AFTER ${PCRE_INCLUDE_DIR})
@@ -17,18 +17,18 @@
 
 
 # Parser
-BISON_TARGET(picviz ${LIBPICVIZ_SOURCE_DIR}/src/pgdl-parser.y ${LIBPICVIZ_BINARY_DIR}/src/pgdl-parser.c)
-FLEX_TARGET(picviz ${LIBPICVIZ_SOURCE_DIR}/src/pgdl-lexer.l ${LIBPICVIZ_BINARY_DIR}/src/pgdl-lexer.c)
+BISON_TARGET(picviz ${PROJECT_SOURCE_DIR}/src/pgdl-parser.y ${PROJECT_BINARY_DIR}/src/pgdl-parser.c)
+FLEX_TARGET(picviz ${PROJECT_SOURCE_DIR}/src/pgdl-lexer.l ${PROJECT_BINARY_DIR}/src/pgdl-lexer.c)
 
 # Filter
-BISON_TARGET(picviz ${LIBPICVIZ_SOURCE_DIR}/src/filter.yac.y ${LIBPICVIZ_BINARY_DIR}/src/filter-parser.c)
-FLEX_TARGET(picviz ${LIBPICVIZ_SOURCE_DIR}/src/filter.lex.l ${LIBPICVIZ_BINARY_DIR}/src/filter-lexer.c)
+BISON_TARGET(picviz ${PROJECT_SOURCE_DIR}/src/filter.yac.y ${PROJECT_BINARY_DIR}/src/filter-parser.c)
+FLEX_TARGET(picviz ${PROJECT_SOURCE_DIR}/src/filter.lex.l ${PROJECT_BINARY_DIR}/src/filter-lexer.c)
 
 add_library(picviz SHARED axis.c axisplot.c correlation.c debug.c real-time.c filter.c image.c learn.c line.c pgdl.c plugins.c engine.c picviz-hash.c picviz-init.c picviz-pcre.c properties.c render.c values-mapping.c variable.c utils.c filter-parser.c filter-lexer.c pgdl-parser.c pgdl-lexer.c prop-color.c)
 
 set_target_properties(picviz PROPERTIES SOVERSION 2)
 
-#target_link_libraries(picviz "-lm -ldl -L${LIBPICVIZ_BINARY_DIR}/libev -lev")
+#target_link_libraries(picviz "-lm -ldl -L${PROJECT_BINARY_DIR}/libev -lev")
 target_link_libraries(picviz "-lm -ldl" ${LIBEV_LIBRARIES})
 
 install(TARGETS picviz LIBRARY DESTINATION ${LIB_INSTALL_DIR})
diff -ruN libpicviz-0.6.1/src/plugins/output/CMakeLists.txt libpicviz-0.6.1/src/plugins/output/CMakeLists.txt
--- libpicviz-0.6.1/src/plugins/output/CMakeLists.txt	2009-09-11 22:27:49.000000000 +0200
+++ libpicviz-0.6.1/src/plugins/output/CMakeLists.txt	2011-06-05 11:10:50.512000545 +0200
@@ -1,5 +1,5 @@
-include_directories(${LIBPICVIZ_SOURCE_DIR}/src/include)
-link_directories(${LIBPICVIZ_BUILD_DIR}/)
+include_directories(${PROJECT_SOURCE_DIR}/src/include)
+#link_directories(${LIBPICVIZ_BUILD_DIR}/)
 
 add_library(picvizoutsvg MODULE outsvg.c)
 add_library(picvizoutdebug MODULE outdebug.c)
diff -ruN libpicviz-0.6.1/src/plugins/render/CMakeLists.txt libpicviz-0.6.1/src/plugins/render/CMakeLists.txt
--- libpicviz-0.6.1/src/plugins/render/CMakeLists.txt	2009-09-11 22:27:49.000000000 +0200
+++ libpicviz-0.6.1/src/plugins/render/CMakeLists.txt	2011-06-05 11:10:44.280000545 +0200
@@ -1,5 +1,5 @@
-include_directories(${LIBPICVIZ_SOURCE_DIR}/src/include)
-link_directories(${LIBPICVIZ_BUILD_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/src/include)
+#link_directories(${LIBPICVIZ_BUILD_DIR})
 
 # Debug plugin
 #add_library(picvizrendebug MODULE rendebug.c)
diff -ruN libpicviz-0.6.1/src/plugins/vars/CMakeLists.txt libpicviz-0.6.1/src/plugins/vars/CMakeLists.txt
--- libpicviz-0.6.1/src/plugins/vars/CMakeLists.txt	2009-09-11 22:27:49.000000000 +0200
+++ libpicviz-0.6.1/src/plugins/vars/CMakeLists.txt	2011-06-05 11:11:47.420000545 +0200
@@ -1,5 +1,5 @@
-	include_directories(${LIBPICVIZ_SOURCE_DIR}/src/include)
-link_directories(${LIBPICVIZ_BUILD_DIR})
+include_directories(${PROJECT_SOURCE_DIR}/src/include)
+#link_directories(${LIBPICVIZ_BUILD_DIR})
 
 # Debug plugin
 add_library(picvizvardebug MODULE vardebug.c)