<commit_before>cmake_minimum_required(VERSION 2.6)
project(Aquila CXX)

set(Aquila_VERSION_MAJOR 3)
set(Aquila_VERSION_MINOR 0)
set(Aquila_VERSION_PATCH 0)
set(Aquila_VERSION_SUFFIX "-dev")


################################################################################
#
# Build options
#
################################################################################

set(Aquila_BUILD_EXAMPLES ON CACHE BOOL "Build example programs?" FORCE)
set(Aquila_BUILD_TESTS ON CACHE BOOL "Build test programs?" FORCE)


################################################################################
#
# Dependencies
#
################################################################################

# libraries bundled with Aquila
add_subdirectory(lib)
set(Aquila_LIBRARIES_TO_LINK_WITH Ooura_fft)

# additional CMake modules
set(CMAKE_MODULE_PATH "${Aquila_SOURCE_DIR}/cmake")

# SFML - if available
#set(SFML_STATIC true)
find_package(SFML COMPONENTS System Audio)
if(SFML_FOUND)
    message("SFML was found, wrappers and examples using SFML will be built.")
    include_directories(${SFML_INCLUDE_DIR})
    list(APPEND Aquila_LIBRARIES_TO_LINK_WITH ${SFML_LIBRARY})
else(SFML_FOUND)
    message(WARNING "SFML was not found, wrappers and examples using SFML will not be built.")
endif(SFML_FOUND)


################################################################################
#
# Aquila sources
#
################################################################################

# library headers
set(Aquila_HEADERS
    aquila/global.h
    aquila/functions.h
    aquila/Exceptions.h
    aquila/source/SignalSource.h
    aquila/source/Frame.h
    aquila/source/FramesCollection.h
    aquila/source/ArrayData.h
    aquila/source/PlainTextFile.h
    aquila/source/RawPcmFile.h
    aquila/source/Sum.h
    aquila/source/WaveFile.h
    aquila/source/WaveFileHandler.h
    aquila/source/generator/Generator.h
    aquila/source/generator/SineGenerator.h
    aquila/source/generator/SquareGenerator.h
    aquila/source/generator/TriangleGenerator.h
    aquila/source/generator/PinkNoiseGenerator.h
    aquila/source/generator/WhiteNoiseGenerator.h
    aquila/transform/Fft.h
    aquila/transform/Dft.h
    aquila/transform/AquilaFft.h
    aquila/transform/OouraFft.h
    aquila/transform/FftFactory.h
    aquila/transform/Spectrogram.h
    aquila/transform/Window.h
    aquila/tools/TextPlot.h
)

# library sources
set(Aquila_SOURCES
    aquila/source/SignalSource.cpp
    aquila/source/Frame.cpp
    aquila/source/FramesCollection.cpp
    aquila/source/PlainTextFile.cpp
    aquila/source/WaveFile.cpp
    aquila/source/WaveFileHandler.cpp
    aquila/source/generator/Generator.cpp
    aquila/source/generator/SineGenerator.cpp
    aquila/source/generator/SquareGenerator.cpp
    aquila/source/generator/TriangleGenerator.cpp
    aquila/source/generator/PinkNoiseGenerator.cpp
    aquila/source/generator/WhiteNoiseGenerator.cpp
    aquila/transform/Dft.cpp
    aquila/transform/AquilaFft.cpp
    aquila/transform/OouraFft.cpp
    aquila/transform/FftFactory.cpp
    aquila/transform/Spectrogram.cpp
    aquila/transform/Window.cpp
    aquila/tools/TextPlot.cpp
)

# SFML wrappers
if(SFML_FOUND)
    list(APPEND Aquila_HEADERS
        aquila/wrappers/SoundBufferAdapter.h
        aquila/synth/Synthesizer.h
        aquila/synth/KarplusStrongSynthesizer.h
        aquila/synth/SineSynthesizer.h
    )
    list(APPEND Aquila_SOURCES
        aquila/wrappers/SoundBufferAdapter.cpp
        aquila/synth/Synthesizer.cpp
        aquila/synth/KarplusStrongSynthesizer.cpp
        aquila/synth/SineSynthesizer.cpp
    )
endif(SFML_FOUND)


################################################################################
#
# Compiler-specific workarounds
#
################################################################################

if(MSVC)
    # disable "strncpy is deprecated" warning and enable math constants
    add_definitions("/D_CRT_NONSTDC_NO_DEPRECATE /D_USE_MATH_DEFINES")
endif(MSVC)


if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -Wall -fprofile-arcs -ftest-coverage")
        include(CodeCoverage)
        setup_target_for_coverage(coverage aquila_test htmlcov)
    endif()
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

################################################################################
#
# Building and linking
#
################################################################################

# main Aquila library
add_library(Aquila ${Aquila_HEADERS} ${Aquila_SOURCES})

# linking with extra libs
target_link_libraries(Aquila ${Aquila_LIBRARIES_TO_LINK_WITH})

# examples
if(Aquila_BUILD_EXAMPLES)
    add_custom_target(examples)
    add_subdirectory(examples)
endif(Aquila_BUILD_EXAMPLES)<commit_msg>Link with libc++ on Mac OS X.<commit_after>cmake_minimum_required(VERSION 2.6)
project(Aquila CXX)

