--- CMakeLists.txt
+++ CMakeLists.txt
@@ -37,8 +37,18 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES "FreeBS
 SET(BUILD_TDTOOL	TRUE				CACHE BOOL "Build tdtool")
 SET(BUILD_TDADMIN	${TDADMIN_DEFAULT}	CACHE BOOL "Build tdadmin")
 
+SET(GENERATE_DOXYGEN	FALSE	CACHE	BOOL "Enable generation of doxygen")
 SET(GENERATE_MAN	FALSE	CACHE	BOOL "Enable generation of man-files")
 
+
+IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+	SET(MAN_DIR_DEFAULT "man")
+ELSE()
+	SET(MAN_DIR_DEFAULT "share/man")
+ENDIF()
+SET(MAN_DIR ${MAN_DIR_DEFAULT} CACHE PATH "The directory where man pages are located (related to ${CMAKE_INSTALL_PREFIX})")
+
+
 ADD_SUBDIRECTORY(common)
 ADD_SUBDIRECTORY(service)
 ADD_SUBDIRECTORY(client)
@@ -56,20 +66,23 @@ ENDIF(BUILD_TDADMIN)
 ENABLE_TESTING()
 ADD_SUBDIRECTORY(tests)
 
-FIND_PACKAGE(Doxygen)
-
-IF(DOXYGEN_FOUND)
-	SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+IF (GENERATE_DOXYGEN)
+	FIND_PACKAGE(Doxygen)
+	IF(DOXYGEN_FOUND)
+		SET(DOXY_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
 
-	CONFIGURE_FILE(
-		"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
-		${DOXY_CONFIG} @ONLY
-	)
+		CONFIGURE_FILE(
+			"${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in"
+			${DOXY_CONFIG} @ONLY
+		)
 
-	ADD_CUSTOM_TARGET(docs
-		${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG}
-		DEPENDS ${DOXY_CONFIG}
-		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-		COMMENT "Generating doxygen documentation" VERBATIM
-	)
-ENDIF()
+		ADD_CUSTOM_TARGET(docs
+			${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG}
+			DEPENDS ${DOXY_CONFIG}
+			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+			COMMENT "Generating doxygen documentation" VERBATIM
+		)
+	ELSE()
+		MESSAGE("Warn: doxygen not found, wont build")
+	ENDIF()
+ENDIF(GENERATE_DOXYGEN)
