From: Mathis Rosenhauer Date: Mon, 14 Jul 2014 15:14:33 +0000 (+0200) Subject: Initial CMake support. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025501~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=76ddfc84da1726bf2b55be90caef4c44affe4770;p=platform%2Fupstream%2Flibaec.git Initial CMake support. --- diff --git a/.gitignore b/.gitignore index 06dc412..83af2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,6 @@ libtool autom4te.cache .DS_Store data - +*.cmake +CMakeFiles +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..53b9090 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 2.6) +include(CheckIncludeFiles) +include(TestBigEndian) +project(libaec) +set(libaec_VERSION_MAJOR 0) +set(libaec_VERSION_MINOR 2) +set(CMAKE_BUILD_TYPE Release) +enable_testing() + +check_include_files(malloc.h HAVE_MALLOC_H) +check_include_files(stdint.h HAVE_STDINT_H) +test_big_endian(WORDS_BIGENDIAN) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/config.h + ) + +include_directories("${PROJECT_BINARY_DIR}") + +add_subdirectory(src) +add_subdirectory(tests EXCLUDE_FROM_ALL) diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..24783f9 --- /dev/null +++ b/config.h.in @@ -0,0 +1,3 @@ +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine WORDS_BIGENDIAN 1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..6378e08 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,24 @@ +set(libaec_SRCS encode.c encode_accessors.c decode.c) +add_library(aec SHARED ${libaec_SRCS}) +set_target_properties(aec PROPERTIES + VERSION 0 + SOVERSION 0.0 + ) +add_library(sz SHARED sz_compat.c) +set_target_properties(sz PROPERTIES + VERSION 0 + SOVERSION 0.0 + ) +target_link_libraries(sz aec) + +add_executable(aec_client aec.c) +set_target_properties(aec_client PROPERTIES OUTPUT_NAME "aec") +target_link_libraries(aec_client aec) + +install(FILES libaec.h szlib.h DESTINATION include) +install(TARGETS aec sz + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + ) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/aec DESTINATION bin) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..d501ca7 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,20 @@ +add_library(check_aec check_aec.c) + +add_executable(check_code_options check_code_options.c) +target_link_libraries(check_code_options check_aec aec) + +add_executable(check_buffer_sizes check_buffer_sizes.c) +target_link_libraries(check_buffer_sizes check_aec aec) + +add_executable(check_long_fs check_long_fs.c) +target_link_libraries(check_long_fs check_aec aec) + +add_test(check_code_options check_code_options) +add_test(check_buffer_sizes check_buffer_sizes) +add_test(check_long_fs check_long_fs) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) +add_dependencies(check + check_code_options + check_buffer_sizes + check_long_fs)