<commit_before>####################################################################
#   Project configuration
####################################################################
cmake_minimum_required(VERSION 3.0)

project (OpenRhythm)
set     (OpenRhythm_VERSION_MAJOR 0)
set     (OpenRhythm_VERSION_MINOR 1)

set(APPLE_APP_NAME "openrhythm.app")
set(LINUX_HOMEPATH ".openrhythm")

set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "" FORCE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
####################################################################
#   C++14 / C11 support and flags
####################################################################
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_STANDARD 11)
if(MSVC)
    add_definitions("/W4")
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
    add_definitions("-Wall")
    # Clean unused sections on link
    add_definitions("-ffunction-sections -fdata-sections -Wl,--gc-sections")
endif()

####################################################################
#   Platform detection and rules
####################################################################
set(PL_DEFAULT  0)
set(PL_WINDOWS  1)
set(PL_LINUX    2)
set(PL_OSX      3)

set(OSX_APP_BUNDLE 0)

## This is needed when cross-compiling
list(APPEND CMAKE_FIND_ROOT_PATH "${PROJECT_SOURCE_DIR}/extern")

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    message(STATUS "Building for Windows.")
    set(PLATFORM PL_WINDOWS)

    set(ENV{FREETYPE_DIR}   "${PROJECT_SOURCE_DIR}/extern/freetype")
    set(ENV{GLM_ROOT_DIR}   "${PROJECT_SOURCE_DIR}/extern/glm")
    set(ENV{OGG_ROOT}       "${PROJECT_SOURCE_DIR}/extern/ogg")
    set(ENV{SDL2DIR}        "${PROJECT_SOURCE_DIR}/extern/sdl2")
    set(ENV{VORBIS_ROOT}    "${PROJECT_SOURCE_DIR}/extern/vorbis")

    if(MSVC)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244")
    endif()

elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
    message(STATUS "Building for Linux.")
    set(PLATFORM PL_LINUX)

elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
    message(STATUS "Building for Mac OS X.")
    set(PLATFORM PL_OSX)

    if(NOT DEFINED ENV{NO_APP})
        set(OSX_APP_BUNDLE 1)
    endif()

else()
    message(STATUS "Platform not detected !")
    set(PLATFORM PL_DEFAULT)
    # Error and abort here ?
endif()


####################################################################
#   Libraries
####################################################################
# The *_ROOT variables specify the location of a local clone
# to be used if a system-wide library is not found

find_package(Freetype   REQUIRED)
find_package(Gettext    REQUIRED)
find_package(GLM        REQUIRED)
find_package(OggVorbis  REQUIRED)
find_package(OpenGL     REQUIRED)
find_package(SampleRate REQUIRED)
find_package(SDL2       REQUIRED)
set(ENV{SOUNDIO_ROOT}   "${PROJECT_SOURCE_DIR}/extern/soundio")
find_package(SoundIO    REQUIRED)
find_package(YamlCpp    REQUIRED)

add_definitions(-DUSE_LIB_PNGCPP=0)

add_library(GLAD STATIC ${CMAKE_CURRENT_SOURCE_DIR}/extern/glad/src/glad.c)
set_target_properties(GLAD PROPERTIES ARCHIVE_OUTPUT_DIRECTORY
    "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}")

set(LIBRARIES
      GLAD
    ${CMAKE_DL_LIBS}<commit_msg>again, stupid fix for libpngcpp in cmakelists<commit_after>####################################################################
#   Project configuration
####################################################################
cmake_minimum_required(VERSION 3.0)

project (OpenRhythm)
set     (OpenRhythm_VERSION_MAJOR 0)
set     (OpenRhythm_VERSION_MINOR 1)

set(APPLE_APP_NAME "openrhythm.app")
set(LINUX_HOMEPATH ".openrhythm")

set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "" FORCE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
####################################################################
#   C++14 / C11 support and flags
####################################################################
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_STANDARD 11)
if(MSVC)
    add_definitions("/W4")
elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
    add_definitions("-Wall")
    # Clean unused sections on link
    add_definitions("-ffunction-sections -fdata-sections -Wl,--gc-sections")
endif()

####################################################################
#   Platform detection and rules
####################################################################
set(PL_DEFAULT  0)
set(PL_WINDOWS  1)
set(PL_LINUX    2)
set(PL_OSX      3)

set(OSX_APP_BUNDLE 0)

## This is needed when cross-compiling
list(APPEND CMAKE_FIND_ROOT_PATH "${PROJECT_SOURCE_DIR}/extern")

if(CMAKE_SYSTEM_NAME MATCHES "Windows")
    message(STATUS "Building for Windows.")
    set(PLATFORM PL_WINDOWS)

    set(ENV{FREETYPE_DIR}   "${PROJECT_SOURCE_DIR}/extern/freetype")
    set(ENV{GLM_ROOT_DIR}   "${PROJECT_SOURCE_DIR}/extern/glm")
    set(ENV{OGG_ROOT}       "${PROJECT_SOURCE_DIR}/extern/ogg")
    set(ENV{SDL2DIR}        "${PROJECT_SOURCE_DIR}/extern/sdl2")
    set(ENV{VORBIS_ROOT}    "${PROJECT_SOURCE_DIR}/extern/vorbis")

    if(MSVC)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244")
    endif()

elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
    message(STATUS "Building for Linux.")
    set(PLATFORM PL_LINUX)

elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
    message(STATUS "Building for Mac OS X.")
    set(PLATFORM PL_OSX)

    if(NOT DEFINED ENV{NO_APP})
        set(OSX_APP_BUNDLE 1)
    endif()

else()
    message(STATUS "Platform not detected !")
    set(PLATFORM PL_DEFAULT)
    # Error and abort here ?
endif()


####################################################################
#   Libraries
####################################################################
# The *_ROOT variables specify the location of a local clone
# to be used if a system-wide library is not found

find_package(Freetype   REQUIRED)
find_package(Gettext    REQUIRED)
find_package(GLM        REQUIRED)
find_package(OggVorbis  REQUIRED)
find_package(OpenGL     REQUIRED)
find_package(SampleRate REQUIRED)
find_package(SDL2       REQUIRED)
set(ENV{SOUNDIO_ROOT}   "${PROJECT_SOURCE_DIR}/extern/soundio")
find_package(SoundIO    REQUIRED)
find_package(YamlCpp    REQUIRED)

set(USE_LIB_PNGCPP 0)

add_library(GLAD STATIC ${CMAKE_CURRENT_SOURCE_DIR}/extern/glad/src/glad.c)
set_target_properties(GLAD PROPERTIES ARCHIVE_OUTPUT_DIRECTORY
    "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}")

set(LIBRARIES
      GLAD
    ${CMAKE_DL_LIBS}
{'fraction_non_alphanumeric': 0.2533680342927128, 'fraction_numerical': 0.008266993263931415, 'mean_word_length': 6.078006500541711, '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': '3252134', 'n_tokens_mistral': 2277, 'n_tokens_neox': 2118, 'n_words': 376}