<commit_before>IF ( NOT CMAKE_BUILD_TYPE )
  SET( CMAKE_BUILD_TYPE Release )
  MESSAGE( "Setting build type to '${CMAKE_BUILD_TYPE}'" )
ELSE ( NOT CMAKE_BUILD_TYPE )
  MESSAGE( "Build type set to '${CMAKE_BUILD_TYPE}' by user." )
ENDIF ( NOT CMAKE_BUILD_TYPE )

INCLUDE(RPATHHandling)
CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/orocos")

#
# Check for Doxygen and enable documentation building
#
FIND_PACKAGE( Doxygen )
IF ( DOXYGEN )
  MESSAGE( "Found Doxygen -- documentation can be built" )

ELSE ( DOXYGEN )
  MESSAGE( "Doxygen not found -- unable to build documentation" )
ENDIF ( DOXYGEN )

INCLUDE(DependentOption)
DEPENDENT_OPTION( DOC_GENERATE_API "Build API Documentation" OFF "DOXYGEN" OFF )


#
# An option for tests, to make it easy to turn off all tests
#
OPTION( BUILD_TESTS "Turn me off to disable compilation of all tests" OFF )

FIND_PACKAGE(OrocosRTT REQUIRED)
<% if component.toolkit && component.toolkit.corba_enabled? %>
FIND_PACKAGE(OrocosCORBA REQUIRED COMPONENTS Toolkit)
<% elsif component.corba_enabled? %>
FIND_PACKAGE(OrocosCORBA REQUIRED)
<% end %>

SET(OROCOS_COMPONENT_INCLUDE ${OROCOS_RTT_INCLUDE_DIRS})
SET(OROCOS_COMPONENT_LIBRARIES ${OROCOS_RTT_LIBS} )

IF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit)
    ADD_SUBDIRECTORY( ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit )
    INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit")
    SET(OROCOS_COMPONENT_LIBRARIES ${OROCOS_COMPONENT_LIBRARIES} ${CMAKE_PROJECT_NAME}-toolkit-${OROCOS_TARGET})
ENDIF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit)

INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR})

<% component.used_toolkits.each do |name| %>
    PKGCONFIG( <%= name %>-toolkit-${OROCOS_TARGET}
	<%= name %>_TOOLKIT_DIR <%= name %>_TOOLKIT_INCLUDE_DIR 
	<%= name %>_TOOLKIT_DEFINES <%= name %>_TOOLKIT_LINK_DIR 
	<%= name %>_TOOLKIT_LIBS )
    INCLUDE_DIRECTORIES(${<%= name %>_TOOLKIT_INCLUDE_DIR})
    LINK_DIRECTORIES(${<%= name %>_TOOLKIT_LINK_DIR})
<% end %>

<% if !component.tasks.empty? %>
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/tasks)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/tasks)
<% end %>

ADD_EXECUTABLE(<%= component.name %> ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/main.cpp)
TARGET_LINK_LIBRARIES(<%= component.name %> ${OROCOS_COMPONENT_LIBRARIES})

<% component.used_toolkits.each do |name| %>
    TARGET_LINK_LIBRARIES(<%= component.name %> ${<%= name %>_TOOLKIT_LIBS})
<% end %>
<% if !component.tasks.empty? %>
TARGET_LINK_LIBRARIES(<%= component.name %> <%= component.name %>-tasks-${OROCOS_TARGET})
<% end %>
<% if component.corba_enabled? %>
TARGET_LINK_LIBRARIES(<%= component.name %> ${OrocosCORBA_LIBS})
<% end %><commit_msg>[generation] install binaries<commit_after>IF ( NOT CMAKE_BUILD_TYPE )
  SET( CMAKE_BUILD_TYPE Release )
  MESSAGE( "Setting build type to '${CMAKE_BUILD_TYPE}'" )
