<commit_before>cmake_minimum_required(VERSION 2.8.11)

project(csapex)

## Check the build type
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "build type, options: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
    message("No CMAKE_BUILD_TYPE specified, defaulting to ${CMAKE_BUILD_TYPE}")
endif(NOT CMAKE_BUILD_TYPE)

## Add our own cmake subdirectory
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(cmake/csapex-extras.cmake)

## Enable warnings
add_definitions(-W -Wall)

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS utils_param utils_qt class_loader)

find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Boost COMPONENTS program_options filesystem system regex REQUIRED)

set(YAML_LIBRARIES -L/usr/local/lib/ yaml-cpp)

find_package(OpenGL REQUIRED)
find_package(TinyXML REQUIRED)
find_package(Qt5 COMPONENTS OpenGL REQUIRED)
find_package(console_bridge REQUIRED)

set(CMAKE_AUTOMOC ON)
qt5_add_resources(QT_RESOURCES res/csapex_resources.qrc)
qt5_wrap_ui(QT_UI
    ui/box.ui
    ui/csapex_window.ui
    ui/design_board.ui
    ui/designer.ui)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
   INCLUDE_DIRS include
   CATKIN_DEPENDS utils_param utils_qt
   DEPENDS Boost console_bridge
   CFG_EXTRAS csapex-extras.cmake
)

#
# CCACHE
#
set(USE_CCACHE 0 CACHE BOOL "optimize compile using ccache?")
if(${USE_CCACHE})
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()

###########
## INFO  ##
###########
# Get the current working branch
execute_process(
  COMMAND git rev-parse --abbrev-ref HEAD
  WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  OUTPUT_VARIABLE GIT_BRANCH
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Get the latest abbreviated commit hash of the working branch
execute_process(
  COMMAND git log -1 --format=%h
  WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  OUTPUT_VARIABLE GIT_COMMIT_HASH
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

# generate meta infos
set(INFO_H ${CMAKE_CURRENT_LIST_DIR}/include/csapex/info.h)
set(INFO ${INFO_H}.tmp)

file(WRITE ${INFO} "namespace csapex {\nnamespace info {\n")

file(APPEND ${INFO} "static const std::string GIT_COMMIT_HASH { \"${GIT_COMMIT_HASH}\" };\n")
file(APPEND ${INFO} "static const std::string GIT_BRANCH { \"${GIT_BRANCH}\" };\n")
file(APPEND ${INFO} "static const std::string MAINTAINER { \"${csapex_MAINTAINER}\" };\n")
file(APPEND ${INFO} "static const std::string VERSION { \"${csapex_VERSION}\" };\n")
file(APPEND ${INFO} "static const std::string CSAPEX_BOOT_PLUGIN_DIR { \"${CSAPEX_BOOT_PLUGIN_DIR}\" };\n")
file(APPEND ${INFO} "static const std::string CSAPEX_VERSION { \"${csapex_VERSION}\" };\n")

file(APPEND ${INFO} "}\n}\n\n")

execute_process(COMMAND bash -c "if [[ `diff info.h.tmp info.h` ]]; then mv info.h.tmp info.h; else rm info.h.tmp; fi"
                WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/csapex/)

###########
## Build ##
###########

include_directories(include
    ${catkin_INCLUDE_DIRS}
    ${OPENGL_INCLUDE_DIR}
    ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
)

#<commit_msg>minor<commit_after>cmake_minimum_required(VERSION 2.8.11)

project(csapex)

## Check the build type
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "build type, options: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
    message("No CMAKE_BUILD_TYPE specified, defaulting to ${CMAKE_BUILD_TYPE}")
endif(NOT CMAKE_BUILD_TYPE)

## Add our own cmake subdirectory
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(cmake/csapex-extras.cmake)

## Enable warnings
add_definitions(-W -Wall)

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS utils_param utils_qt class_loader)

find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
find_package(Boost COMPONENTS program_options filesystem system regex REQUIRED)

set(YAML_LIBRARIES -L/usr/local/lib/ yaml-cpp)

find_package(OpenGL REQUIRED)
find_package(TinyXML REQUIRED)
find_package(Qt5 COMPONENTS OpenGL REQUIRED)
find_package(console_bridge REQUIRED)

set(CMAKE_AUTOMOC ON)
qt5_add_resources(QT_RESOURCES res/csapex_resources.qrc)
qt5_wrap_ui(QT_UI
    ui/box.ui
    ui/csapex_window.ui
    ui/design_board.ui
    ui/designer.ui)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
   INCLUDE_DIRS include
   CATKIN_DEPENDS utils_param utils_qt
   DEPENDS Boost console_bridge
   CFG_EXTRAS csapex-extras.cmake
)

#
# CCACHE
#
set(USE_CCACHE 0 CACHE BOOL "optimize compile using ccache?")
if(${USE_CCACHE})
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()

###########
## INFO  ##
###########
# Get the current working branch
execute_process(
  COMMAND git rev-parse --abbrev-ref HEAD
  WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  OUTPUT_VARIABLE GIT_BRANCH
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Get the latest abbreviated commit hash of the working branch
execute_process(
  COMMAND git log -1 --format=%h
  WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
  OUTPUT_VARIABLE GIT_COMMIT_HASH
  OUTPUT_STRIP_TRAILING_WHITESPACE
)

# generate meta infos
set(INFO_H ${CMAKE_CURRENT_LIST_DIR}/include/csapex/info.h)
set(INFO ${INFO_H}.tmp)

file(WRITE ${INFO} "namespace csapex {\nnamespace info {\n")

file(APPEND ${INFO} "static const std::string GIT_COMMIT_HASH { \"${GIT_COMMIT_HASH}\" };\n")
file(APPEND ${INFO} "static const std::string GIT_BRANCH { \"${GIT_BRANCH}\" };\n")
file(APPEND ${INFO} "static const std::string MAINTAINER { \"${csapex_MAINTAINER}\" };\n")
file(APPEND ${INFO} "static const std::string VERSION { \"${csapex_VERSION}\" };\n")
file(APPEND ${INFO} "static const std::string CSAPEX_BOOT_PLUGIN_DIR { \"${CSAPEX_BOOT_PLUGIN_DIR}\" };\n")
file(APPEND ${INFO} "static const std::string CSAPEX_VERSION { \"${csapex_VERSION}\" };\n")

file(APPEND ${INFO} "}\n}\n\n")

execute_process(COMMAND bash -c "if [[ ! -f info.h  ]] || [[ `diff info.h.tmp info.h` ]]; then mv info.h.tmp info.h; else rm info.h.tmp; fi"
                WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/csapex/)

###########
## Build ##
###########

include_directories(include
    ${catkin_INCLUDE_DIRS}
    ${OPENGL_INCLUDE_DIR}
    ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}
)

#
{'fraction_non_alphanumeric': 0.1298886298886299, 'fraction_numerical': 0.003367003367003367, 'mean_word_length': 6.258458646616542, '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': '3918327', 'n_tokens_mistral': 2837, 'n_tokens_neox': 2698, 'n_words': 618}