CMakeLists.txt 795 Bytes
Newer Older
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
1 2 3
cmake_minimum_required(VERSION 2.6)
include(CheckIncludeFiles)
include(TestBigEndian)
4
include(CheckCSourceCompiles)
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
5 6 7 8 9 10
project(libaec)
set(libaec_VERSION_MAJOR 0)
set(libaec_VERSION_MINOR 2)
set(CMAKE_BUILD_TYPE Release)
enable_testing()

11 12 13 14
if(CMAKE_COMPILER_IS_GNUCC)
  set(CMAKE_C_FLAGS "-Wall -std=gnu99 ${CMAKE_C_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCC)

Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
15 16 17
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(stdint.h HAVE_STDINT_H)
test_big_endian(WORDS_BIGENDIAN)
18 19 20 21
check_c_source_compiles(
  "int main(void) { return __builtin_clzll(1LL); }"
  HAVE_DECL___BUILTIN_CLZLL
  )
Mathis Rosenhauer's avatar
Mathis Rosenhauer committed
22 23 24 25 26 27 28 29 30 31

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)