<commit_before>CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
PROJECT(VTK)

SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${VTK_CMAKE_DIR}")

# Don't build anything unless the version of CMake is high enough.
# The matching ELSE/ENDIF should be the last lines in the file.
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.9)

# Tell the CMake makefile generator to not have rules depend on
# themselves.  This causes extra rebuilds when the include path
# changes from turning a kit on or off.
SET(CMAKE_SKIP_RULE_DEPENDENCY 1)

#-----------------------------------------------------------------------------
# VTK version number.  An even minor number corresponds to releases.
SET(VTK_MAJOR_VERSION 5)
SET(VTK_MINOR_VERSION 1)
SET(VTK_BUILD_VERSION 0)
SET(VTK_VERSION
    "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")

# Append the library version information to the library target
# properties.  A parent project may set its own properties and/or may
# block this.
IF(NOT VTK_NO_LIBRARY_VERSION)
  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES}
    VERSION "${VTK_VERSION}"
    SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}"
    )
ENDIF(NOT VTK_NO_LIBRARY_VERSION)

#-----------------------------------------------------------------------------
# Determine whether we are being built by CTest and if so the version.
# For CTest 2.2 and higher this will contain the version number.  For
# earlier CTest versions this will contain just "1".  If not
# configuring from CTest this should be empty, so set the result to a
# literal "0" (helps with numerical comparisons).
SET(VTK_TEST_FROM_CTEST "$ENV{DASHBOARD_TEST_FROM_CTEST}")
IF(NOT VTK_TEST_FROM_CTEST)
  SET(VTK_TEST_FROM_CTEST 0)
ENDIF(NOT VTK_TEST_FROM_CTEST)

# Determine whether tests requiring the configuration type to be known
# can be run.  Start by assuming the configuration type is known.
# This is the case when using a generator supporting only one
# configuration type.
SET(VTK_TEST_CONFIG_TYPE_KNOWN 1)
IF(CMAKE_CONFIGURATION_TYPES)
  # When there are multiple configuration types we must be running
  # tests with a CTest that knows how to give the configuration type
  # to the test when it runs.  This requires CTest 2.2 or higher.
  IF(VTK_TEST_FROM_CTEST LESS "2.2")
    # This is either a CTest older than 2.2 or not a CTest.
    # The configuration type will not be known when running the tests.
    SET(VTK_TEST_CONFIG_TYPE_KNOWN 0)
  ENDIF(VTK_TEST_FROM_CTEST LESS "2.2")
ENDIF(CMAKE_CONFIGURATION_TYPES)

#-----------------------------------------------------------------------------
# Load some macros.
INCLUDE(${VTK_CMAKE_DIR}/vtkDependentOption.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkThirdParty.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)

#-----------------------------------------------------------------------------
# Choose static or shared libraries.
INCLUDE(${VTK_CMAKE_DIR}/vtkSelectSharedLibraries.cmake)

# Disable the install targets if using the rpath feature.
IF(NOT WIN32)
  IF(VTK_USE_RPATH)
    SET(VTK_INSTALL_NO_RUNTIME 1)
    SET(VTK_INSTALL_NO_DEVELOPMENT 1)
    SET(VTK_INSTALL_NO_DOCUMENTATION 1)
  ENDIF(VTK_USE_RPATH)
ENDIF(NOT WIN32)

#-----------------------------------------------------------------------------
# Discover the name of the runtime library path environment variable
# and put the result in SHARED_LIBRARY_PATH_VAR_NAME.
# The result depends on the platform and on some platforms it depends on
# the compiler options (32-bit vs. 64-bit).

INCLUDE(${VTK_CMAKE_DIR}/SharedLibraryPathVarName.cmake)

#-----------------------------------------------------------------------------
# Output directories.
IF(NOT LIBRARY_OUTPUT_PATH)
  SET(LIBRARY_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT LIBRARY_OUTPUT_PATH)
