<commit_before>cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)

set(modipulate_path ${CMAKE_SOURCE_DIR}/src/modipulate)
set(libopenmpt_path ${modipulate_path}/libopenmpt-forked)
set(modipulatelua_path ${CMAKE_SOURCE_DIR}/src/modipulate_lua)
set(modipulateosc_path ${CMAKE_SOURCE_DIR}/src/modipulate-osc)
set(oscpkt_path ${modipulateosc_path}/oscpkt)
set(demo_path ${CMAKE_SOURCE_DIR}/demos)

project(modipulate)

find_package(portaudio REQUIRED)
find_package(Vorbis REQUIRED)
find_package(Lua51)
find_package(Threads)

include_directories(${PORTAUDIO_INCLUDE_DIRS})
include_directories(${VORBIS_INCLUDE_DIR})
include_directories(${OGG_INCLUDE_DIR})
include_directories(${libopenmpt_path}
    ${libopenmpt_path}/common
    ${libopenmpt_path}/libopenmpt
    ${libopenmpt_path}/include
    ${modipulate_path}
)

if (UNIX AND NOT APPLE)
    # -fPIC for Linux
    add_definitions(-fPIC)
endif()

# Needed for clang -- TODO: replace with actual Clang check instead of APPLE
if (APPLE)
    set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
endif (APPLE)

# Removes a filename from a list
function(remove_from_list haystack needle)
    SET(i 0)
    foreach(entry ${${haystack}})
        if (entry MATCHES "(${needle})$")
            list(REMOVE_AT ${haystack} ${i})
            break()
        endif ()
        MATH(EXPR i "${i} + 1")
    endforeach()
    set(${haystack} ${${haystack}} PARENT_SCOPE)
endfunction(remove_from_list)


# libopenmpt-forked
add_definitions( -DLIBOPENMPT_BUILD )
add_definitions( -DNO_LIBMODPLUG )
file(GLOB libopenmpt_sources
    "${libopenmpt_path}/common/*.c*"
    "${libopenmpt_path}/include/miniz/miniz.*"
    "${libopenmpt_path}/include/miniz/timer.*"
    "${libopenmpt_path}/include/miniz/tinfl.*"
    "${libopenmpt_path}/libopenmpt/*.c*"
    "${libopenmpt_path}/soundlib/*.c*"
    "${libopenmpt_path}/soundlib/plugins/*.c*"
    "${libopenmpt_path}/soundlib/Tunings/*.c*"
)
add_library(libopenmpt-forked STATIC ${libopenmpt_sources})

message(status "portaudio libraries" ${PORTAUDIO_LIBRARIES})
message(status "vorbis libraries" ${VORBIS_LIBRARIES})
message(status "ogg libraries" ${OGG_LIBRARY})

set_target_properties(libopenmpt-forked PROPERTIES PREFIX "")
target_link_libraries(libopenmpt-forked<commit_msg>- Ogg package was... not actually being found. - Capitalized STATUS mode in CMake messages (previously just printed "status").<commit_after>cmake_minimum_required(VERSION 2.6)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)

set(modipulate_path ${CMAKE_SOURCE_DIR}/src/modipulate)
set(libopenmpt_path ${modipulate_path}/libopenmpt-forked)
set(modipulatelua_path ${CMAKE_SOURCE_DIR}/src/modipulate_lua)
set(modipulateosc_path ${CMAKE_SOURCE_DIR}/src/modipulate-osc)
set(oscpkt_path ${modipulateosc_path}/oscpkt)
set(demo_path ${CMAKE_SOURCE_DIR}/demos)

project(modipulate)

find_package(portaudio REQUIRED)
find_package(Vorbis REQUIRED)
find_package(Ogg REQUIRED)
find_package(Lua51)
find_package(Threads)

include_directories(${PORTAUDIO_INCLUDE_DIRS})
include_directories(${VORBIS_INCLUDE_DIR})
include_directories(${OGG_INCLUDE_DIR})
include_directories(${libopenmpt_path}
    ${libopenmpt_path}/common
    ${libopenmpt_path}/libopenmpt
    ${libopenmpt_path}/include
    ${modipulate_path}
)

if (UNIX AND NOT APPLE)
    # -fPIC for Linux
    add_definitions(-fPIC)
endif()

# Needed for clang -- TODO: replace with actual Clang check instead of APPLE
if (APPLE)
    set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
endif (APPLE)

# Removes a filename from a list
function(remove_from_list haystack needle)
    SET(i 0)
    foreach(entry ${${haystack}})
        if (entry MATCHES "(${needle})$")
            list(REMOVE_AT ${haystack} ${i})
            break()
        endif ()
        MATH(EXPR i "${i} + 1")
    endforeach()
    set(${haystack} ${${haystack}} PARENT_SCOPE)
endfunction(remove_from_list)


# libopenmpt-forked
add_definitions( -DLIBOPENMPT_BUILD )
add_definitions( -DNO_LIBMODPLUG )
file(GLOB libopenmpt_sources
    "${libopenmpt_path}/common/*.c*"
    "${libopenmpt_path}/include/miniz/miniz.*"
    "${libopenmpt_path}/include/miniz/timer.*"
    "${libopenmpt_path}/include/miniz/tinfl.*"
    "${libopenmpt_path}/libopenmpt/*.c*"
    "${libopenmpt_path}/soundlib/*.c*"
    "${libopenmpt_path}/soundlib/plugins/*.c*"
    "${libopenmpt_path}/soundlib/Tunings/*.c*"
)
add_library(libopenmpt-forked STATIC ${libopenmpt_sources})

message(STATUS "library path: " ${CMAKE_LIBRARY_PATH})
message(STATUS "portaudio libraries: " ${PORTAUDIO_LIBRARIES})
message(STATUS "vorbis libraries: " ${VORBIS_LIBRARIES})
message(STATUS "ogg libraries: " ${OGG_LIBRARY})

set_target_properties(libopenmpt-forked PROPERTIES PREFIX "")
target_link_libraries(libopenmpt-forked
{'fraction_non_alphanumeric': 0.135423197492163, 'fraction_numerical': 0.003343782654127482, 'mean_word_length': 5.856733524355301, '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': '5780679', 'n_tokens_mistral': 1870, 'n_tokens_neox': 1751, 'n_words': 274}