You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ma...@apache.org on 2010/03/15 23:05:51 UTC

svn commit: r923459 - in /hadoop/avro/trunk: CHANGES.txt lang/c/CMakeLists.txt lang/c/cmake_pretty.cmake lang/c/examples/CMakeLists.txt lang/c/src/CMakeLists.txt lang/c/tests/CMakeLists.txt

Author: massie
Date: Mon Mar 15 22:05:51 2010
New Revision: 923459

URL: http://svn.apache.org/viewvc?rev=923459&view=rev
Log:
AVRO-449. CMake-based build system for Avro/C. Contributed by Bruce Mitchener.

Added:
    hadoop/avro/trunk/lang/c/CMakeLists.txt
    hadoop/avro/trunk/lang/c/cmake_pretty.cmake
    hadoop/avro/trunk/lang/c/examples/CMakeLists.txt
    hadoop/avro/trunk/lang/c/src/CMakeLists.txt
    hadoop/avro/trunk/lang/c/tests/CMakeLists.txt
Modified:
    hadoop/avro/trunk/CHANGES.txt

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=923459&r1=923458&r2=923459&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Mon Mar 15 22:05:51 2010
@@ -43,6 +43,8 @@ Avro 1.3.1 (16 March 2010)
 
     AVRO-454. Change DataFileStream to implement Closeable. (cutting)
 
+    AVRO-449. CMake-based build system for Avro/C (Bruce Mitchener via massie)
+
   BUG FIXES
 
     AVRO-424. Fix the specification of the deflate codec.

Added: hadoop/avro/trunk/lang/c/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/CMakeLists.txt?rev=923459&view=auto
==============================================================================
--- hadoop/avro/trunk/lang/c/CMakeLists.txt (added)
+++ hadoop/avro/trunk/lang/c/CMakeLists.txt Mon Mar 15 22:05:51 2010
@@ -0,0 +1,41 @@
+#
+# 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.
+#
+cmake_minimum_required(VERSION 2.4)
+project(AvroC)
+enable_testing()
+file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../share/VERSION.txt" AVRO_VERSION)
+
+if(APPLE)
+    set(CMAKE_OSX_ARCHITECTURES "ppc;i386;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE) 
+endif(APPLE)
+
+if(CMAKE_COMPILER_IS_GNUCC)
+    add_definitions(-W -Wall)
+endif(CMAKE_COMPILER_IS_GNUCC)
+
+include_directories(${AvroC_SOURCE_DIR}/src)
+include_directories(${AvroC_SOURCE_DIR}/jansson/src)
+
+add_subdirectory(src)
+add_subdirectory(examples)
+add_subdirectory(tests)
+
+add_custom_target(pretty
+    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake_pretty.cmake")
+

Added: hadoop/avro/trunk/lang/c/cmake_pretty.cmake
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/cmake_pretty.cmake?rev=923459&view=auto
==============================================================================
--- hadoop/avro/trunk/lang/c/cmake_pretty.cmake (added)
+++ hadoop/avro/trunk/lang/c/cmake_pretty.cmake Mon Mar 15 22:05:51 2010
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+# Linux kernel source indent format options
+set(INDENT_OPTS -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4
+    -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai
+    -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8)
+
+foreach($dir src tests examples)
+	exec_program(indent
+                 ARGS ${INDENT_OPTS} ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*.[c,h]
+                 OUTPUT_VARIABLE indent_output
+                 RETURN_VALUE ret)
+    message(STATUS ${indent_output})
+	# TODO: mv ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*~ /tmp; \
+endforeach()
+

Added: hadoop/avro/trunk/lang/c/examples/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/examples/CMakeLists.txt?rev=923459&view=auto
==============================================================================
--- hadoop/avro/trunk/lang/c/examples/CMakeLists.txt (added)
+++ hadoop/avro/trunk/lang/c/examples/CMakeLists.txt Mon Mar 15 22:05:51 2010
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+add_executable(quickstop quickstop.c)
+target_link_libraries(quickstop avro-static)
+

Added: hadoop/avro/trunk/lang/c/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/CMakeLists.txt?rev=923459&view=auto
==============================================================================
--- hadoop/avro/trunk/lang/c/src/CMakeLists.txt (added)
+++ hadoop/avro/trunk/lang/c/src/CMakeLists.txt Mon Mar 15 22:05:51 2010
@@ -0,0 +1,75 @@
+#
+# 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_SRC
+    avro.h
+    avro_private.h
+    datafile.c
+    datum.c
+    datum.h
+    datum_equal.c
+    datum_read.c
+    datum_size.c
+    datum_skip.c
+    datum_validate.c
+    datum_write.c
+    dump.c
+    dump.h
+    encoding.h
+    encoding_binary.c
+    io.c
+    schema.c
+    schema.h
+    schema_equal.c
+    st.c
+    st.h
+)
+
+set(JANSSON_SRC
+    ../jansson/src/dump.c
+    ../jansson/src/hashtable.c
+    ../jansson/src/hashtable.h
+    ../jansson/src/jansson.h
+    ../jansson/src/jansson_private.h
+    ../jansson/src/load.c
+    ../jansson/src/strbuffer.c
+    ../jansson/src/strbuffer.h
+    ../jansson/src/utf.c
+    ../jansson/src/utf.h
+    ../jansson/src/util.h
+    ../jansson/src/value.c
+)
+
+source_group(Avro FILES ${AVRO_SRC})
+source_group(Jansson FILES ${JANSSON_SRC})
+
+add_library(avro-static STATIC ${AVRO_SRC} ${JANSSON_SRC})
+set_target_properties(avro-static PROPERTIES OUTPUT_NAME avro)
+add_library(avro-shared SHARED ${AVRO_SRC} ${JANSSON_SRC})
+set_target_properties(avro-shared PROPERTIES
+        OUTPUT_NAME avro
+        SOVERSION ${AVRO_VERSION})
+
+install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/avro.h DESTINATION include)
+install(TARGETS avro-static avro-shared
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib
+)
+

Added: hadoop/avro/trunk/lang/c/tests/CMakeLists.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/tests/CMakeLists.txt?rev=923459&view=auto
==============================================================================
--- hadoop/avro/trunk/lang/c/tests/CMakeLists.txt (added)
+++ hadoop/avro/trunk/lang/c/tests/CMakeLists.txt Mon Mar 15 22:05:51 2010
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+
+add_executable(generate_interop_data generate_interop_data.c)
+target_link_libraries(generate_interop_data avro-static)
+add_executable(test_interop_data test_interop_data.c)
+target_link_libraries(test_interop_data avro-static)
+
+add_executable(test_avro_schema test_avro_schema.c)
+target_link_libraries(test_avro_schema avro-static)
+add_test(test_avro_schema ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_schema)
+
+add_executable(test_avro_data test_avro_data.c)
+target_link_libraries(test_avro_data avro-static)
+add_test(test_avro_data ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_data)
+