cmake_minimum_required(VERSION 3.2) project( mossrose VERSION 0.1.0 ) include_directories(${CMAKE_SOURCE_DIR}/include) option(MOSSROSE_BUILD_EXAMPLES "Build the example programs" OFF) add_subdirectory(${CMAKE_SOURCE_DIR}/portaudio EXCLUDE_FROM_ALL) add_library(mossrose) add_subdirectory(${CMAKE_SOURCE_DIR}/src) set_target_properties(mossrose PROPERTIES C_STANDARD 99 CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic" VERSION ${PROJECT_VERSION} PUBLIC_HEADER src/mossrose.h ) target_link_libraries(mossrose portaudio) if (UNIX) target_link_libraries(mossrose pthread) endif() if (MOSSROSE_BUILD_EXAMPLES) add_custom_target(examples) add_subdirectory(${CMAKE_SOURCE_DIR}/examples) endif()