--- CMakeLists.txt.orig	2015-01-25 19:29:53.000000000 +0100
+++ CMakeLists.txt	2015-01-26 23:51:27.000000000 +0100
@@ -3,7 +3,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 #SET( CMAKE_BUILD_TYPE Debug )
-SET( CMAKE_BUILD_TYPE Release )
+#SET( CMAKE_BUILD_TYPE Release )
 
 #INCLUDE(FindGraphviz.cmake)
 
@@ -39,6 +39,9 @@
 ENDIF ( WIN32 )
 
 
+SET(QFSM_AVOID_GRAPHVIZ "" CACHE BOOL "Avoid linking against GraphViz")
+
+IF(NOT QFSM_AVOID_GRAPHVIZ)
 FIND_PACKAGE(GraphViz)
 IF(graphviz_FOUND)
   MESSAGE("Graphviz library found")
@@ -50,6 +53,7 @@
 ELSE(graphviz_FOUND)
   MESSAGE("WARNING: Graphviz library not found")
 ENDIF(graphviz_FOUND)
+ENDIF(NOT QFSM_AVOID_GRAPHVIZ)
 
 FIND_PACKAGE(Qt4 REQUIRED)
 
@@ -416,7 +420,7 @@
 
 
 IF(UNIX AND NOT WIN32)
-  SET(CMAKE_INSTALL_PREFIX "/usr")
+  SET(CMAKE_INSTALL_PREFIX "%%PREFIX%%")
 ENDIF(UNIX AND NOT WIN32)
 
 IF(UNIX AND NOT WIN32)
@@ -433,9 +437,9 @@
       PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
 		  GROUP_EXECUTE GROUP_READ
 		  WORLD_EXECUTE WORLD_READ)
-  INSTALL(DIRECTORY doc/user/ DESTINATION share/doc/qfsm
-      PATTERN "CVS" EXCLUDE
-      PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
+%%PD%%  INSTALL(DIRECTORY doc/user/ DESTINATION share/doc/qfsm
+%%PD%%      PATTERN "CVS" EXCLUDE
+%%PD%%      PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
   INSTALL(FILES desktop/qfsm.desktop DESTINATION share/applications
       PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
   INSTALL(FILES desktop/x-qfsm.desktop DESTINATION share/mimelnk/application
@@ -451,9 +455,9 @@
       PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
   INSTALL(FILES po/English.qm po/French.qm po/German.qm po/Russian.qm DESTINATION share/qfsm
       PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
-  INSTALL(DIRECTORY examples DESTINATION share/qfsm
-      PATTERN "CVS" EXCLUDE
-      PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
+%%PE%%  INSTALL(DIRECTORY examples/ DESTINATION share/qfsm
+%%PE%%      PATTERN "CVS" EXCLUDE
+%%PE%%      PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
 ELSE(UNIX AND NOT WIN32)
   INSTALL(TARGETS qfsm RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
 #  INSTALL(TARGETS qfsm RUNTIME DESTINATION ${DESTDIR}
