cmake_minimum_required(VERSION 3.2) project(MuzGenLib) configure_file( conf.in.hpp ${CMAKE_SOURCE_DIR}/lib/conf.hpp ) add_library(muz-lib OBJECT # Audio # ===== Signal.cpp AudioEngine.cpp AudioConf.cpp # signals # ------- Constant.cpp Sine.cpp Noise.cpp # Language # ======== Node.cpp Lexer.cpp Parser.cpp Compiler.cpp ) set_property(TARGET muz-lib PROPERTY CXX_STANDARD 17 ) find_package(PkgConfig REQUIRED) pkg_check_modules(PortAudio portaudio-2.0 IMPORTED_TARGET REQUIRED) target_compile_options(muz-lib PUBLIC -Wall -Wextra ) target_link_libraries(muz-lib PUBLIC PkgConfig::PortAudio ) if (CMAKE_BUILD_TYPE STREQUAL Debug) target_compile_options(muz-lib PRIVATE --coverage ) target_link_options(muz-lib PUBLIC --coverage ) find_program(LCOV_PATH lcov REQUIRED) find_program(GENHTML_PATH genhtml REQUIRED) add_custom_target(cov COMMAND ${LCOV_PATH} -d . --zerocounters COMMAND $ COMMAND ${LCOV_PATH} -d . --capture -o cov.info COMMAND ${LCOV_PATH} -r cov.info '/usr/include/*' -o cov.info COMMAND ${LCOV_PATH} -r cov.info '*.hpp' -o cov.info COMMAND ${GENHTML_PATH} --legend -o cov_html cov.info ) endif()