f65774676a100b10c1112f82bb443dddcff2903d
[flac.git] / src / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.12)
2
3 option(ENABLE_64_BIT_WORDS "Set FLAC__BYTES_PER_WORD to 8 (4 is the default)" OFF)
4 option(WITH_XMMS "Build XMMS plugin" OFF)
5
6 check_include_file("iconv.h" HAVE_ICONV_H)
7
8 add_compile_definitions(
9     ENABLE_64_BIT_WORDS=$<BOOL:${ENABLE_64_BIT_WORDS}>
10     FLAC__HAS_OGG=$<BOOL:${OGG_FOUND}>
11     WORDS_BIGENDIAN=$<BOOL:${CPU_IS_BIG_ENDIAN}>
12     $<$<BOOL:${HAVE_ICONV_H}>:HAVE_ICONV>
13     $<$<BOOL:${HAVE_SYS_PARAM_H}>:HAVE_SYS_PARAM_H>)
14
15 add_subdirectory("libFLAC")
16 if(BUILD_CXXLIBS)
17     add_subdirectory("libFLAC++")
18 endif()
19 add_subdirectory("flac")
20 add_subdirectory("metaflac")
21 add_subdirectory("share")
22 add_subdirectory("utils")
23
24 if(WITH_XMMS)
25     add_subdirectory("plugin_common")
26     add_subdirectory("plugin_xmms")
27 endif()
28
29 if(BUILD_TESTING)
30     add_subdirectory("test_libs_common")
31     add_subdirectory("test_libFLAC")
32     if(BUILD_CXXLIBS)
33         add_subdirectory("test_libFLAC++")
34     endif()
35     add_subdirectory("test_grabbag")
36     add_subdirectory("test_seeking")
37     add_subdirectory("test_streams")
38 endif()