<commit_before># cmake -DCMAKE_INSTALL_PREFIX=<your installation dir> <path>
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
INCLUDE(SiconosProject)

SET(EXAMPLES_DIRECTORIES
  Electronics
  Mechanics
  Mechanics/3DBeads
  Robotics/HuMAns_pa10
  Control/ObserverLCS
  Control/Two-linkManipulator
)

SET(NO_TEST_FILES
  Mechanics/3DBeads/Billard/draw_billard.cpp
  Mechanics/3DBeads/Beads_Couple/Draw_NLM.cpp
  Mechanics/3DBeads/Beads_Couple/Draw_NLM.cpp
  Mechanics/3DBeads/Block_Beads/Draw_block_beads.cpp
  Mechanics/3DBeads/Canon/main.cpp)

SICONOS_PROJECT(Examples 3 0 0)

#
# Internals
#

SET(SICCOM "${CMAKE_INSTALL_PREFIX}/bin/siconos")

SET(SICWRAP ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/Siconos/wrap)

FILE(WRITE ${SICWRAP}
  "cd ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/Siconos/; ${SICCOM} $@")

ENABLE_TESTING()

MACRO(ADD_EXAMPLE _N _EX)
  MESSAGE("Adding example ${_N} (${_EX})")
  ADD_TEST(${_N} /bin/sh -x ${SICWRAP} ${_EX})
ENDMACRO(ADD_EXAMPLE _EX _N)

FOREACH(_D ${EXAMPLES_DIRECTORIES})
  FILE(GLOB EXAMPLES_P ${CMAKE_SOURCE_DIR}/${_D}/*/*.cpp )
  IF(EXAMPLES_P)
    FOREACH(_P ${EXAMPLES_P})
      GET_FILENAME_COMPONENT(_RP ${_P} ABSOLUTE)
      LIST(APPEND EXAMPLES ${_RP})
    ENDFOREACH(_P ${EXAMPLES_P})
  ENDIF(EXAMPLES_P)
ENDFOREACH(_D ${EXAMPLES_DIRECTORIES})

FOREACH(EXAMPLE ${EXAMPLES})
  IF(NOT EXAMPLE MATCHES Plugin)
    SET(TEST_ME TRUE)
    FOREACH(_NT ${NO_TEST_FILES})
      IF(EXAMPLE MATCHES "${_NT}")
        SET(TEST_ME FALSE)
      ENDIF(EXAMPLE MATCHES "${_NT}")
    ENDFOREACH(_NT ${NO_TEST_FILES})
    IF(TEST_ME)
      GET_FILENAME_COMPONENT(EXAMPLE_NAME ${EXAMPLE} NAME_WE)
      ADD_EXAMPLE(${EXAMPLE_NAME} ${EXAMPLE})
    ENDIF(TEST_ME)
  ENDIF(NOT EXAMPLE MATCHES Plugin)
ENDFOREACH(EXAMPLE ${EXAMPLES})<commit_msg>compilation status (=> cdash) runtime siconos exception detected.<commit_after># cmake -DCMAKE_INSTALL_PREFIX=<your installation dir> <path>
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
INCLUDE(SiconosProject)

SET(EXAMPLES_DIRECTORIES
  Control
  Electronics
  Mechanics
  Robotics/HuMAns_pa10
)

SET(NO_TEST_FILES)

SICONOS_PROJECT(Examples 3 0 0)

#
# Internals
#

SET(CMAKE_SICONOS_COMPILE_OBJECT "${CMAKE_INSTALL_PREFIX}/bin/siconos -noexec <SOURCE>")
SET(CMAKE_SICONOS_LINK_EXECUTABLE "")

ENABLE_TESTING()

MACRO(ADD_EXAMPLE _N _EX)
  MESSAGE("Adding example ${_N} (${_EX})")
  ADD_TEST(${_N} ${_EX})
  SET_TESTS_PROPERTIES(${_N} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILURE;Runtime Exception;SiconosException")
ENDMACRO(ADD_EXAMPLE _N _EX)

FOREACH(_D ${EXAMPLES_DIRECTORIES})
  FILE(GLOB EXAMPLES_P ${CMAKE_SOURCE_DIR}/${_D}/*/*.cpp )
  IF(EXAMPLES_P)
    FOREACH(_P ${EXAMPLES_P})
      GET_FILENAME_COMPONENT(_RP ${_P} ABSOLUTE)
      LIST(APPEND EXAMPLES ${_RP})
    ENDFOREACH(_P ${EXAMPLES_P})
  ENDIF(EXAMPLES_P)
ENDFOREACH(_D ${EXAMPLES_DIRECTORIES})

FOREACH(EXAMPLE ${EXAMPLES})
  IF(NOT EXAMPLE MATCHES Plugin)
    SET(TEST_ME TRUE)
    FOREACH(_NT ${NO_TEST_FILES})
      IF(EXAMPLE MATCHES "${_NT}")
        SET(TEST_ME FALSE)
      ENDIF(EXAMPLE MATCHES "${_NT}")
    ENDFOREACH(_NT ${NO_TEST_FILES})
    IF(TEST_ME)
      GET_FILENAME_COMPONENT(EXAMPLE_NAME ${EXAMPLE} NAME_WE)
      SET_SOURCE_FILES_PROPERTIES(${EXAMPLE} PROPERTIES LANGUAGE SICONOS)
      ADD_EXECUTABLE(${EXAMPLE_NAME} ${EXAMPLE})
      ADD_EXAMPLE(${EXAMPLE_NAME} ${EXAMPLE_NAME})
    ENDIF(TEST_ME)
  ENDIF(NOT EXAMPLE MATCHES Plugin)
ENDFOREACH(EXAMPLE ${EXAMPLES})
{'fraction_non_alphanumeric': 0.12538918765921314, 'fraction_numerical': 0.005660911406736484, 'mean_word_length': 5.796153846153846, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, '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': '734705', 'n_tokens_mistral': 1574, 'n_tokens_neox': 1485, 'n_words': 214}