ELSE ( NOT CMAKE_BUILD_TYPE )
  MESSAGE( "Build type set to '${CMAKE_BUILD_TYPE}' by user." )
ENDIF ( NOT CMAKE_BUILD_TYPE )

INCLUDE(RPATHHandling)
CMAKE_USE_FULL_RPATH("${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/lib/orocos")

#
# Check for Doxygen and enable documentation building
#
FIND_PACKAGE( Doxygen )
IF ( DOXYGEN )
  MESSAGE( "Found Doxygen -- documentation can be built" )

ELSE ( DOXYGEN )
  MESSAGE( "Doxygen not found -- unable to build documentation" )
ENDIF ( DOXYGEN )

INCLUDE(DependentOption)
DEPENDENT_OPTION( DOC_GENERATE_API "Build API Documentation" OFF "DOXYGEN" OFF )


#
# An option for tests, to make it easy to turn off all tests
#
OPTION( BUILD_TESTS "Turn me off to disable compilation of all tests" OFF )

FIND_PACKAGE(OrocosRTT REQUIRED)
<% if component.toolkit && component.toolkit.corba_enabled? %>
FIND_PACKAGE(OrocosCORBA REQUIRED COMPONENTS Toolkit)
<% elsif component.corba_enabled? %>
FIND_PACKAGE(OrocosCORBA REQUIRED)
<% end %>

SET(OROCOS_COMPONENT_INCLUDE ${OROCOS_RTT_INCLUDE_DIRS})
SET(OROCOS_COMPONENT_LIBRARIES ${OROCOS_RTT_LIBS} )

IF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit)
    ADD_SUBDIRECTORY( ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit )
    INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit")
    SET(OROCOS_COMPONENT_LIBRARIES ${OROCOS_COMPONENT_LIBRARIES} ${CMAKE_PROJECT_NAME}-toolkit-${OROCOS_TARGET})
ENDIF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/toolkit)

INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR})

<% component.used_toolkits.each do |name| %>
    PKGCONFIG( <%= name %>-toolkit-${OROCOS_TARGET}
	<%= name %>_TOOLKIT_DIR <%= name %>_TOOLKIT_INCLUDE_DIR 
	<%= name %>_TOOLKIT_DEFINES <%= name %>_TOOLKIT_LINK_DIR 
	<%= name %>_TOOLKIT_LIBS )
    INCLUDE_DIRECTORIES(${<%= name %>_TOOLKIT_INCLUDE_DIR})
    LINK_DIRECTORIES(${<%= name %>_TOOLKIT_LINK_DIR})
<% end %>

<% if !component.tasks.empty? %>
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/tasks)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/tasks)
<% end %>

ADD_EXECUTABLE(<%= component.name %> ${CMAKE_SOURCE_DIR}/<%= Generation::AUTOMATIC_AREA_NAME %>/main.cpp)
TARGET_LINK_LIBRARIES(<%= component.name %> ${OROCOS_COMPONENT_LIBRARIES})

<% component.used_toolkits.each do |name| %>
    TARGET_LINK_LIBRARIES(<%= component.name %> ${<%= name %>_TOOLKIT_LIBS})
<% end %>
<% if !component.tasks.empty? %>
TARGET_LINK_LIBRARIES(<%= component.name %> <%= component.name %>-tasks-${OROCOS_TARGET})
<% end %>
<% if component.corba_enabled? %>
TARGET_LINK_LIBRARIES(<%= component.name %> ${OrocosCORBA_LIBS})
<% end %>

INSTALL(TARGETS <%= component.name %>
    RUNTIME DESTINATION bin)
{'fraction_non_alphanumeric': 0.14372061786433848, 'fraction_numerical': 0.0, 'mean_word_length': 6.92154255319149, 'pattern_counts': {'":': 0, '<': 74, '<?xml version=': 0, '>': 74, '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': '4932875', 'n_tokens_mistral': 2530, 'n_tokens_neox': 2204, 'n_words': 391}