<commit_before>CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)

set(PROJECT_NAME_STR booredis)
project(${PROJECT_NAME_STR})


# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")

set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})

# compile in debug mode
IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
      FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

if ("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
else()
  SET(LIB_SUFFIX "/${CMAKE_LIBRARY_ARCHITECTURE}")
endif()

#add extra search paths for libraries and includes
SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE STRING "Directory where lib will install")
SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")


SET (CMAKE_INSTALL_DIR "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME_STR}" CACHE PATH "The directory cmake fiels are installed in")

#We should not really install Findbooredis.cmake anywhere
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findbooredis.cmake.in
#               ${CMAKE_CURRENT_BINARY_DIR}/Findbooredis.cmake
#               @ONLY)
#INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/Findbooredis.cmake
#         DESTINATION "${CMAKE_ROOT}/Modules")


set(LIB_MAJOR_VERSION "0")
set(LIB_MINOR_VERSION "1")
set(LIB_PATCH_VERSION "3")

set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")

set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}" )

# pkg-config
IF (NOT WIN32)
  CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_STR}.pc.in
                  ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_STR}.pc
                  @ONLY)
  INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_STR}.pc
           DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
ENDIF (NOT WIN32)

# Project dependencies
find_package(Boost COMPONENTS thread system REQUIRED)

set(
COMMON_INCLUDES
${PROJECT_SOURCE_DIR}/src
${Boost_INCLUE_DIR}
)

set(
COMMON_LIBRARIES
${Boost_LIBRARIES}
)
include_directories(${COMMON_INCLUDES})

SET(PROJECT_LIB ${PROJECT_NAME_STR})

add_subdirectory(src)

CONFIGURE_FILE(
  "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

GET_TARGET_PROPERTY(LIB_OUT_NAME ${PROJECT_LIB} LOCATION)
GET_FILENAME_COMPONENT(LIB_OUT_NAME ${LIB_OUT_NAME} NAME)



install(FILES
        COPYING
        README
        DESTINATION "share/doc/lib${PROJECT_NAME_STR}"
)

ADD_CUSTOM_TARGET(uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")


# Provide booredis-config.cmake and booredis-config.version to be used by other applications
# ===============================

export(PACKAGE ${CMAKE_PROJECT_NAME})

# cmake-modules
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/booredis-config.cmake.in<commit_msg>fixes for Cmake versions > 3.0<commit_after>CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)

#For cmake version 3.0 and higher. See "cmake --help-policy CMP0026"
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0)
    cmake_policy(SET CMP0026 OLD)
endif()

#For cmake version 3.0 and higher. See "cmake --help-policy CMP0037"
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0)
    cmake_policy(SET CMP0037 OLD)
endif()

set(PROJECT_NAME_STR booredis)
project(${PROJECT_NAME_STR})


# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")

set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})

# compile in debug mode
IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
      FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

if ("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
else()
  SET(LIB_SUFFIX "/${CMAKE_LIBRARY_ARCHITECTURE}")
endif()

#add extra search paths for libraries and includes
SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE STRING "Directory where lib will install")
SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")


SET (CMAKE_INSTALL_DIR "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME_STR}" CACHE PATH "The directory cmake fiels are installed in")

#We should not really install Findbooredis.cmake anywhere
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/Findbooredis.cmake.in
#               ${CMAKE_CURRENT_BINARY_DIR}/Findbooredis.cmake
#               @ONLY)
#INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/Findbooredis.cmake
#         DESTINATION "${CMAKE_ROOT}/Modules")


set(LIB_MAJOR_VERSION "0")
set(LIB_MINOR_VERSION "1")
set(LIB_PATCH_VERSION "3")

set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")

set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}" )

# pkg-config
IF (NOT WIN32)
  CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_STR}.pc.in
                  ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_STR}.pc
                  @ONLY)
  INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_STR}.pc
           DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
ENDIF (NOT WIN32)

# Project dependencies
find_package(Boost COMPONENTS thread system REQUIRED)

set(
COMMON_INCLUDES
${PROJECT_SOURCE_DIR}/src
${Boost_INCLUE_DIR}
)

set(
COMMON_LIBRARIES
${Boost_LIBRARIES}
)
include_directories(${COMMON_INCLUDES})

SET(PROJECT_LIB ${PROJECT_NAME_STR})

add_subdirectory(src)

CONFIGURE_FILE(
  "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

 # TODO: Deprecate use of "LOCATION" (CMP0026)
GET_TARGET_PROPERTY(LIB_OUT_NAME ${PROJECT_LIB} LOCATION)
GET_FILENAME_COMPONENT(LIB_OUT_NAME ${LIB_OUT_NAME} NAME)



install(FILES
        COPYING
        README
        DESTINATION "share/doc/lib${PROJECT_NAME_STR}"
)

ADD_CUSTOM_TARGET(uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")


# Provide booredis-config.cmake and booredis-config.version to be used by other applications
# ===============================

export(PACKAGE ${CMAKE_PROJECT_NAME})

# cmake-modules
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/booredis-config.cmake.in
{'fraction_non_alphanumeric': 0.11828624650729587, 'fraction_numerical': 0.00776156473144986, 'mean_word_length': 5.995656894679696, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1593523', 'n_tokens_mistral': 2484, 'n_tokens_neox': 2332, 'n_words': 421}