<commit_before># VTK examples now require CMake 2.0 or higher.
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
  MESSAGE(FATAL_ERROR "VTKExamples requires CMake 2.0 or higher.")
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)

# Choose behavior based on whether we are building inside the VTK tree.
IF(VTK_BINARY_DIR)
  # We are building in the VTK tree.  Add tests for some examples.
  # Test the build system examples.
  IF(BUILD_TESTING)
    # If multiple configuration types are available we must add the test
    # in a way that will use the configuration given for testing.  When
    # CTest 2.1 and higher is used to drive the tests it evaluates the
    # ADD_TEST commands stored in the test files using standard cmake
    # language evaluation.  The variable CTEST_CONFIGURATION_TYPE expands
    # to the configuration specified for testing (Debug, Release, etc.).
    # This variable must be stored in the test string and evaluated at
    # testing time, so the dollar must be stored in a way that will not be
    # evaluated immediately.  In CMake 2.1 and higher this can be done
    # with an escaped dollar but we must support older CMake versions
    # syntactically.  Since we do not know what tool will be used to drive
    # the tests (Dart, CTest <= 2.0, CTest > 2.0, etc.) we have to have a
    # special cache option "VTK_TEST_WITH_CTEST" to enable this feature.
    # Dashboard maintainers will have to set this option to properly run
    # these tests.

    # Default to single-configuration behavior.
    SET(VTK_EXAMPLE_TEST_CONFIG_TYPE)
    SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}")

    # Enable multi-configuration behavior if support is available.
    IF(CMAKE_CONFIGURATION_TYPES AND VTK_TEST_WITH_CTEST)
      SET(DOLLAR "$")
      IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.0)
        SET(VTK_EXAMPLE_TEST_CONFIG_TYPE -C "${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
        SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}/${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
      ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.0)
    ENDIF(CMAKE_CONFIGURATION_TYPES AND VTK_TEST_WITH_CTEST)

    # Add a test to build the vtkLocal example.
    ADD_TEST(Example-vtkLocal ${CMAKE_CTEST_COMMAND}
      ${VTK_EXAMPLE_TEST_CONFIG_TYPE}
      --build-and-test
      ${VTK_SOURCE_DIR}/Examples/Build/vtkLocal
      ${VTK_BINARY_DIR}/Examples/Build/vtkLocal
      --build-two-config
      --build-generator ${CMAKE_GENERATOR}
      --build-makeprogram ${MAKEPROGRAM}
      --build-project VTKLOCAL
      --build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
      --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
      --test-command "${VTK_BINARY_DIR}/Examples/Build/vtkLocal/bin/vtkLocalTest"
      )

    # Add a test to build the vtkMy example.
    ADD_TEST(Example-vtkMy ${CMAKE_CTEST_COMMAND}
      ${VTK_EXAMPLE_TEST_CONFIG_TYPE}
      --build-and-test
      ${VTK_SOURCE_DIR}/Examples/Build/vtkMy
      ${VTK_BINARY_DIR}/Examples/Build/vtkMy
      --build-two-config
      --build-generator ${CMAKE_GENERATOR}
      --build-makeprogram ${MAKEPROGRAM}
      --build-project VTKMY
      --build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
      --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
      --test-command "${VTK_BINARY_DIR}/Examples/Build/vtkMy/bin/vtkmyEx1"
      )
  ENDIF(BUILD_TESTING)

  # Build the examples as a separate project using a custom target.
  # Make sure it uses the same build configuration as VTK.
  IF(CMAKE_CONFIGURATION_TYPES)
    SET(VTKExamples_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
  ELSE(CMAKE_CONFIGURATION_TYPES)
    SET(VTKExamples_CONFIG_TYPE)
  ENDIF(CMAKE_CONFIGURATION_TYPES)
  ADD_CUSTOM_COMMAND(
    OUTPUT ${VTK_BINARY_DIR}/VTKExamples
    COMMAND ${CMAKE_CTEST_COMMAND}
    ARGS ${VTKExamples_CONFIG_TYPE}
         --build-and-test
         ${VTK_SOURCE_DIR}/Examples
         ${VTK_BINARY_DIR}/Examples/All
         --build-noclean
         --build-two-config
         --build-project VTKExamples
         --build-generator ${CMAKE_GENERATOR}
         --build-makeprogram ${MAKEPROGRAM}
         --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
                         -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
                         -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
                         -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
                         -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
                         -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL}
                         -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
                         -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
                         -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
                         -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
                         -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
                         -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL}
                         -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
                         -DEXECUTABLE_OUTPUT_PATH:PATH=${EXECUTABLE_OUTPUT_PATH}
                         -DLIBRARY_OUTPUT_PATH:PATH=${LIBRARY_OUTPUT_PATH}<commit_msg>ENH: Merge changes from main tree into VTK-5-0 branch. (cvs -q up -j1.28 -j1.29 Examples/CMakeLists.txt)<commit_after># VTK examples now require CMake 2.0 or higher.
CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
  MESSAGE(FATAL_ERROR "VTKExamples requires CMake 2.0 or higher.")
ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)

