diff options
author | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-18 18:14:08 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-04-18 18:14:08 +0200 |
commit | e56f93e6de908af88142edc7d0e7a6fe4138b1f3 (patch) | |
tree | 11b6769ed631584b1a5ac8b2b5f427458612e210 | |
parent | c53b59cb2519ac85e06b6de3fa60d5d21ca03a71 (diff) | |
download | uca-e56f93e6de908af88142edc7d0e7a6fe4138b1f3.tar.gz uca-e56f93e6de908af88142edc7d0e7a6fe4138b1f3.tar.bz2 uca-e56f93e6de908af88142edc7d0e7a6fe4138b1f3.tar.xz uca-e56f93e6de908af88142edc7d0e7a6fe4138b1f3.zip |
Only reference docs for cameras that are built
-rw-r--r-- | src/CMakeLists.txt | 35 | ||||
-rw-r--r-- | src/uca-docs.xml.in | 4 | ||||
-rw-r--r-- | src/uca.types.in | 2 |
3 files changed, 30 insertions, 11 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 759d5b7..8177107 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,7 @@ set(uca_HDRS uca-camera.h ) +set(cameras) # --- Find packages and libraries --------------------------------------------- set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) @@ -55,6 +56,7 @@ if (PCO_FOUND AND CLSERME4_FOUND AND FGLIB5_FOUND) if (HAVE_PCO_CL) set(uca_SRCS ${uca_SRCS} cameras/uca-pco-camera.c) set(uca_HDRS ${uca_HDRS} cameras/uca-pco-camera.h) + list(APPEND cameras "Pco") set(uca_LIBS ${uca_LIBS} ${PCO_LIBRARIES} @@ -75,6 +77,7 @@ if (IPE_FOUND) set(uca_SRCS ${uca_SRCS} cameras/uca-ufo-camera.c) set(uca_HDRS ${uca_HDRS} cameras/uca-ufo-camera.h) set(uca_LIBS ${uca_LIBS} ${IPE_LIBRARIES}) + list(APPEND cameras "Ufo") include_directories(${IPE_INCLUDE_DIRS}) endif() @@ -83,6 +86,7 @@ endif() if (HAVE_MOCK_CAMERA) set(uca_SRCS ${uca_SRCS} cameras/uca-mock-camera.c) set(uca_HDRS ${uca_HDRS} cameras/uca-mock-camera.h) + list(APPEND cameras "Mock") endif() @@ -119,9 +123,6 @@ if(GTK_DOC_FOUND) set(docs_out "${docs_dir}/reference") file(MAKE_DIRECTORY ${docs_out}) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uca-docs.xml.in - ${docs_out}/uca-docs.xml) - set(reference_files "${docs_out}/index.html" "${docs_out}/api-index-full.html" @@ -137,13 +138,26 @@ if(GTK_DOC_FOUND) "${docs_out}/right.png" "${docs_out}/up.png") - find_program(GTK_DOC_SCAN gtkdoc-scan REQUIRED) - find_program(GTK_DOC_SCANGOBJ gtkdoc-scangobj REQUIRED) - find_program(GTK_DOC_MKDB gtkdoc-mkdb REQUIRED) - find_program(GTK_DOC_MKHTML gtkdoc-mkhtml REQUIRED) + # Put in uca-docs.xml and uca.types all cameras that are built + set(_xml_doc_input) + set(_types_input) + foreach (_cam ${cameras}) + # add camera to the installed documentation + list(APPEND "${docs_out}/Uca${_cam}Camera.html") - get_directory_property(_current_include_dirs INCLUDE_DIRECTORIES) + string(TOLOWER ${_cam} _cam) + set(_xml_doc_input "${_xml_doc_input}\n<xi:include href=\"xml/uca-${_cam}-camera.xml\"/>") + set(_types_input "${_types_input}\nuca_${_cam}_camera_get_type") + endforeach() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uca-docs.xml.in + ${docs_out}/uca-docs.xml) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uca.types.in + ${docs_out}/uca.types) + + # Create scangobj.sh from scangobj.sh.in + get_directory_property(_current_include_dirs INCLUDE_DIRECTORIES) set(GTK_DOC_CFLAGS) foreach(_incl ${_current_include_dirs}) set(GTK_DOC_CFLAGS "-I${_incl} ${GTK_DOC_CFLAGS}") @@ -151,6 +165,11 @@ if(GTK_DOC_FOUND) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scangobj.sh.in" "${docs_out}/scangobj.sh") + find_program(GTK_DOC_SCAN gtkdoc-scan REQUIRED) + find_program(GTK_DOC_SCANGOBJ gtkdoc-scangobj REQUIRED) + find_program(GTK_DOC_MKDB gtkdoc-mkdb REQUIRED) + find_program(GTK_DOC_MKHTML gtkdoc-mkhtml REQUIRED) + add_custom_command(OUTPUT ${docs_out}/uca-decl.txt COMMAND ${GTK_DOC_SCAN} --module=uca diff --git a/src/uca-docs.xml.in b/src/uca-docs.xml.in index 915e14c..8934ac2 100644 --- a/src/uca-docs.xml.in +++ b/src/uca-docs.xml.in @@ -17,9 +17,7 @@ <chapter> <title>Unified Camera Access</title> <xi:include href="xml/uca-camera.xml"/> - <xi:include href="xml/uca-mock-camera.xml"/> - <xi:include href="xml/uca-ufo-camera.xml"/> - <xi:include href="xml/uca-pco-camera.xml"/> + ${_xml_doc_input} </chapter> <index id="api-index-full"> diff --git a/src/uca.types.in b/src/uca.types.in new file mode 100644 index 0000000..a9ce408 --- /dev/null +++ b/src/uca.types.in @@ -0,0 +1,2 @@ +uca_camera_get_type +${_types_input} |