From: Steve Lhomme Date: Sun, 16 Oct 2022 08:21:43 +0000 (+0200) Subject: add an option to build example code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b600d7f806476a430db3285222106fe3eaad7c75;p=libmatroska add an option to build example code Off by default. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a76e9a4..f4936d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ project(matroska VERSION 1.8.0) option(DISABLE_PKGCONFIG "Disable PkgConfig module generation" OFF) option(DISABLE_CMAKE_CONFIG "Disable CMake package config module generation" OFF) option(BUILD_SHARED_LIBS "Build libmatroska as a shared library" OFF) +option(BUILD_EXAMPLES "Build example code" OFF) find_package(EBML 2.0.0 REQUIRED) @@ -88,6 +89,20 @@ if(NOT BUILD_SHARED_LIBS) target_compile_definitions(matroska PUBLIC MATROSKA_STATIC_DEFINE) endif() +if(BUILD_EXAMPLES) + add_executable(test00 test/ebml/test00.cpp) + target_link_libraries(test00 matroska) + target_include_directories(test00 PRIVATE $) + + add_executable(test6 test/mux/test6.cpp) + target_link_libraries(test6 matroska) + target_include_directories(test6 PRIVATE $) + + add_executable(test8 test/mux/test8.cpp) + target_link_libraries(test8 matroska) + target_include_directories(test8 PRIVATE $) +endif() + install(TARGETS matroska EXPORT MatroskaTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}