--- doc/CMakeLists.txt.orig	2012-08-08 17:14:01.000000000 +0200
+++ doc/CMakeLists.txt	2012-09-19 17:26:59.000000000 +0200
@@ -39,12 +39,19 @@
 ADD_SUBDIRECTORY(c)
 
 IF (SWIG_FOUND)
-  ADD_SUBDIRECTORY(java)
+  IF (WITH_JAVA)
+    ADD_SUBDIRECTORY(java)
+  ENDIF ()
   ADD_SUBDIRECTORY(xqj)
-  ADD_SUBDIRECTORY(python)
-  ADD_SUBDIRECTORY(ruby)
-  ADD_SUBDIRECTORY(php)
-  ADD_SUBDIRECTORY(csharp)
+  IF (WITH_PYTHON)
+    ADD_SUBDIRECTORY(python)
+  ENDIF ()
+  IF (WITH_RUBY)
+    ADD_SUBDIRECTORY(ruby)
+  ENDIF ()
+  IF (WITH_PHP)
+    ADD_SUBDIRECTORY(php)
+  ENDIF ()
   
 ENDIF (SWIG_FOUND)
 
@@ -98,9 +105,6 @@
         COMPONENT "doc"
         DESTINATION share/doc/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}/xqj)
         
-  INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csharp/html 
-        COMPONENT "doc"
-        DESTINATION share/doc/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}/csharp)        
 ENDIF (SWIG_FOUND)
 
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/zorba/html 
