<commit_before># CMakeLists.txt: CMake用設定ファイル。
# Copyright (c) 2012 <NAME>
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# プロジェクト名。
PROJECT(MISAKI)

# Boostの確認と設定。
FIND_PACKAGE(Boost REQUIRED)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

# ソースとヘッダファイルのリスト。
FILE(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
FILE(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)

# デフォルトでリリース用のコンパイルに設定する。
IF(NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)

# リリース用のコンパイラのオプション設定。
IF(CMAKE_COMPILER_IS_GNUCC)
    SET(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -march=native")
    SET(CMAKE_C_FLAGSE_RELEASE "-DNDEBUG -O3 -march=native")
ENDIF(CMAKE_COMPILER_IS_GNUCC)

# デバッグ用のコンパイラオプションの設定
IF(CMAKE_COMPILER_IS_GNUCC)
    SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
    SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
    SET(CMAKE_CXX_FLAGS_PROFILE "-pg")
    SET(CMAKE_C_FLAGS_PROFILE "-pg")
    SET(CMAKE_LD_FLAGS_PROFILE "-lgmon")
ENDIF(CMAKE_COMPILER_IS_GNUCC)

# ビルド設定。
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
ADD_LIBRARY(misaki STATIC ${SRCS})
TARGET_LINK_LIBRARIES(misaki boost_thread)
ADD_DEPENDENCIES(misaki ${HEADERS})
ADD_CUSTOM_COMMAND(TARGET misaki POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E make_directory
    ${CMAKE_CURRENT_BINARY_DIR}/include/misaki)
FOREACH(H_FILE ${HEADERS})
    ADD_CUSTOM_COMMAND(TARGET misaki POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        ${H_FILE} ${CMAKE_CURRENT_BINARY_DIR}/include/misaki/)
ENDFOREACH(H_FILE ${HEADERS})
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
    ${CMAKE_CURRENT_BINARY_DIR}/include)

# CPackの設定。
SET(CPACK_PACKAGE_VERSION_MAJOR 1)
SET(CPACK_PACKAGE_VERSION_MINOR 2)
SET(CPACK_PACKAGE_VERSION_PATCH 6)
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "misaki-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")

# CPackを実行。
INCLUDE(CPack)

# make distで作るように設定を変える。
ADD_CUSTOM_TARGET(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)<commit_msg>CMakeLists.txtを修正<commit_after># CMakeLists.txt: CMake用設定ファイル。
# Copyright (c) 2012 <NAME>
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)

cmake_minimum_required(VERSION 2.8)

# プロジェクト名。
project(MISAKI)

# Boostの確認と設定。
find_package(Boost COMPONENTS thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

# ソースとヘッダファイルのリスト。
file(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)

# デフォルトでリリース用のコンパイルに設定する。
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)

# リリース用のコンパイラのオプション設定。
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -march=native")
set(CMAKE_C_FLAGSE_RELEASE "-DNDEBUG -O3 -march=native")

# デバッグ用のコンパイラオプションの設定
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_PROFILE "-pg")
set(CMAKE_C_FLAGS_PROFILE "-pg")
set(CMAKE_LD_FLAGS_PROFILE "-lgmon")

# ビルド設定。
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
add_library(misaki STATIC ${SRCS})
target_link_libraries(misaki ${Boost_LIBRARIES})
add_dependencies(misaki ${HEADERS})
add_custom_command(TARGET misaki POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E make_directory
    ${CMAKE_CURRENT_BINARY_DIR}/include/misaki)
foreach(H_FILE ${HEADERS})
    add_custom_command(TARGET misaki POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
        ${H_FILE} ${CMAKE_CURRENT_BINARY_DIR}/include/misaki/)
endforeach(H_FILE ${HEADERS})
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
    ${CMAKE_CURRENT_BINARY_DIR}/include)

# CPackの設定。
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 2)
set(CPACK_PACKAGE_VERSION_PATCH 6)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "misaki-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/;~$;${CPACK_SOURCE_IGNORE_FILES}")

# CPackを実行。
include(CPack)

# make distで作るように設定を変える。
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
{'fraction_non_alphanumeric': 0.0900064061499039, 'fraction_numerical': 0.004163997437540038, 'mean_word_length': 6.681426814268143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1820318', 'n_tokens_mistral': 2471, 'n_tokens_neox': 2318, 'n_words': 541}