Merge pull request #71 from nils-a/manpage

client/X11: Do not break compilation, if xmlto is not available
This commit is contained in:
Marc-André Moreau 2011-08-30 11:28:31 -07:00
commit 219979c064
2 changed files with 47 additions and 7 deletions

View File

@ -17,6 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
include(FindXmlto)
include_directories(${X11_INCLUDE_DIRS})
add_executable(xfreerdp
@ -34,15 +35,19 @@ add_executable(xfreerdp
xfreerdp.h)
if(WITH_MANPAGES)
add_custom_command(OUTPUT xfreerdp.1
COMMAND xmlto man ${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp.1.xml
DEPENDS xfreerdp.1.xml)
if(XMLTO_FOUND)
add_custom_command(OUTPUT xfreerdp.1
COMMAND ${XMLTO_EXECUTABLE} man ${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp.1.xml
DEPENDS xfreerdp.1.xml)
add_custom_target(xfreerdp.manpage ALL
DEPENDS xfreerdp.1)
add_custom_target(xfreerdp.manpage ALL
DEPENDS xfreerdp.1)
install(FILES xfreerdp.1 DESTINATION share/man/man1)
endif()
install(FILES xfreerdp.1 DESTINATION share/man/man1)
else(XMLTO_FOUND)
message(WARNING "WITH_MANPAGES was set, but xmlto was not found. man-pages will not be installed")
endif(XMLTO_FOUND)
endif(WITH_MANPAGES)
find_package(Xinerama)
if(XINERAMA_FOUND)

35
cmake/FindXmlto.cmake Normal file
View File

@ -0,0 +1,35 @@
# - Find xmlto
# Find the xmlto docbook xslt frontend
#
# This module defines the following variables:
# XMLTO_FOUND - True if xmlto was found
# XMLTO_EXECUTABLE - Path to xmlto, if xmlto was found
#
#=============================================================================
# Copyright 2011 Nils Andresen <nils@nils-andresen.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
set(XMLTO_FOUND false)
find_program(XMLTO_EXECUTABLE
NAMES xmlto
DOC "docbook xslt frontend")
if(XMLTO_EXECUTABLE)
set(XMLTO_FOUND true)
message(STATUS "Found XMLTO: ${XMLTO_EXECUTABLE}")
endif()
mark_as_advanced(XMLTO_EXECUTABLE)