<commit_before>cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(tachyon VERSION 0.1 LANGUAGES C CXX)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${tachyon_SOURCE_DIR}/cmake")

find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)


set(TACHYON_SOURCES
    src/glew.c
    src/core/context.cpp
    src/core/exception.cpp
    src/core/string.cpp
    src/platform/sdl_platform.cpp
    src/renderer/gl_program.cpp
    src/renderer/gl_renderer.cpp
    src/renderer/gl_shader.cpp
    src/renderer/image.cpp
)

if (NOT WIN32)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/windows/.+")
endif()

if (NOT APPLE)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/mac/.+")
endif()

if ((NOT UNIX) OR APPLE)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/linux/.+")
endif()

add_library(tachyon ${TACHYON_SOURCES})

target_include_directories(tachyon PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<BUILD_INTERFACE:${SDL2_INCLUDE_DIR}>
    $<BUILD_INTERFACE:${OPENGL_INCLUDE_DIR}>
    $<INSTALL_INTERFACE:include>
    PRIVATE src)

target_link_libraries(tachyon
    ${OPENGL_LIBRARIES}
    ${SDL2_LIBRARY})

if ((${CMAKE_COMPILER_IS_GNUCXX}) OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
    target_compile_options(tachyon PRIVATE
        -Wall -Werror -pedantic
        $<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
else()
    target_compile_options(tachyon PRIVATE
        /W3 /WX)
    target_compile_definitions(tachyon PRIVATE
        -D_CRT_SECURE_NO_WARNINGS -DGLEW_STATIC)
endif()

install(TARGETS tachyon EXPORT TachyonConfig
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
    RUNTIME DESTINATION bin)

install(DIRECTORY include/ DESTINATION include)

install(EXPORT TachyonConfig DESTINATION share/tachyon/cmake)
export(TARGETS tachyon FILE TachyonConfig.cmake)<commit_msg>ignore stb image indentation warnings<commit_after>cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(tachyon VERSION 0.1 LANGUAGES C CXX)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${tachyon_SOURCE_DIR}/cmake")

find_package(SDL2 REQUIRED)
find_package(OpenGL REQUIRED)


set(TACHYON_SOURCES
    src/glew.c
    src/core/context.cpp
    src/core/exception.cpp
    src/core/string.cpp
    src/platform/sdl_platform.cpp
    src/renderer/gl_program.cpp
    src/renderer/gl_renderer.cpp
    src/renderer/gl_shader.cpp
    src/renderer/image.cpp
)

if (NOT WIN32)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/windows/.+")
endif()

if (NOT APPLE)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/mac/.+")
endif()

if ((NOT UNIX) OR APPLE)
    list(FILTER TACHYON_SOURCES EXCLUDE REGEX ".+/linux/.+")
endif()

add_library(tachyon ${TACHYON_SOURCES})

target_include_directories(tachyon PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<BUILD_INTERFACE:${SDL2_INCLUDE_DIR}>
    $<BUILD_INTERFACE:${OPENGL_INCLUDE_DIR}>
    $<INSTALL_INTERFACE:include>
    PRIVATE src)

target_link_libraries(tachyon
    ${OPENGL_LIBRARIES}
    ${SDL2_LIBRARY})

if ((${CMAKE_COMPILER_IS_GNUCXX}) OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
    target_compile_options(tachyon PRIVATE
        -Wall -Werror -pedantic
        $<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)

    set_source_files_properties(src/renderer/image.cpp PROPERTIES COMPILE_FLAGS -Wno-misleading-indentation)
else()
    target_compile_options(tachyon PRIVATE
        /W3 /WX)
    target_compile_definitions(tachyon PRIVATE
        -D_CRT_SECURE_NO_WARNINGS -DGLEW_STATIC)
endif()

install(TARGETS tachyon EXPORT TachyonConfig
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
    RUNTIME DESTINATION bin)

install(DIRECTORY include/ DESTINATION include)

install(EXPORT TachyonConfig DESTINATION share/tachyon/cmake)
export(TARGETS tachyon FILE TachyonConfig.cmake)
{'fraction_non_alphanumeric': 0.10419989367357789, 'fraction_numerical': 0.006379585326953748, 'mean_word_length': 4.78923076923077, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1742653', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1411, 'n_words': 237}