File: vtkCompileCMakeExtensions.cmake

package info (click to toggle)
vtk 5.0.4-1.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 51,084 kB
  • ctags: 70,426
  • sloc: cpp: 524,166; ansic: 220,276; tcl: 43,377; python: 14,037; perl: 3,102; java: 1,436; yacc: 1,033; sh: 339; lex: 248; makefile: 197; asm: 154
file content (36 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#-----------------------------------------------------------------------------
# Macro to compile VTK's CMake extension commands.
# The arguments are the source and build tree locations for the loaded
# commands project, and the variable in which success/failure should
# be stored.
MACRO(VTK_COMPILE_CMAKE_EXTENSIONS source_dir build_dir result_var)
  # do we need the extensions
  SET (VTK_NEED_LOADED_COMMANDS 0)
  IF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
    SET (VTK_NEED_LOADED_COMMANDS 1)
  ENDIF (VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
  IF (VTK_WRAP_JAVA)
    SET (VTK_NEED_LOADED_COMMANDS 1)
  ENDIF (VTK_WRAP_JAVA)
  
  # if we need them
  IF (VTK_NEED_LOADED_COMMANDS)
    # if they are not already loaded
    IF(COMMAND VTK_WRAP_TCL2)
    ELSE(COMMAND VTK_WRAP_TCL2)
      MESSAGE(STATUS "Compiling VTK CMake commands")
      TRY_COMPILE("${result_var}" "${build_dir}" "${source_dir}"
        VTK_LOADED_COMMANDS      
        CMAKE_FLAGS -DVTK_BUILD_FROM_TRY_COMPILE:BOOL=TRUE
        OUTPUT_VARIABLE VTK_COMPILE_CMAKE_EXTENSIONS_OUTPUT)
      IF("${result_var}")
        MESSAGE(STATUS "Compiling VTK CMake commands - done")
      ELSE("${result_var}")
        WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log 
          "Building of VTK extensions failed with the following output:\n"
          "${VTK_COMPILE_CMAKE_EXTENSIONS_OUTPUT}\n" APPEND)
        MESSAGE(FATAL_ERROR "Compiling VTK CMake commands - failed")
      ENDIF("${result_var}")
    ENDIF(COMMAND VTK_WRAP_TCL2)
  ENDIF (VTK_NEED_LOADED_COMMANDS)
ENDMACRO(VTK_COMPILE_CMAKE_EXTENSIONS)