Documentation maintenance.

* Do not require gtk-doc to be installed.
* Use FindPackageHandleStandardArgs in FindGtkDoc.cmake.
* Fix installation (wrong source path).
* Don't install neither the documentation nor the desktop file on Windows.
This commit is contained in:
Přemysl Eric Janouch 2010-12-18 15:39:50 +01:00
parent 9178fb8d81
commit b44b3e6a54
2 changed files with 19 additions and 21 deletions

View File

@ -52,13 +52,11 @@ if (WIN32)
set (HAVE_THREADSAFE_STRTOK true) set (HAVE_THREADSAFE_STRTOK true)
endif (WIN32) endif (WIN32)
# Lua
# Dependencies
find_package (Lua51 REQUIRED) find_package (Lua51 REQUIRED)
# json-glib
find_package (JsonGlib REQUIRED) find_package (JsonGlib REQUIRED)
# Localization # Localization
find_package (Gettext) find_package (Gettext)
if (GETTEXT_FOUND) if (GETTEXT_FOUND)
@ -77,12 +75,8 @@ endif (GETTEXT_FOUND)
#set (GTK_DOC_ENABLE_HTML ON CACHE BOOL #set (GTK_DOC_ENABLE_HTML ON CACHE BOOL
# "Build documentation in HTML format") # "Build documentation in HTML format")
find_package (GtkDoc REQUIRED) find_package (GtkDoc)
set (project_DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/reference") set (project_DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/docs/reference")
GTK_DOC_RUN (WORKING_DIR ${project_DOC_DIR}
SOURCE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src
XML ${project_DOC_DIR}/xml --sgml-mode
HTML ${project_DOC_DIR}/html)
# Project source files # Project source files
set (logdiag_SOURCES set (logdiag_SOURCES
@ -153,11 +147,22 @@ include_directories (${GTK2_INCLUDE_DIRS} ${JSON_GLIB_INCLUDE_DIRS} ${LUA_INCLUD
add_executable (logdiag ${logdiag_SOURCES} ${logdiag_HEADERS}) add_executable (logdiag ${logdiag_SOURCES} ${logdiag_HEADERS})
target_link_libraries (logdiag ${GTK2_LIBRARIES} ${JSON_GLIB_LIBRARIES} ${LUA_LIBRARIES}) target_link_libraries (logdiag ${GTK2_LIBRARIES} ${JSON_GLIB_LIBRARIES} ${LUA_LIBRARIES})
# Generate documentation
if (GTK_DOC_FOUND)
GTK_DOC_RUN (WORKING_DIR ${project_DOC_DIR}
SOURCE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src
XML ${project_DOC_DIR}/xml --sgml-mode
HTML ${project_DOC_DIR}/html)
endif (GTK_DOC_FOUND)
# Installation # Installation
install (TARGETS logdiag DESTINATION bin) install (TARGETS logdiag DESTINATION bin)
if (NOT WIN32)
install (FILES share/logdiag.desktop DESTINATION share/applications) install (FILES share/logdiag.desktop DESTINATION share/applications)
install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/html/" install (DIRECTORY "${project_DOC_DIR}/html/"
DESTINATION usr/gtk-doc/${CMAKE_PROJECT_NAME}) DESTINATION usr/gtk-doc/${CMAKE_PROJECT_NAME})
endif (NOT WIN32)
# CPack # CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Electric diagram designer.") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Electric diagram designer.")

View File

@ -104,15 +104,8 @@ find_program (GTK_DOC_MKDB_EXECUTABLE "gtkdoc-mkdb")
find_program (GTK_DOC_MKHTML_EXECUTABLE "gtkdoc-mkhtml") find_program (GTK_DOC_MKHTML_EXECUTABLE "gtkdoc-mkhtml")
find_program (GTK_DOC_FIXXREF_EXECUTABLE "gtkdoc-fixxref") find_program (GTK_DOC_FIXXREF_EXECUTABLE "gtkdoc-fixxref")
set (GTK_DOC_FOUND TRUE) include (FindPackageHandleStandardArgs)
if (NOT GTK_DOC_SCAN_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS (GTK_DOC DEFAULT_MSG GTK_DOC_SCAN_EXECUTABLE)
set (GTK_DOC_FOUND FALSE)
endif (NOT GTK_DOC_SCAN_EXECUTABLE)
if (GtkDoc_FIND_REQUIRED AND NOT GTK_DOC_FOUND)
message (FATAL_ERROR "gtk-doc NOT found")
endif (GtkDoc_FIND_REQUIRED AND NOT GTK_DOC_FOUND)
include (ProcessArguments) include (ProcessArguments)