set(Aquila_VERSION_MAJOR 3)
set(Aquila_VERSION_MINOR 0)
set(Aquila_VERSION_PATCH 0)
set(Aquila_VERSION_SUFFIX "-dev")


################################################################################
#
# Build options
#
################################################################################

set(Aquila_BUILD_EXAMPLES ON CACHE BOOL "Build example programs?" FORCE)
set(Aquila_BUILD_TESTS ON CACHE BOOL "Build test programs?" FORCE)


################################################################################
#
# Dependencies
#
################################################################################

# libraries bundled with Aquila
add_subdirectory(lib)
set(Aquila_LIBRARIES_TO_LINK_WITH Ooura_fft)

# additional CMake modules
set(CMAKE_MODULE_PATH "${Aquila_SOURCE_DIR}/cmake")

# SFML - if available
#set(SFML_STATIC true)
find_package(SFML COMPONENTS System Audio)
if(SFML_FOUND)
    message("SFML was found, wrappers and examples using SFML will be built.")
    include_directories(${SFML_INCLUDE_DIR})
    list(APPEND Aquila_LIBRARIES_TO_LINK_WITH ${SFML_LIBRARY})
else(SFML_FOUND)
    message(WARNING "SFML was not found, wrappers and examples using SFML will not be built.")
endif(SFML_FOUND)


################################################################################
#
# Aquila sources
#
################################################################################

# library headers
set(Aquila_HEADERS
    aquila/global.h
    aquila/functions.h
    aquila/Exceptions.h
    aquila/source/SignalSource.h
    aquila/source/Frame.h
    aquila/source/FramesCollection.h
    aquila/source/ArrayData.h
    aquila/source/PlainTextFile.h
    aquila/source/RawPcmFile.h
    aquila/source/Sum.h
    aquila/source/WaveFile.h
    aquila/source/WaveFileHandler.h
    aquila/source/generator/Generator.h
    aquila/source/generator/SineGenerator.h
    aquila/source/generator/SquareGenerator.h
    aquila/source/generator/TriangleGenerator.h
    aquila/source/generator/PinkNoiseGenerator.h
    aquila/source/generator/WhiteNoiseGenerator.h
    aquila/transform/Fft.h
    aquila/transform/Dft.h
    aquila/transform/AquilaFft.h
    aquila/transform/OouraFft.h
    aquila/transform/FftFactory.h
    aquila/transform/Spectrogram.h
    aquila/transform/Window.h
    aquila/tools/TextPlot.h
)

# library sources
set(Aquila_SOURCES
    aquila/source/SignalSource.cpp
    aquila/source/Frame.cpp
    aquila/source/FramesCollection.cpp
    aquila/source/PlainTextFile.cpp
    aquila/source/WaveFile.cpp
    aquila/source/WaveFileHandler.cpp
    aquila/source/generator/Generator.cpp
    aquila/source/generator/SineGenerator.cpp
    aquila/source/generator/SquareGenerator.cpp
    aquila/source/generator/TriangleGenerator.cpp
    aquila/source/generator/PinkNoiseGenerator.cpp
    aquila/source/generator/WhiteNoiseGenerator.cpp
    aquila/transform/Dft.cpp
    aquila/transform/AquilaFft.cpp
    aquila/transform/OouraFft.cpp
    aquila/transform/FftFactory.cpp
    aquila/transform/Spectrogram.cpp
    aquila/transform/Window.cpp
    aquila/tools/TextPlot.cpp
)

# SFML wrappers
if(SFML_FOUND)
    list(APPEND Aquila_HEADERS
        aquila/wrappers/SoundBufferAdapter.h
        aquila/synth/Synthesizer.h
        aquila/synth/KarplusStrongSynthesizer.h
        aquila/synth/SineSynthesizer.h
    )
    list(APPEND Aquila_SOURCES
        aquila/wrappers/SoundBufferAdapter.cpp
        aquila/synth/Synthesizer.cpp
        aquila/synth/KarplusStrongSynthesizer.cpp
        aquila/synth/SineSynthesizer.cpp
    )
endif(SFML_FOUND)


################################################################################
#
# Compiler-specific workarounds
#
################################################################################

if(MSVC)
    # disable "strncpy is deprecated" warning and enable math constants
    add_definitions("/D_CRT_NONSTDC_NO_DEPRECATE /D_USE_MATH_DEFINES")
endif(MSVC)


if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -Wall -fprofile-arcs -ftest-coverage")
        include(CodeCoverage)
        setup_target_for_coverage(coverage aquila_test htmlcov)
    endif()
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    if(APPLE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
    endif()
endif()

################################################################################
#
# Building and linking
#
################################################################################

# main Aquila library
add_library(Aquila ${Aquila_HEADERS} ${Aquila_SOURCES})

# linking with extra libs
target_link_libraries(Aquila ${Aquila_LIBRARIES_TO_LINK_WITH})

# examples
if(Aquila_BUILD_EXAMPLES)
    add_custom_target(examples)
    add_subdirectory(examples)
endif(Aquila_BUILD_EXAMPLES)
{'fraction_non_alphanumeric': 0.23733892718010188, 'fraction_numerical': 0.0017980221756068325, 'mean_word_length': 5.172626387176326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3984220', 'n_tokens_mistral': 3317, 'n_tokens_neox': 3131, 'n_words': 442}