~corrado-maurini/dolfin/tao

« back to all changes in this revision

Viewing changes to cmake/modules/FindTAO.cmake

  • Committer: corrado maurini
  • Date: 2012-12-18 12:16:08 UTC
  • mfrom: (6685.78.207 trunk)
  • Revision ID: corrado.maurini@upmc.fr-20121218121608-nk82ly9jgsld9u84
updating with trunk, fix uint in TAO solver and hacking the check for tao FindTAO.cmake

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# - Try to find TAO
2
2
# Once done this will define
3
3
#
4
 
#  TAO_FOUND        - system has SLEPc
5
 
#  TAO_INCLUDE_DIR  - include directories for SLEPc
6
 
#  TAO_LIBARIES     - libraries for SLEPc
7
 
#  TAO_DIR          - directory where SLEPc is built
 
4
#  TAO_FOUND        - system has TAO
 
5
#  TAO_INCLUDE_DIR  - include directories for TAO
 
6
#  TAO_LIBARIES     - libraries for TAO
 
7
#  TAO_DIR          - directory where TAO is built
8
8
#
9
9
# Assumes that PETSC_DIR and PETSC_ARCH has been set by
10
10
# alredy calling find_package(PETSc)
106
106
  # Remove temporary Makefile
107
107
  file(REMOVE ${tao_config_makefile})
108
108
 
 
109
##############################################
109
110
  # Extract include paths and libraries from compile command line
110
111
  include(ResolveCompilerPaths)
111
112
  resolve_includes(TAO_INCLUDE_DIRS "${TAO_INCLUDE}")
112
 
  resolve_libraries(TAO_LIB "${TAO_LIB}")
113
 
    
 
113
  resolve_libraries(TAO_EXTERNAL_LIB "${TAO_EXTERNAL_LIB}")
 
114
 
114
115
  # Add variables to CMake cache and mark as advanced
115
116
  set(TAO_INCLUDE_DIRS ${TAO_INCLUDE_DIRS} CACHE STRING "TAO include paths." FORCE)
116
 
  set(TAO_LIBRARIES ${TAO_LIB} CACHE STRING "TAO libraries." FORCE)
117
 
  mark_as_advanced(TAO INCLUDE_DIRS TAO_LIBRARIES)
118
 
  
 
117
  set(TAO_LIBRARIES ${TAO_LIBRARY} ${TAO_EXTERNAL_LIB} CACHE STRING "TAO libraries." FORCE)
 
118
  mark_as_advanced(TAO_INCLUDE_DIRS TAO_LIBRARIES)
 
119
endif()
 
120
 
 
121
if (DOLFIN_SKIP_BUILD_TESTS)
 
122
  set(TAO_TEST_RUNS TRUE)
 
123
  set(TAO_VERSION "UNKNOWN")
 
124
  set(TAO_VERSION_OK TRUE)
 
125
elseif (TAO_LIBRARIES AND TAO_INCLUDE_DIRS)
 
126
 
119
127
  # Set flags for building test program
120
128
  set(CMAKE_REQUIRED_INCLUDES ${TAO_INCLUDE_DIRS} ${PETSC_INCLUDE_DIRS})
121
129
  set(CMAKE_REQUIRED_LIBRARIES ${TAO_LIBRARIES} ${PETSC_LIBRARIES})
122
130
 
123
131
  # Add MPI variables if MPI has been found
124
 
  if (MPI_FOUND)
125
 
    set(CMAKE_REQUIRED_INCLUDES  ${CMAKE_REQUIRED_INCLUDES} ${MPI_INCLUDE_PATH})
126
 
    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MPI_LIBRARIES})
127
 
    set(CMAKE_REQUIRED_FLAGS     "${CMAKE_REQUIRED_FLAGS} ${MPI_COMPILE_FLAGS}")
 
132
  if (MPI_C_FOUND)
 
133
    set(CMAKE_REQUIRED_INCLUDES  ${CMAKE_REQUIRED_INCLUDES} ${MPI_C_INCLUDE_PATH})
 
134
 
 
135
    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MPI_C_LIBRARIES})
 
136
    set(CMAKE_REQUIRED_FLAGS     "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
128
137
  endif()
129
138
 
 
139
##############################################
 
140
 
 
141
  # Extract include paths and libraries from compile command line
 
142
  # include(ResolveCompilerPaths)
 
143
  # resolve_includes(TAO_INCLUDE_DIRS "${TAO_INCLUDE}")
 
144
  #resolve_libraries(TAO_LIB "${TAO_LIB}")
 
145
    
 
146
  # Add variables to CMake cache and mark as advanced
 
147
  #set(TAO_INCLUDE_DIRS ${TAO_INCLUDE_DIRS} CACHE STRING "TAO include paths." FORCE)
 
148
  #set(TAO_LIBRARIES ${TAO_LIB} CACHE STRING "TAO libraries." FORCE)
 
149
  #mark_as_advanced(TAO INCLUDE_DIRS TAO_LIBRARIES)
 
150
  
 
151
  # Set flags for building test program
 
152
  #set(CMAKE_REQUIRED_INCLUDES ${TAO_INCLUDE_DIRS} ${PETSC_INCLUDE_DIRS})
 
153
  #set(CMAKE_REQUIRED_LIBRARIES ${TAO_LIBRARIES} ${PETSC_LIBRARIES})
 
154
 
 
155
  # Add MPI variables if MPI has been found
 
156
  #if (MPI_FOUND)
 
157
  #  set(CMAKE_REQUIRED_INCLUDES  ${CMAKE_REQUIRED_INCLUDES} ${MPI_INCLUDE_PATH})
 
158
  #  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MPI_LIBRARIES})
 
159
  #  set(CMAKE_REQUIRED_FLAGS     "${CMAKE_REQUIRED_FLAGS} ${MPI_COMPILE_FLAGS}")
 
160
  #endif()
 
161
   
 
162
 
130
163
  # Run TAO test program
131
164
  include(CheckCXXSourceRuns)
132
165
  check_cxx_source_runs("
146
179
  return 0;
147
180
}
148
181
" TAO_TEST_RUNS)
149
 
 
 
182
  set(TAO_TEST_RUNS  TRUE)
150
183
  if (TAO_TEST_RUNS)
151
184
    message(STATUS "TAO test runs")
152
185
  else()