IF(NOT EXECUTABLE_OUTPUT_PATH)
  SET(EXECUTABLE_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})

#-----------------------------------------------------------------------------
# Configure install locations.  This allows parent projects to modify
# the install location.  Optionally allow the project to specify a
# single VTK_INSTALL_ROOT which basically adds to its install prefix
# for VTK only.

# The location in which to install VTK executables.
IF(NOT VTK_INSTALL_BIN_DIR)
  SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin)
ENDIF(NOT VTK_INSTALL_BIN_DIR)

# The location in which to install VTK header files.
IF(NOT VTK_INSTALL_INCLUDE_DIR)
  SET(VTK_INSTALL_INCLUDE_DIR
    ${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
ENDIF(NOT VTK_INSTALL_INCLUDE_DIR)

# The location in which to install VTK libraries.
IF(NOT VTK_INSTALL_LIB_DIR)
  SET(VTK_INSTALL_LIB_DIR ${VTK_INSTALL_ROOT}/lib)
ENDIF(NOT VTK_INSTALL_LIB_DIR)

# The location in which to install CMake scripts for packaging VTK.
IF(NOT VTK_INSTALL_PACKAGE_DIR)
  SET(VTK_INSTALL_PACKAGE_DIR
    ${VTK_INSTALL_LIB_DIR}/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
ENDIF(NOT VTK_INSTALL_PACKAGE_DIR)

# The location in which to install VTK doxygen documentation helper
# files.
IF(NOT VTK_INSTALL_DOXYGEN_DIR)
  SET(VTK_INSTALL_DOXYGEN_DIR ${VTK_INSTALL_PACKAGE_DIR}/doxygen)
ENDIF(NOT VTK_INSTALL_DOXYGEN_DIR)

# Compute the proper location for installing the Tcl package.  This
# must be a fixed relative path below the library install location and
# is therefore not settable by parent projects.
SET(VTK_INSTALL_TCL_DIR
  ${VTK_INSTALL_LIB_DIR}/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
  )

IF(NOT VTK_INSTALL_JAVA_DIR)
  SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java)
ENDIF(NOT VTK_INSTALL_JAVA_DIR)

# Choose a default CMAKE_INSTALL_PREFIX on Windows.  CMake 2.2 and
# above already choose a good default, so force a change only if the
# current value looks like the CMake 2.0 default.
IF(NOT UNIX)
  IF(CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
    IF("$ENV{ProgramFiles}" MATCHES "^$")
      IF("$ENV{SystemDrive}" MATCHES "^$")
        SET(VTK_GENERIC_PROGRAM_FILES "C:/Program Files")
      ELSE("$ENV{SystemDrive}" MATCHES "^$")
        SET(VTK_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
      ENDIF("$ENV{SystemDrive}" MATCHES "^$")
    ELSE("$ENV{ProgramFiles}" MATCHES "^$")
      SET(VTK_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
    ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
    SET(CMAKE_INSTALL_PREFIX
      "${VTK_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
      CACHE PATH "Install path prefix, prepended onto install directories."
      FORCE)
    SET(VTK_GENERIC_SYSTEM_DRIVE)
  ENDIF(CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
  MARK_AS_ADVANCED(CLEAR CMAKE_INSTALL_PREFIX)
ENDIF(NOT UNIX)

# There are three basic components to the VTK installation: runtime,
# development, and documentation.  Install rules for each component
# are surrounded by blockers.  Parent projects or users can specify
# VTK_INSTALL_NO_RUNTIME, VTK_INSTALL_NO_DEVELOPMENT, or
# VTK_INSTALL_NO_DOCUMENTATION to avoid installation of the
# corresponding component.

# Shared libraries are considered both runtime and development and
# static libraries are considered development only.  In order to
# switch library installation on and off correctly we make the
# decision here.
SET(VTK_INSTALL_NO_LIBRARIES)
IF(BUILD_SHARED_LIBS)
  IF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
    SET(VTK_INSTALL_NO_LIBRARIES 1)
  ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
  IF(VTK_INSTALL_NO_DEVELOPMENT)
    SET(VTK_INSTALL_NO_LIBRARIES 1)
  ENDIF(VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)

#-----------------------------------------------------------------------------
# Save the compiler settings so another project can import them.
CMAKE_EXPORT_BUILD_SETTINGS(${VTK_BINARY_DIR}/VTKBuildSettings.cmake)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
  INSTALL_FILES(${VTK_INSTALL_PACKAGE_DIR} .cmake VTKBuildSettings)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)

#-----------------------------------------------------------------------------
# Provide compatibility options.
OPTION(VTK_LEGACY_REMOVE "Remove all legacy code completely." OFF)
OPTION(VTK_LEGACY_SILENT "Silence all legacy code messages." OFF)
MARK_AS_ADVANCED(VTK_LEGACY_REMOVE VTK_LEGACY_SILENT)

#-----------------------------------------------------------------------------
# Determine the set of VTK kits that should be built.
OPTION(VTK_USE_RENDERING "Build the vtkRendering kit.  Needed for displaying data or using widgets." ON)
VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL "Build the vtkParallel kit." OFF
                     "VTK_USE_RENDERING" OFF)

# Determine Shading Support
VTK_DEPENDENT_OPTION(VTK_USE_CG_SHADERS "Build pixel and vertex shader support for Cg." OFF
                     "VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_GLSL_SHADERS "Build pixel and vertex shader support for GLSL." OFF
                     "VTK_USE_RENDERING" OFF)

SET(VTK_DEFAULT_SHADERS_DIR
   "${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository"
   CACHE INTERNAL 
   "The directory in which code for Shaders is provided.")

SET(VTK_MATERIALS_DIRS 
  ${VTK_DEFAULT_SHADERS_DIR}
  CACHE STRING
  "; separated directories to search for materials/shaders")

MARK_AS_ADVANCED(VTK_MATERIALS_DIRS)

  
# Determine GUI Support.
VTK_DEPENDENT_OPTION(VTK_USE_GUISUPPORT "Build VTK with GUI Support" OFF
                     "VTK_USE_RENDERING" OFF)
MARK_AS_ADVANCED(VTK_USE_GUISUPPORT)

# Remove old options from an existing cache.
IF("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
ELSE("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
  SET(VTK_USE_HYBRID "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
IF("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
ELSE("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
  SET(VTK_USE_PATENTED "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
IF("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
ELSE("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
  SET(VTK_USE_VOLUMERENDERING "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")

SET(VTK_KITS COMMON FILTERING IO GRAPHICS GENERIC_FILTERING IMAGING)
IF(VTK_USE_RENDERING)
  SET(VTK_KITS ${VTK_KITS} RENDERING)
  SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
  SET(VTK_KITS ${VTK_KITS} HYBRID)
  SET(VTK_KITS ${VTK_KITS} WIDGETS)
ENDIF(VTK_USE_RENDERING)
IF(VTK_USE_PARALLEL)
  SET(VTK_KITS ${VTK_KITS} PARALLEL)
ENDIF(VTK_USE_PARALLEL)

# from GUISupport
IF(VTK_USE_QVTK)
  SET(VTK_KITS ${VTK_KITS} QVTK)
ENDIF(VTK_USE_QVTK)
IF(VTK_USE_MFC)
  SET(VTK_KITS ${VTK_KITS} MFC)
ENDIF(VTK_USE_MFC)


#-----------------------------------------------------------------------------
# Determine GUI.
FIND_PACKAGE(X11)
SET(VTK_USE_X_OPTIONAL 0)
SET(VTK_USE_X_FORCE 0)
IF(X11_FOUND)
  IF(CYGWIN)
    SET(VTK_USE_X_OPTIONAL 1)
  ENDIF(CYGWIN)
  IF(APPLE)
    SET(VTK_USE_X_OPTIONAL 1)
  ELSE(APPLE)
    SET(VTK_USE_X_FORCE ${VTK_USE_RENDERING})
  ENDIF(APPLE)
ENDIF(X11_FOUND)

VTK_DEPENDENT_OPTION(VTK_USE_CARBON "Build classes using Carbon API." ON
                     "APPLE;VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_COCOA "Build classes using Cocoa API." OFF
                     "APPLE;VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_X
                     "Build classes for the X11 window system." OFF
                     "X11_FOUND;VTK_USE_RENDERING;VTK_USE_X_OPTIONAL"
                     "${VTK_USE_X_FORCE}")

IF(VTK_USE_CARBON AND VTK_USE_COCOA)
  MESSAGE(SEND_ERROR "Only one of VTK_USE_CARBON and VTK_USE_COCOA may be ON.")
  SET(VTK_USE_CARBON 0)
  SET(VTK_USE_COCOA 0)
ENDIF(VTK_USE_CARBON AND VTK_USE_COCOA)

#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# VTK requires special compiler flags on some platforms.
SET(VTK_REQUIRED_C_FLAGS)
SET(VTK_REQUIRED_CXX_FLAGS)

# make sure Crun is linked in with the native compiler, it is
# not used by default for shared libraries and is required for
# things like java to work.
IF(CMAKE_SYSTEM MATCHES "SunOS.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
    FIND_LIBRARY(VTK_SUNCC_CRUN_LIBRARY Crun)
    IF(VTK_SUNCC_CRUN_LIBRARY)
      LINK_LIBRARIES(${VTK_SUNCC_CRUN_LIBRARY})
    ENDIF(VTK_SUNCC_CRUN_LIBRARY)
    FIND_LIBRARY(VTK_SUNCC_CSTD_LIBRARY Cstd)
    IF(VTK_SUNCC_CSTD_LIBRARY)
      LINK_LIBRARIES(${VTK_SUNCC_CSTD_LIBRARY})
    ENDIF(VTK_SUNCC_CSTD_LIBRARY)
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")

IF(CMAKE_COMPILER_IS_GNUCXX)
  # A GCC compiler.  Quiet warning about strstream deprecation.
  SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -Wno-deprecated")
  IF(WIN32)
    # The platform is gcc on cygwin.
    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
  ENDIF(WIN32)
  IF(MINGW)
    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mthreads")
    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mthreads")
    SET(VTK_REQUIRED_EXE_LINKER_FLAGS "${VTK_REQUIRED_EXE_LINKER_FLAGS} -mthreads")
    SET(VTK_REQUIRED_SHARED_LINKER_FLAGS "${VTK_REQUIRED_SHARED_LINKER_FLAGS} -mthreads")
    SET(VTK_REQUIRED_MODULE_LINKER_FLAGS "${VTK_REQUIRED_MODULE_LINKER_FLAGS} -mthreads")
    LINK_LIBRARIES(-lgdi32)
  ENDIF(MINGW)
  IF(CMAKE_SYSTEM MATCHES "SunOS.*")
    # Disable warnings that occur in X11 headers.
    IF(DART_ROOT AND BUILD_TESTING)
      SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -Wno-unknown-pragmas")
      SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -Wno-unknown-pragmas")
    ENDIF(DART_ROOT AND BUILD_TESTING)
  ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
  IF(CMAKE_ANSI_CFLAGS)<commit_msg>ENH: help CMake finding the Crun, Cstd lib<commit_after>CMAKE_MINIMUM_REQUIRED(VERSION 2.0)
PROJECT(VTK)

SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${VTK_CMAKE_DIR}")

# Don't build anything unless the version of CMake is high enough.
# The matching ELSE/ENDIF should be the last lines in the file.
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.9)

# Tell the CMake makefile generator to not have rules depend on
# themselves.  This causes extra rebuilds when the include path
# changes from turning a kit on or off.
SET(CMAKE_SKIP_RULE_DEPENDENCY 1)

#-----------------------------------------------------------------------------
# VTK version number.  An even minor number corresponds to releases.
SET(VTK_MAJOR_VERSION 5)
SET(VTK_MINOR_VERSION 1)
SET(VTK_BUILD_VERSION 0)
SET(VTK_VERSION
    "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")

# Append the library version information to the library target
# properties.  A parent project may set its own properties and/or may
# block this.
IF(NOT VTK_NO_LIBRARY_VERSION)
  SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES}
    VERSION "${VTK_VERSION}"
    SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}"
    )
ENDIF(NOT VTK_NO_LIBRARY_VERSION)

#-----------------------------------------------------------------------------
# Determine whether we are being built by CTest and if so the version.
# For CTest 2.2 and higher this will contain the version number.  For
# earlier CTest versions this will contain just "1".  If not
# configuring from CTest this should be empty, so set the result to a
# literal "0" (helps with numerical comparisons).
SET(VTK_TEST_FROM_CTEST "$ENV{DASHBOARD_TEST_FROM_CTEST}")
IF(NOT VTK_TEST_FROM_CTEST)
  SET(VTK_TEST_FROM_CTEST 0)
ENDIF(NOT VTK_TEST_FROM_CTEST)

# Determine whether tests requiring the configuration type to be known
# can be run.  Start by assuming the configuration type is known.
# This is the case when using a generator supporting only one
# configuration type.
SET(VTK_TEST_CONFIG_TYPE_KNOWN 1)
IF(CMAKE_CONFIGURATION_TYPES)
  # When there are multiple configuration types we must be running
  # tests with a CTest that knows how to give the configuration type
  # to the test when it runs.  This requires CTest 2.2 or higher.
  IF(VTK_TEST_FROM_CTEST LESS "2.2")
    # This is either a CTest older than 2.2 or not a CTest.
    # The configuration type will not be known when running the tests.
    SET(VTK_TEST_CONFIG_TYPE_KNOWN 0)
  ENDIF(VTK_TEST_FROM_CTEST LESS "2.2")
ENDIF(CMAKE_CONFIGURATION_TYPES)

#-----------------------------------------------------------------------------
# Load some macros.
INCLUDE(${VTK_CMAKE_DIR}/vtkDependentOption.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkThirdParty.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkExportKit.cmake)
INCLUDE(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeExportBuildSettings.cmake)

#-----------------------------------------------------------------------------
# Choose static or shared libraries.
INCLUDE(${VTK_CMAKE_DIR}/vtkSelectSharedLibraries.cmake)

# Disable the install targets if using the rpath feature.
IF(NOT WIN32)
  IF(VTK_USE_RPATH)
    SET(VTK_INSTALL_NO_RUNTIME 1)
    SET(VTK_INSTALL_NO_DEVELOPMENT 1)
    SET(VTK_INSTALL_NO_DOCUMENTATION 1)
  ENDIF(VTK_USE_RPATH)
ENDIF(NOT WIN32)

#-----------------------------------------------------------------------------
# Discover the name of the runtime library path environment variable
# and put the result in SHARED_LIBRARY_PATH_VAR_NAME.
# The result depends on the platform and on some platforms it depends on
# the compiler options (32-bit vs. 64-bit).

INCLUDE(${VTK_CMAKE_DIR}/SharedLibraryPathVarName.cmake)

#-----------------------------------------------------------------------------
# Output directories.
IF(NOT LIBRARY_OUTPUT_PATH)
  SET(LIBRARY_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT LIBRARY_OUTPUT_PATH)
IF(NOT EXECUTABLE_OUTPUT_PATH)
  SET(EXECUTABLE_OUTPUT_PATH ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})

#-----------------------------------------------------------------------------
# Configure install locations.  This allows parent projects to modify
# the install location.  Optionally allow the project to specify a
# single VTK_INSTALL_ROOT which basically adds to its install prefix
# for VTK only.

# The location in which to install VTK executables.
IF(NOT VTK_INSTALL_BIN_DIR)
  SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin)
ENDIF(NOT VTK_INSTALL_BIN_DIR)

# The location in which to install VTK header files.
IF(NOT VTK_INSTALL_INCLUDE_DIR)
  SET(VTK_INSTALL_INCLUDE_DIR
    ${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
ENDIF(NOT VTK_INSTALL_INCLUDE_DIR)

# The location in which to install VTK libraries.
IF(NOT VTK_INSTALL_LIB_DIR)
  SET(VTK_INSTALL_LIB_DIR ${VTK_INSTALL_ROOT}/lib)
ENDIF(NOT VTK_INSTALL_LIB_DIR)

# The location in which to install CMake scripts for packaging VTK.
IF(NOT VTK_INSTALL_PACKAGE_DIR)
  SET(VTK_INSTALL_PACKAGE_DIR
    ${VTK_INSTALL_LIB_DIR}/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
ENDIF(NOT VTK_INSTALL_PACKAGE_DIR)

# The location in which to install VTK doxygen documentation helper
# files.
IF(NOT VTK_INSTALL_DOXYGEN_DIR)
  SET(VTK_INSTALL_DOXYGEN_DIR ${VTK_INSTALL_PACKAGE_DIR}/doxygen)
ENDIF(NOT VTK_INSTALL_DOXYGEN_DIR)

# Compute the proper location for installing the Tcl package.  This
# must be a fixed relative path below the library install location and
# is therefore not settable by parent projects.
SET(VTK_INSTALL_TCL_DIR
  ${VTK_INSTALL_LIB_DIR}/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
  )

IF(NOT VTK_INSTALL_JAVA_DIR)
  SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java)
ENDIF(NOT VTK_INSTALL_JAVA_DIR)

# Choose a default CMAKE_INSTALL_PREFIX on Windows.  CMake 2.2 and
# above already choose a good default, so force a change only if the
# current value looks like the CMake 2.0 default.
IF(NOT UNIX)
  IF(CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
    IF("$ENV{ProgramFiles}" MATCHES "^$")
      IF("$ENV{SystemDrive}" MATCHES "^$")
        SET(VTK_GENERIC_PROGRAM_FILES "C:/Program Files")
      ELSE("$ENV{SystemDrive}" MATCHES "^$")
        SET(VTK_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
      ENDIF("$ENV{SystemDrive}" MATCHES "^$")
    ELSE("$ENV{ProgramFiles}" MATCHES "^$")
      SET(VTK_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
    ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
    SET(CMAKE_INSTALL_PREFIX
      "${VTK_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
      CACHE PATH "Install path prefix, prepended onto install directories."
      FORCE)
    SET(VTK_GENERIC_SYSTEM_DRIVE)
  ENDIF(CMAKE_INSTALL_PREFIX MATCHES "/usr/local")
  MARK_AS_ADVANCED(CLEAR CMAKE_INSTALL_PREFIX)
ENDIF(NOT UNIX)

# There are three basic components to the VTK installation: runtime,
# development, and documentation.  Install rules for each component
# are surrounded by blockers.  Parent projects or users can specify
# VTK_INSTALL_NO_RUNTIME, VTK_INSTALL_NO_DEVELOPMENT, or
# VTK_INSTALL_NO_DOCUMENTATION to avoid installation of the
# corresponding component.

# Shared libraries are considered both runtime and development and
# static libraries are considered development only.  In order to
# switch library installation on and off correctly we make the
# decision here.
SET(VTK_INSTALL_NO_LIBRARIES)
IF(BUILD_SHARED_LIBS)
  IF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
    SET(VTK_INSTALL_NO_LIBRARIES 1)
  ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
  IF(VTK_INSTALL_NO_DEVELOPMENT)
    SET(VTK_INSTALL_NO_LIBRARIES 1)
  ENDIF(VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)

#-----------------------------------------------------------------------------
# Save the compiler settings so another project can import them.
CMAKE_EXPORT_BUILD_SETTINGS(${VTK_BINARY_DIR}/VTKBuildSettings.cmake)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
  INSTALL_FILES(${VTK_INSTALL_PACKAGE_DIR} .cmake VTKBuildSettings)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)

#-----------------------------------------------------------------------------
# Provide compatibility options.
OPTION(VTK_LEGACY_REMOVE "Remove all legacy code completely." OFF)
OPTION(VTK_LEGACY_SILENT "Silence all legacy code messages." OFF)
MARK_AS_ADVANCED(VTK_LEGACY_REMOVE VTK_LEGACY_SILENT)

#-----------------------------------------------------------------------------
# Determine the set of VTK kits that should be built.
OPTION(VTK_USE_RENDERING "Build the vtkRendering kit.  Needed for displaying data or using widgets." ON)
VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL "Build the vtkParallel kit." OFF
                     "VTK_USE_RENDERING" OFF)

# Determine Shading Support
VTK_DEPENDENT_OPTION(VTK_USE_CG_SHADERS "Build pixel and vertex shader support for Cg." OFF
                     "VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_GLSL_SHADERS "Build pixel and vertex shader support for GLSL." OFF
                     "VTK_USE_RENDERING" OFF)

SET(VTK_DEFAULT_SHADERS_DIR
   "${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository"
   CACHE INTERNAL 
   "The directory in which code for Shaders is provided.")

SET(VTK_MATERIALS_DIRS 
  ${VTK_DEFAULT_SHADERS_DIR}
  CACHE STRING
  "; separated directories to search for materials/shaders")

MARK_AS_ADVANCED(VTK_MATERIALS_DIRS)

  
# Determine GUI Support.
VTK_DEPENDENT_OPTION(VTK_USE_GUISUPPORT "Build VTK with GUI Support" OFF
                     "VTK_USE_RENDERING" OFF)
MARK_AS_ADVANCED(VTK_USE_GUISUPPORT)

# Remove old options from an existing cache.
IF("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
ELSE("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
  SET(VTK_USE_HYBRID "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
IF("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
ELSE("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
  SET(VTK_USE_PATENTED "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
IF("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
ELSE("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
  SET(VTK_USE_VOLUMERENDERING "" CACHE INTERNAL "Hiding old option")
ENDIF("VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")

SET(VTK_KITS COMMON FILTERING IO GRAPHICS GENERIC_FILTERING IMAGING)
IF(VTK_USE_RENDERING)
  SET(VTK_KITS ${VTK_KITS} RENDERING)
  SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
  SET(VTK_KITS ${VTK_KITS} HYBRID)
  SET(VTK_KITS ${VTK_KITS} WIDGETS)
ENDIF(VTK_USE_RENDERING)
IF(VTK_USE_PARALLEL)
  SET(VTK_KITS ${VTK_KITS} PARALLEL)
ENDIF(VTK_USE_PARALLEL)

# from GUISupport
IF(VTK_USE_QVTK)
  SET(VTK_KITS ${VTK_KITS} QVTK)
ENDIF(VTK_USE_QVTK)
IF(VTK_USE_MFC)
  SET(VTK_KITS ${VTK_KITS} MFC)
ENDIF(VTK_USE_MFC)


#-----------------------------------------------------------------------------
# Determine GUI.
FIND_PACKAGE(X11)
SET(VTK_USE_X_OPTIONAL 0)
SET(VTK_USE_X_FORCE 0)
IF(X11_FOUND)
  IF(CYGWIN)
    SET(VTK_USE_X_OPTIONAL 1)
  ENDIF(CYGWIN)
  IF(APPLE)
    SET(VTK_USE_X_OPTIONAL 1)
  ELSE(APPLE)
    SET(VTK_USE_X_FORCE ${VTK_USE_RENDERING})
  ENDIF(APPLE)
ENDIF(X11_FOUND)

VTK_DEPENDENT_OPTION(VTK_USE_CARBON "Build classes using Carbon API." ON
                     "APPLE;VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_COCOA "Build classes using Cocoa API." OFF
                     "APPLE;VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_X
                     "Build classes for the X11 window system." OFF
                     "X11_FOUND;VTK_USE_RENDERING;VTK_USE_X_OPTIONAL"
                     "${VTK_USE_X_FORCE}")

IF(VTK_USE_CARBON AND VTK_USE_COCOA)
  MESSAGE(SEND_ERROR "Only one of VTK_USE_CARBON and VTK_USE_COCOA may be ON.")
  SET(VTK_USE_CARBON 0)
  SET(VTK_USE_COCOA 0)
ENDIF(VTK_USE_CARBON AND VTK_USE_COCOA)

#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# VTK requires special compiler flags on some platforms.
SET(VTK_REQUIRED_C_FLAGS)
SET(VTK_REQUIRED_CXX_FLAGS)

# make sure Crun is linked in with the native compiler, it is
# not used by default for shared libraries and is required for
# things like java to work.
IF(CMAKE_SYSTEM MATCHES "SunOS.*")
  IF(NOT CMAKE_COMPILER_IS_GNUCXX)
    FIND_LIBRARY(VTK_SUNCC_CRUN_LIBRARY Crun /opt/SUNWspro/lib)
    IF(VTK_SUNCC_CRUN_LIBRARY)
      LINK_LIBRARIES(${VTK_SUNCC_CRUN_LIBRARY})
    ENDIF(VTK_SUNCC_CRUN_LIBRARY)
    FIND_LIBRARY(VTK_SUNCC_CSTD_LIBRARY Cstd /opt/SUNWspro/lib)
    IF(VTK_SUNCC_CSTD_LIBRARY)
      LINK_LIBRARIES(${VTK_SUNCC_CSTD_LIBRARY})
    ENDIF(VTK_SUNCC_CSTD_LIBRARY)
  ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")

IF(CMAKE_COMPILER_IS_GNUCXX)
  # A GCC compiler.  Quiet warning about strstream deprecation.
  SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -Wno-deprecated")
  IF(WIN32)
    # The platform is gcc on cygwin.
    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mwin32")
    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mwin32")
  ENDIF(WIN32)
  IF(MINGW)
    SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -mthreads")
    SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -mthreads")
    SET(VTK_REQUIRED_EXE_LINKER_FLAGS "${VTK_REQUIRED_EXE_LINKER_FLAGS} -mthreads")
    SET(VTK_REQUIRED_SHARED_LINKER_FLAGS "${VTK_REQUIRED_SHARED_LINKER_FLAGS} -mthreads")
    SET(VTK_REQUIRED_MODULE_LINKER_FLAGS "${VTK_REQUIRED_MODULE_LINKER_FLAGS} -mthreads")
    LINK_LIBRARIES(-lgdi32)
  ENDIF(MINGW)
  IF(CMAKE_SYSTEM MATCHES "SunOS.*")
    # Disable warnings that occur in X11 headers.
    IF(DART_ROOT AND BUILD_TESTING)
      SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -Wno-unknown-pragmas")
      SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -Wno-unknown-pragmas")
    ENDIF(DART_ROOT AND BUILD_TESTING)
  ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
  IF(CMAKE_ANSI_CFLAGS)
{'fraction_non_alphanumeric': 0.14608974582476203, 'fraction_numerical': 0.004741815138942157, 'mean_word_length': 3.7755577755577754, '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': '5165532', 'n_tokens_mistral': 10926, 'n_tokens_neox': 10210, 'n_words': 2232}