summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt43
-rw-r--r--src/flac/CMakeLists.txt27
-rw-r--r--src/libFLAC++/CMakeLists.txt48
-rw-r--r--src/libFLAC/CMakeLists.txt124
-rw-r--r--src/libFLAC/ia32/CMakeLists.txt18
-rw-r--r--src/metaflac/CMakeLists.txt15
-rw-r--r--src/plugin_common/CMakeLists.txt5
-rw-r--r--src/plugin_xmms/CMakeLists.txt8
-rw-r--r--src/share/CMakeLists.txt8
-rw-r--r--src/share/getopt/CMakeLists.txt12
-rw-r--r--src/share/grabbag/CMakeLists.txt12
-rw-r--r--src/share/replaygain_analysis/CMakeLists.txt2
-rw-r--r--src/share/replaygain_synthesis/CMakeLists.txt2
-rw-r--r--src/share/utf8/CMakeLists.txt9
-rw-r--r--src/share/win_utf8_io/CMakeLists.txt1
-rw-r--r--src/test_grabbag/CMakeLists.txt2
-rw-r--r--src/test_grabbag/cuesheet/CMakeLists.txt2
-rw-r--r--src/test_grabbag/picture/CMakeLists.txt2
-rw-r--r--src/test_libFLAC++/CMakeLists.txt10
-rw-r--r--src/test_libFLAC/CMakeLists.txt20
-rw-r--r--src/test_libs_common/CMakeLists.txt4
-rw-r--r--src/test_seeking/CMakeLists.txt2
-rw-r--r--src/test_streams/CMakeLists.txt2
-rw-r--r--src/utils/CMakeLists.txt6
-rw-r--r--src/utils/flacdiff/CMakeLists.txt4
-rw-r--r--src/utils/flactimer/CMakeLists.txt2
26 files changed, 390 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 00000000..7de7a7fa
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,43 @@
+cmake_minimum_required(VERSION 3.12)
+
+option(ENABLE_64_BIT_WORDS "Set FLAC__BYTES_PER_WORD to 8 (4 is the default)" OFF)
+option(WITH_OGG "ogg support (default: test for libogg)" ON)
+option(WITH_XMMS "Build XMMS plugin" OFF)
+
+if(WITH_OGG)
+ find_package(OGG REQUIRED)
+endif()
+
+check_include_file("iconv.h" HAVE_ICONV_H)
+
+add_compile_definitions(
+ ENABLE_64_BIT_WORDS=$<BOOL:${ENABLE_64_BIT_WORDS}>
+ FLAC__HAS_OGG=$<BOOL:${OGG_FOUND}>
+ WORDS_BIGENDIAN=$<BOOL:${CPU_IS_BIG_ENDIAN}>
+ $<$<BOOL:${HAVE_ICONV_H}>:HAVE_ICONV>
+ $<$<BOOL:${HAVE_SYS_PARAM_H}>:HAVE_SYS_PARAM_H>)
+
+add_subdirectory("libFLAC")
+if(BUILD_CXXLIBS)
+ add_subdirectory("libFLAC++")
+endif()
+add_subdirectory("flac")
+add_subdirectory("metaflac")
+add_subdirectory("share")
+add_subdirectory("utils")
+
+if(WITH_XMMS)
+ add_subdirectory("plugin_common")
+ add_subdirectory("plugin_xmms")
+endif()
+
+if(BUILD_TESTING)
+ add_subdirectory("test_libs_common")
+ add_subdirectory("test_libFLAC")
+ if(BUILD_CXXLIBS)
+ add_subdirectory("test_libFLAC++")
+ endif()
+ add_subdirectory("test_grabbag")
+ add_subdirectory("test_seeking")
+ add_subdirectory("test_streams")
+endif()
diff --git a/src/flac/CMakeLists.txt b/src/flac/CMakeLists.txt
new file mode 100644
index 00000000..3fb2e2f7
--- /dev/null
+++ b/src/flac/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.12)
+
+check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H)
+check_include_file("termios.h" HAVE_TERMIOS_H)
+
+add_compile_definitions(
+ $<$<BOOL:${HAVE_SYS_IOCTL_H}>:HAVE_SYS_IOCTL_H>
+ $<$<BOOL:${HAVE_TERMIOS_H}>:HAVE_TERMIOS_H>)
+
+add_executable(flac
+ analyze.c
+ decode.c
+ encode.c
+ foreign_metadata.c
+ main.c
+ local_string_utils.c
+ utils.c
+ vorbiscomment.c)
+target_link_libraries(flac
+ FLAC-static
+ getopt
+ grabbag
+ replaygain_synthesis
+ utf8)
+
+install(TARGETS flac EXPORT targets
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
diff --git a/src/libFLAC++/CMakeLists.txt b/src/libFLAC++/CMakeLists.txt
new file mode 100644
index 00000000..83031420
--- /dev/null
+++ b/src/libFLAC++/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+configure_file(flac++.pc.in flac++.pc @ONLY)
+
+check_cxx_source_compiles("
+ #ifdef __STDC_NO_VLA__
+ syntax error;
+ #else
+ int fvla (int m, int * c)
+ {
+ int D[m];
+ return D[0] == c[0];
+ }
+
+ int main(int, char * []) { return 0; }
+ #endif"
+ HAVE_CXX_VARARRAYS)
+
+add_compile_definitions($<$<BOOL:${HAVE_CXX_VARARRAYS}>:HAVE_CXX_VARARRAYS>)
+
+set(SOURCES
+ metadata.cpp
+ stream_decoder.cpp
+ stream_encoder.cpp)
+
+add_library(FLACXX-static STATIC ${SOURCES})
+target_compile_definitions(FLACXX-static PUBLIC FLAC__NO_DLL)
+target_include_directories(FLACXX-static INTERFACE
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+target_link_libraries(FLACXX-static PUBLIC FLAC-static)
+
+add_library(FLACXX SHARED ${SOURCES})
+target_compile_definitions(FLACXX PRIVATE FLACPP_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
+target_include_directories(FLACXX INTERFACE
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+target_link_libraries(FLACXX PRIVATE FLAC)
+set_target_properties(FLACXX PROPERTIES CXX_VISIBILITY_PRESET hidden)
+
+install(TARGETS FLACXX FLACXX-static EXPORT targets
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/flac++.pc"
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig")
diff --git a/src/libFLAC/CMakeLists.txt b/src/libFLAC/CMakeLists.txt
new file mode 100644
index 00000000..1ea9383a
--- /dev/null
+++ b/src/libFLAC/CMakeLists.txt
@@ -0,0 +1,124 @@
+cmake_minimum_required(VERSION 3.12)
+
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86(_64)?|(AMD|amd)64|i[346]86")
+ option(WITH_AVX "Enable AVX, AVX2 optimizations" ON)
+ option(WITH_SSE "Enable AVX, AVX2 optimizations" ON)
+endif()
+
+check_c_compiler_flag(-msse2 HAVE_MSSE2_FLAG)
+if(HAVE_MSSE2_FLAG AND WITH_SSE)
+ add_compile_options(-msse2)
+endif()
+
+option(WITH_ASM "Use any assembly optimization routines" ON)
+
+check_include_file("cpuid.h" HAVE_CPUID_H)
+check_include_file("sys/param.h" HAVE_SYS_PARAM_H)
+
+set(CMAKE_REQUIRED_LIBRARIES m)
+check_function_exists(lround HAVE_LROUND)
+
+add_compile_definitions(
+ $<$<BOOL:${MSVC}>:_USE_MATH_DEFINES>
+ FLAC__USE_AVX=$<BOOL:${WITH_AVX}>
+ HAVE_LROUND=$<BOOL:${HAVE_LROUND}>
+ $<$<BOOL:${HAVE_CPUID_H}>:HAVE_CPUID_H>
+ $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:FLAC__OVERFLOW_DETECT>)
+
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86_64|(AMD|amd)64")
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(IA32 TRUE)
+ endif()
+ add_compile_definitions(
+ FLAC__CPU_X86_64
+ FLAC__ALIGN_MALLOC_DATA)
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "([xX]|i[346])86")
+ set(IA32 TRUE)
+ add_compile_definitions(
+ FLAC__CPU_IA32
+ FLAC__ALIGN_MALLOC_DATA)
+endif()
+
+include(CheckLanguage)
+check_language(ASM_NASM)
+if(CMAKE_ASM_NASM_COMPILER)
+ enable_language(ASM_NASM)
+ add_compile_definitions(FLAC__HAS_NASM)
+endif()
+
+if(NOT WITH_ASM)
+ add_compile_definitions(FLAC__NO_ASM)
+endif()
+
+if(WITH_ASM AND IA32 AND CMAKE_ASM_NASM_COMPILER)
+ add_subdirectory(ia32)
+endif()
+
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+configure_file(flac.pc.in flac.pc @ONLY)
+
+set(SOURCES
+ bitmath.c
+ bitreader.c
+ bitwriter.c
+ cpu.c
+ crc.c
+ fixed.c
+ fixed_intrin_sse2.c
+ fixed_intrin_ssse3.c
+ float.c
+ format.c
+ lpc.c
+ lpc_intrin_sse.c
+ lpc_intrin_sse2.c
+ lpc_intrin_sse41.c
+ lpc_intrin_avx2.c
+ lpc_intrin_vsx.c
+ md5.c
+ memory.c
+ metadata_iterators.c
+ metadata_object.c
+ stream_decoder.c
+ stream_encoder.c
+ stream_encoder_intrin_sse2.c
+ stream_encoder_intrin_ssse3.c
+ stream_encoder_intrin_avx2.c
+ stream_encoder_framing.c
+ window.c
+ $<$<BOOL:${OGG_FOUND}>:ogg_decoder_aspect.c>
+ $<$<BOOL:${OGG_FOUND}>:ogg_encoder_aspect.c>
+ $<$<BOOL:${OGG_FOUND}>:ogg_helper.c>
+ $<$<BOOL:${OGG_FOUND}>:ogg_mapping.c>
+ $<$<BOOL:${WIN32}>:windows_unicode_filenames.c>)
+
+include_directories("include")
+
+add_library(FLAC-static STATIC ${SOURCES})
+target_compile_definitions(FLAC-static PUBLIC FLAC__NO_DLL)
+target_include_directories(FLAC-static INTERFACE
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+target_link_libraries(FLAC-static PUBLIC
+ $<TARGET_NAME_IF_EXISTS:Ogg::Ogg>
+ $<TARGET_NAME_IF_EXISTS:FLAC-asm>
+ $<$<BOOL:${HAVE_LROUND}>:m>)
+
+add_library(FLAC SHARED ${SOURCES})
+target_compile_definitions(FLAC PRIVATE FLAC_API_EXPORTS FLAC__USE_VISIBILITY_ATTR)
+target_include_directories(FLAC INTERFACE
+ "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>")
+target_link_libraries(FLAC PRIVATE
+ $<TARGET_NAME_IF_EXISTS:FLAC-asm>
+ $<$<BOOL:${HAVE_LROUND}>:m>)
+set_target_properties(FLAC PROPERTIES C_VISIBILITY_PRESET hidden)
+
+install(TARGETS FLAC FLAC-static EXPORT targets
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}/")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/flac.pc"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/pkgconfig")
diff --git a/src/libFLAC/ia32/CMakeLists.txt b/src/libFLAC/ia32/CMakeLists.txt
new file mode 100644
index 00000000..94357064
--- /dev/null
+++ b/src/libFLAC/ia32/CMakeLists.txt
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.12)
+
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
+
+if(APPLE)
+ add_compile_options(-dOBJ_FORMAT_macho)
+elseif(WIN32)
+ #add_compile_options(-d OBJ_FORMAT_win32)
+ # FIXME the command above doesn't seem to work on Windows
+ set(CMAKE_ASM_NASM_FLAGS -dOBJ_FORMAT_win32)
+else()
+ add_compile_options(-dOBJ_FORMAT_elf)
+endif()
+
+add_library(FLAC-asm STATIC
+ cpu_asm.nasm
+ fixed_asm.nasm
+ lpc_asm.nasm)
diff --git a/src/metaflac/CMakeLists.txt b/src/metaflac/CMakeLists.txt
new file mode 100644
index 00000000..8f99d646
--- /dev/null
+++ b/src/metaflac/CMakeLists.txt
@@ -0,0 +1,15 @@
+add_executable(metaflac
+ main.c
+ operations.c
+ operations_shorthand_cuesheet.c
+ operations_shorthand_picture.c
+ operations_shorthand_seektable.c
+ operations_shorthand_streaminfo.c
+ operations_shorthand_vorbiscomment.c
+ options.c
+ usage.c
+ utils.c)
+target_link_libraries(metaflac FLAC-static grabbag getopt utf8)
+
+install(TARGETS metaflac EXPORT targets
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
diff --git a/src/plugin_common/CMakeLists.txt b/src/plugin_common/CMakeLists.txt
new file mode 100644
index 00000000..b5c72c92
--- /dev/null
+++ b/src/plugin_common/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(plugin_common STATIC
+ charset.c
+ dither.c
+ replaygain.c
+ tags.c)
diff --git a/src/plugin_xmms/CMakeLists.txt b/src/plugin_xmms/CMakeLists.txt
new file mode 100644
index 00000000..3c4b716d
--- /dev/null
+++ b/src/plugin_xmms/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_library(xmms-flac STATIC
+ charset.c
+ configure.c
+ fileinfo.c
+ http.c
+ plugin.c
+ tag.c)
+target_link_libraries(xmms-flac plugin_common)
diff --git a/src/share/CMakeLists.txt b/src/share/CMakeLists.txt
new file mode 100644
index 00000000..b3c5a712
--- /dev/null
+++ b/src/share/CMakeLists.txt
@@ -0,0 +1,8 @@
+add_subdirectory("replaygain_analysis")
+add_subdirectory("replaygain_synthesis")
+add_subdirectory("getopt")
+add_subdirectory("utf8")
+if(WIN32)
+ add_subdirectory("win_utf8_io")
+endif()
+add_subdirectory("grabbag")
diff --git a/src/share/getopt/CMakeLists.txt b/src/share/getopt/CMakeLists.txt
new file mode 100644
index 00000000..a247336c
--- /dev/null
+++ b/src/share/getopt/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.12)
+
+check_include_file("libintl.h" HAVE_LIBINTL_H)
+check_include_file("string.h" HAVE_STRING_H)
+
+add_compile_definitions(
+ $<$<BOOL:${HAVE_LIBINTL_H}>:HAVE_LIBINTL_H>
+ $<$<BOOL:${HAVE_STRING_H}>:HAVE_STRING_H>)
+
+add_library(getopt STATIC
+ getopt.c
+ getopt1.c)
diff --git a/src/share/grabbag/CMakeLists.txt b/src/share/grabbag/CMakeLists.txt
new file mode 100644
index 00000000..6d405d05
--- /dev/null
+++ b/src/share/grabbag/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_library(grabbag STATIC
+ alloc.c
+ cuesheet.c
+ file.c
+ picture.c
+ replaygain.c
+ seektable.c
+ snprintf.c)
+target_link_libraries(grabbag
+ FLAC-static
+ replaygain_analysis
+ $<TARGET_NAME_IF_EXISTS:win_utf8_io>)
diff --git a/src/share/replaygain_analysis/CMakeLists.txt b/src/share/replaygain_analysis/CMakeLists.txt
new file mode 100644
index 00000000..4362b902
--- /dev/null
+++ b/src/share/replaygain_analysis/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(replaygain_analysis STATIC
+ replaygain_analysis.c)
diff --git a/src/share/replaygain_synthesis/CMakeLists.txt b/src/share/replaygain_synthesis/CMakeLists.txt
new file mode 100644
index 00000000..0736f4fc
--- /dev/null
+++ b/src/share/replaygain_synthesis/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(replaygain_synthesis STATIC
+ replaygain_synthesis.c)
diff --git a/src/share/utf8/CMakeLists.txt b/src/share/utf8/CMakeLists.txt
new file mode 100644
index 00000000..e0e32ac1
--- /dev/null
+++ b/src/share/utf8/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(CMAKE_REQUIRED_LIBRARIES iconv)
+check_symbol_exists(iconv "iconv.h" HAVE_ICONV_LIB)
+
+add_library(utf8 STATIC
+ charset.c
+ iconvert.c
+ utf8.c)
+
+target_link_libraries(utf8 PUBLIC $<$<BOOL:${HAVE_ICONV_LIB}>:iconv>)
diff --git a/src/share/win_utf8_io/CMakeLists.txt b/src/share/win_utf8_io/CMakeLists.txt
new file mode 100644
index 00000000..797e728b
--- /dev/null
+++ b/src/share/win_utf8_io/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(win_utf8_io STATIC win_utf8_io.c)
diff --git a/src/test_grabbag/CMakeLists.txt b/src/test_grabbag/CMakeLists.txt
new file mode 100644
index 00000000..56abe810
--- /dev/null
+++ b/src/test_grabbag/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(cuesheet)
+add_subdirectory(picture)
diff --git a/src/test_grabbag/cuesheet/CMakeLists.txt b/src/test_grabbag/cuesheet/CMakeLists.txt
new file mode 100644
index 00000000..35c1987d
--- /dev/null
+++ b/src/test_grabbag/cuesheet/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(test_cuesheet main.c)
+target_link_libraries(test_cuesheet FLAC-static grabbag)
diff --git a/src/test_grabbag/picture/CMakeLists.txt b/src/test_grabbag/picture/CMakeLists.txt
new file mode 100644
index 00000000..0ae66449
--- /dev/null
+++ b/src/test_grabbag/picture/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(test_picture main.c)
+target_link_libraries(test_picture FLAC-static grabbag)
diff --git a/src/test_libFLAC++/CMakeLists.txt b/src/test_libFLAC++/CMakeLists.txt
new file mode 100644
index 00000000..a517faed
--- /dev/null
+++ b/src/test_libFLAC++/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_executable(test_libFLAC++
+ decoders.cpp
+ encoders.cpp
+ main.cpp
+ metadata.cpp
+ metadata_manip.cpp
+ metadata_object.cpp)
+target_link_libraries(test_libFLAC++ FLACXX-static test_libs_common grabbag)
+
+add_test(NAME FLACXX COMMAND test_libFLAC++)
diff --git a/src/test_libFLAC/CMakeLists.txt b/src/test_libFLAC/CMakeLists.txt
new file mode 100644
index 00000000..9a4a475b
--- /dev/null
+++ b/src/test_libFLAC/CMakeLists.txt
@@ -0,0 +1,20 @@
+add_executable(test_libFLAC
+ bitreader.c
+ bitwriter.c
+ crc.c
+ decoders.c
+ encoders.c
+ endswap.c
+ format.c
+ main.c
+ metadata.c
+ metadata_manip.c
+ metadata_object.c
+ md5.c)
+
+target_compile_definitions(test_libFLAC PRIVATE
+ $<$<BOOL:${ENABLE_64_BIT_WORDS}>:ENABLE_64_BIT_WORDS>)
+target_include_directories(test_libFLAC PRIVATE "$<TARGET_PROPERTY:FLAC-static,SOURCE_DIR>/include")
+target_link_libraries(test_libFLAC FLAC-static grabbag test_libs_common)
+
+add_test(NAME FLAC COMMAND test_libFLAC)
diff --git a/src/test_libs_common/CMakeLists.txt b/src/test_libs_common/CMakeLists.txt
new file mode 100644
index 00000000..806f3530
--- /dev/null
+++ b/src/test_libs_common/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(test_libs_common STATIC
+ file_utils_flac.c
+ metadata_utils.c)
+target_link_libraries(test_libs_common PUBLIC FLAC-static)
diff --git a/src/test_seeking/CMakeLists.txt b/src/test_seeking/CMakeLists.txt
new file mode 100644
index 00000000..1c2a2f4b
--- /dev/null
+++ b/src/test_seeking/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(test_seeking main.c)
+target_link_libraries(test_seeking FLAC-static)
diff --git a/src/test_streams/CMakeLists.txt b/src/test_streams/CMakeLists.txt
new file mode 100644
index 00000000..13e30234
--- /dev/null
+++ b/src/test_streams/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(test_streams main.c)
+target_link_libraries(test_streams FLAC-static grabbag)
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
new file mode 100644
index 00000000..cd7b060f
--- /dev/null
+++ b/src/utils/CMakeLists.txt
@@ -0,0 +1,6 @@
+if(BUILD_CXXLIBS)
+ add_subdirectory(flacdiff)
+ if(WIN32)
+ add_subdirectory(flactimer)
+ endif()
+endif()
diff --git a/src/utils/flacdiff/CMakeLists.txt b/src/utils/flacdiff/CMakeLists.txt
new file mode 100644
index 00000000..d64383ff
--- /dev/null
+++ b/src/utils/flacdiff/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_executable(flacdiff main.cpp)
+target_link_libraries(flacdiff
+ FLACXX-static
+ $<TARGET_NAME_IF_EXISTS:win_utf8_io>) \ No newline at end of file
diff --git a/src/utils/flactimer/CMakeLists.txt b/src/utils/flactimer/CMakeLists.txt
new file mode 100644
index 00000000..d40de89c
--- /dev/null
+++ b/src/utils/flactimer/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(flactimer main.cpp)
+target_link_libraries(flactimer FLACXX-static)