Skip to content
Snippets Groups Projects
Commit 76ddfc84 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer
Browse files

Initial CMake support.

parent ec04f5ea
No related branches found
No related tags found
No related merge requests found
......@@ -16,4 +16,6 @@ libtool
autom4te.cache
.DS_Store
data
*.cmake
CMakeFiles
build
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)
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine WORDS_BIGENDIAN 1
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)
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment