Return-Path: X-Original-To: apmail-avro-commits-archive@www.apache.org Delivered-To: apmail-avro-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41AB04798 for ; Tue, 31 May 2011 14:28:45 +0000 (UTC) Received: (qmail 94759 invoked by uid 500); 31 May 2011 14:28:45 -0000 Delivered-To: apmail-avro-commits-archive@avro.apache.org Received: (qmail 94718 invoked by uid 500); 31 May 2011 14:28:44 -0000 Mailing-List: contact commits-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list commits@avro.apache.org Received: (qmail 94696 invoked by uid 99); 31 May 2011 14:28:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 14:28:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2011 14:28:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6F5642388A1C; Tue, 31 May 2011 14:28:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1129697 - in /avro/trunk/lang/c: CMakeLists.txt docs/CMakeLists.txt Date: Tue, 31 May 2011 14:28:18 -0000 To: commits@avro.apache.org From: dcreager@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110531142818.6F5642388A1C@eris.apache.org> Author: dcreager Date: Tue May 31 14:28:18 2011 New Revision: 1129697 URL: http://svn.apache.org/viewvc?rev=1129697&view=rev Log: AVRO-470. Generate docs in CMake build scripts The CMake build scripts now use asciidoc to generate the documentation, just like the automake scripts do. You need the asciidoc and source-highlight packages installed; if they're not both available, then we skip the documentation when building. [via Daniel Lundin] Added: avro/trunk/lang/c/docs/CMakeLists.txt Modified: avro/trunk/lang/c/CMakeLists.txt Modified: avro/trunk/lang/c/CMakeLists.txt URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/CMakeLists.txt?rev=1129697&r1=1129696&r2=1129697&view=diff ============================================================================== --- avro/trunk/lang/c/CMakeLists.txt (original) +++ avro/trunk/lang/c/CMakeLists.txt Tue May 31 14:28:18 2011 @@ -19,7 +19,28 @@ cmake_minimum_required(VERSION 2.4) project(AvroC) enable_testing() -file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../share/VERSION.txt" AVRO_VERSION) + +#----------------------------------------------------------------------- +# Retrieve the current version number + +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/version.sh project + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE AVRO_VERSION_RESULT + OUTPUT_VARIABLE AVRO_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(AVRO_VERSION_RESULT) + message(FATAL_ERROR "Cannot determine Avro version number") +endif(AVRO_VERSION_RESULT) + +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/version.sh libtool + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE LIBAVRO_VERSION_RESULT + OUTPUT_VARIABLE LIBAVRO_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) +if(LIBAVRO_VERSION_RESULT) + message(FATAL_ERROR "Cannot determine libavro version number") +endif(LIBAVRO_VERSION_RESULT) + if(APPLE) set(CMAKE_OSX_ARCHITECTURES "ppc;i386;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE) @@ -35,6 +56,7 @@ include_directories(${AvroC_SOURCE_DIR}/ add_subdirectory(src) add_subdirectory(examples) add_subdirectory(tests) +add_subdirectory(docs) add_custom_target(pretty "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake_pretty.cmake") Added: avro/trunk/lang/c/docs/CMakeLists.txt URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/docs/CMakeLists.txt?rev=1129697&view=auto ============================================================================== --- avro/trunk/lang/c/docs/CMakeLists.txt (added) +++ avro/trunk/lang/c/docs/CMakeLists.txt Tue May 31 14:28:18 2011 @@ -0,0 +1,51 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 (AVRO_DOC_SRC + index.txt +) + +# TODO(dln): Use FindAsciidoc script instead. +message(STATUS "Searching for asciidoc...") +find_program(ASCIIDOC_EXECUTABLE asciidoc) +find_program(SOURCE_HIGHLIGHT_EXECUTABLE source-highlight) + +if (ASCIIDOC_EXECUTABLE AND SOURCE_HIGHLIGHT_EXECUTABLE) + foreach(_file ${AVRO_DOC_SRC}) + get_filename_component(_file_we ${_file} NAME_WE) + set(_file_path "${CMAKE_CURRENT_SOURCE_DIR}/${_file}") + set(_html_out "${_file_we}.html") + add_custom_command( + OUTPUT "${_html_out}" + COMMAND ${ASCIIDOC_EXECUTABLE} + -a avro_version=${AVRO_VERSION} + -a libavro_version=${LIBAVRO_VERSION} + -a toc + --unsafe -n -o "${_html_out}" "${_file_path}" + DEPENDS "${_file_path}" + COMMENT "asciidoc ${_file}" + ) + add_custom_target("${_file_we}_html" ALL echo -n + DEPENDS "${_file}" "${_html_out}" + ) + endforeach(_file) +else(ASCIIDOC_EXECUTABLE AND SOURCE_HIGHLIGHT_EXECUTABLE) + message(WARNING "asciidoc not found. HTML documentation will *NOT* be built.") +endif(ASCIIDOC_EXECUTABLE AND SOURCE_HIGHLIGHT_EXECUTABLE) +