# Choose behavior based on whether we are building inside the VTK tree.
IF(VTK_BINARY_DIR)
  # We are building in the VTK tree.  Add tests for some examples.
  # Test the build system examples.
  IF(BUILD_TESTING)
    # If multiple configuration types are available we must add the test
    # in a way that will use the configuration given for testing.  When
    # CTest 2.1 and higher is used to drive the tests it evaluates the
    # ADD_TEST commands stored in the test files using standard cmake
    # language evaluation.  The variable CTEST_CONFIGURATION_TYPE expands
    # to the configuration specified for testing (Debug, Release, etc.).
    # This variable must be stored in the test string and evaluated at
    # testing time, so the dollar must be stored in a way that will not be
    # evaluated immediately.  In CMake 2.1 and higher this can be done
    # with an escaped dollar but we must support older CMake versions
    # syntactically.  Since we do not know what tool will be used to drive
    # the tests (Dart, CTest <= 2.0, CTest > 2.0, etc.) we have to have a
    # special cache option "VTK_TEST_WITH_CTEST" to enable this feature.
    # Dashboard maintainers will have to set this option to properly run
    # these tests.

    # Default to single-configuration behavior.
    SET(VTK_EXAMPLE_TEST_CONFIG_TYPE)
    SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}")

    # Enable multi-configuration behavior if support is available.
    IF(CMAKE_CONFIGURATION_TYPES AND VTK_TEST_WITH_CTEST)
      SET(DOLLAR "$")
      IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.0)
        SET(VTK_EXAMPLE_TEST_CONFIG_TYPE -C "${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
        SET(VTK_EXAMPLE_TEST_RUN_DIR "${EXECUTABLE_OUTPUT_PATH}/${DOLLAR}{CTEST_CONFIGURATION_TYPE}")
      ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.0)
    ENDIF(CMAKE_CONFIGURATION_TYPES AND VTK_TEST_WITH_CTEST)

    # Add a test to build the vtkLocal example.
    ADD_TEST(Example-vtkLocal ${CMAKE_CTEST_COMMAND}
      ${VTK_EXAMPLE_TEST_CONFIG_TYPE}
      --build-and-test
      ${VTK_SOURCE_DIR}/Examples/Build/vtkLocal
      ${VTK_BINARY_DIR}/Examples/Build/vtkLocal
      --build-two-config
      --build-generator ${CMAKE_GENERATOR}
      --build-makeprogram ${CMAKE_MAKE_PROGRAM}
      --build-project VTKLOCAL
      --build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
      --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
      --test-command "${VTK_BINARY_DIR}/Examples/Build/vtkLocal/bin/vtkLocalTest"
      )

    # Add a test to build the vtkMy example.
    ADD_TEST(Example-vtkMy ${CMAKE_CTEST_COMMAND}
      ${VTK_EXAMPLE_TEST_CONFIG_TYPE}
      --build-and-test
      ${VTK_SOURCE_DIR}/Examples/Build/vtkMy
      ${VTK_BINARY_DIR}/Examples/Build/vtkMy
      --build-two-config
      --build-generator ${CMAKE_GENERATOR}
      --build-makeprogram ${CMAKE_MAKE_PROGRAM}
      --build-project VTKMY
      --build-run-dir ${VTK_EXAMPLE_TEST_RUN_DIR}
      --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
      --test-command "${VTK_BINARY_DIR}/Examples/Build/vtkMy/bin/vtkmyEx1"
      )
  ENDIF(BUILD_TESTING)

  # Build the examples as a separate project using a custom target.
  # Make sure it uses the same build configuration as VTK.
  IF(CMAKE_CONFIGURATION_TYPES)
    SET(VTKExamples_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
  ELSE(CMAKE_CONFIGURATION_TYPES)
    SET(VTKExamples_CONFIG_TYPE)
  ENDIF(CMAKE_CONFIGURATION_TYPES)
  ADD_CUSTOM_COMMAND(
    OUTPUT ${VTK_BINARY_DIR}/VTKExamples
    COMMAND ${CMAKE_CTEST_COMMAND}
    ARGS ${VTKExamples_CONFIG_TYPE}
         --build-and-test
         ${VTK_SOURCE_DIR}/Examples
         ${VTK_BINARY_DIR}/Examples/All
         --build-noclean
         --build-two-config
         --build-project VTKExamples
         --build-generator ${CMAKE_GENERATOR}
         --build-makeprogram ${CMAKE_MAKE_PROGRAM}
         --build-options -DVTK_DIR:PATH=${VTK_BINARY_DIR}
                         -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
                         -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
                         -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}
                         -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}
                         -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL}
                         -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO}
                         -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
                         -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
                         -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
                         -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
                         -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL}
                         -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
                         -DEXECUTABLE_OUTPUT_PATH:PATH=${EXECUTABLE_OUTPUT_PATH}
                         -DLIBRARY_OUTPUT_PATH:PATH=${LIBRARY_OUTPUT_PATH}
{'fraction_non_alphanumeric': 0.08839122486288849, 'fraction_numerical': 0.00530164533820841, 'mean_word_length': 3.108524220803605, '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': '4475803', 'n_tokens_mistral': 3878, 'n_tokens_neox': 3599, 'n_words': 741}